Created
July 8, 2019 10:04
-
-
Save yfe404/99e185ef633f1d4279b53f294f2c3a0d to your computer and use it in GitHub Desktop.
Create a persistent reverse 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
IDENTITY="$USER/.ssh/identity.pem" | |
SRC_PORT=19999 | |
DST_PORT=22 | |
DST_USER=gandalf | |
DST_HOST=120.88.7.11 | |
autossh -M 0 -N -o ServerAliveInterval 15 -i $IDENTITY -R $SRC_PORT:localhost:$DST_PORT $DST_USER@$DST_HOST | |
## You can connect back from DST_HOST using ssh -p $SRC_PORT local_user_on_SRC@localhost |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment