Shell Upgrade Cheatsheet
Complete guide to upgrading dumb shells to fully interactive TTYs during penetration testing
Upgrading a basic reverse shell to a fully interactive TTY is essential for running interactive programs (vim, nano, top, sudo, password prompts) and maintaining stable access during engagements.
The Modern Way: Penelope (Recommended)
Penelope is a modern shell handler that automates PTY upgrades, session management, file transfers, and logging. It's a game-changer for penetration testers and CTF players.
::Installation
::Basic Usage
::Key Features
| Feature | Description |
|---|---|
| Auto-upgrade | Automatically upgrades shells to PTY without manual steps |
| Multi-session | Manage multiple shells simultaneously |
| File Transfer | Built-in upload and download commands |
| Logging | Automatic session logging with timestamps |
| Session Menu | Press F12 to access session manager |
| OSCP Safe | Use -O flag for exam compliance |
::Penelope Session Commands
🛠️ Manual Upgrade Methods
When you can't use Penelope, use these classic techniques.
::Method 1: Python PTY (Most Common)
::Method 2: Script Command
::Method 3: Socat
::Method 4: Using stty/nc (No Python)
The Full Interactive TTY Upgrade
This is the classic 5-step method for maximum compatibility when you have a basic Python PTY.
::Step-by-Step
::Quick Version (If You Know Your Terminal Size)
Alternative Languages & Tools
::Perl
::Ruby
::Lua
::AWK
::Using /bin/sh (Minimal)
Terminal Size Reference
| Command | Purpose |
|---|---|
stty size | Quick rows/cols output |
stty -a | Full terminal settings |
stty rows 50 cols 200 | Set manual size |
resize | Auto-detect size (if available) |
Tip: Before backgrounding your shell, run stty -a in your local terminal and note the rows and columns values. Use these exact values in step 5.
🔗 Resources
- ▹Penelope GitHub - Modern shell handler
- ▹Pentest Monkey Reverse Shell Cheatsheet
- ▹Upgrading Simple Shells to Fully Interactive TTYs
Linux Privilege Escalation: Enumeration Cheatsheet
Copy-paste-ready enumeration commands covering every critical Linux privesc vector — OS, users, network, files, capabilities, and scheduled tasks. Built for Red Teamers, pentesters, and CTF players.
Linux Privilege Escalation: Basics & Exploitation
Kill chains for sudo abuse, SUID/capabilities, PATH hijacking, cron exploitation, NFS no_root_squash, and runtime process hunting with pspy. Built for Red Teamers and CTF players who skip the theory.
