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,587 @@
1
+ # CTF Reverse - Compiled Language Reversing (Go, Rust)
2
+
3
+ ## Table of Contents
4
+ - [Go Binary Reversing](#go-binary-reversing)
5
+ - [Recognition](#recognition)
6
+ - [Symbol Recovery](#symbol-recovery)
7
+ - [Go Memory Layout](#go-memory-layout)
8
+ - [Goroutine and Concurrency Analysis](#goroutine-and-concurrency-analysis)
9
+ - [Common Go Patterns in Decompilation](#common-go-patterns-in-decompilation)
10
+ - [Go Binary Reversing Workflow](#go-binary-reversing-workflow)
11
+ - [Go Binary UUID Patching for C2 Client Enumeration (BSidesSF 2026)](#go-binary-uuid-patching-for-c2-client-enumeration-bsidessf-2026)
12
+ - [Rust Binary Reversing](#rust-binary-reversing)
13
+ - [Rust Recognition](#rust-recognition)
14
+ - [Symbol Demangling](#symbol-demangling)
15
+ - [Common Rust Patterns in Decompilation](#common-rust-patterns-in-decompilation)
16
+ - [Rust-Specific Analysis Tools](#rust-specific-analysis-tools)
17
+ - [Swift Binary Reversing](#swift-binary-reversing)
18
+ - [Kotlin / JVM Binary Reversing](#kotlin--jvm-binary-reversing)
19
+ - [JVM Bytecode (Android/Server)](#jvm-bytecode-androidserver)
20
+ - [Kotlin/Native](#kotlinnative)
21
+ - [D Language Binary Reversing (CSAW CTF 2016)](#d-language-binary-reversing-csaw-ctf-2016)
22
+ - [Haskell Binary Reversing via STG Closures and hsdecomp (hxp CTF 2017, Codegate 2018)](#haskell-binary-reversing-via-stg-closures-and-hsdecomp-hxp-ctf-2017-codegate-2018)
23
+ - [Haskell Binary RE via GHC CMM Intermediate Language (N1CTF 2018)](#haskell-binary-re-via-ghc-cmm-intermediate-language-n1ctf-2018)
24
+ - [.NET / C# Binary Reversing](#net--c-binary-reversing)
25
+ - [C++ Binary Reversing (Quick Reference)](#c-binary-reversing-quick-reference)
26
+ - [vtable Reconstruction](#vtable-reconstruction)
27
+ - [RTTI (Run-Time Type Information)](#rtti-run-time-type-information)
28
+ - [Standard Library Patterns](#standard-library-patterns)
29
+
30
+ ---
31
+
32
+ ## Go Binary Reversing
33
+
34
+ Go binaries are increasingly common in CTF challenges due to Go's popularity for CLI tools, network services, and malware.
35
+
36
+ ### Recognition
37
+
38
+ ```bash
39
+ # Detect Go binary
40
+ file binary | grep -i "go"
41
+ strings binary | grep "go.buildid"
42
+ strings binary | grep "runtime.gopanic"
43
+
44
+ # Go version embedded in binary
45
+ strings binary | grep "^go1\."
46
+ ```
47
+
48
+ **Key indicators:**
49
+ - Very large static binary (even "hello world" is ~2MB)
50
+ - Embedded `go.buildid` string
51
+ - `runtime.*` symbols (even in stripped binaries, some remain)
52
+ - `main.main` as entry point (not `main`)
53
+ - Strings like `GOROOT`, `GOPATH`, `/usr/local/go/src/`
54
+
55
+ ### Symbol Recovery
56
+
57
+ Go embeds rich type and function information even in stripped binaries:
58
+
59
+ ```bash
60
+ # GoReSym - recovers function names, types, interfaces from Go binaries
61
+ # https://github.com/mandiant/GoReSym
62
+ ./GoReSym -d binary > symbols.json
63
+
64
+ # Parse output
65
+ python3 -c "
66
+ import json
67
+ with open('symbols.json') as f:
68
+ data = json.load(f)
69
+ for fn in data.get('UserFunctions', []):
70
+ print(f\"{fn['Start']:#x} {fn['FullName']}\")
71
+ "
72
+ ```
73
+
74
+ **Ghidra with golang-loader:**
75
+ ```bash
76
+ # Install: Ghidra → Window → Script Manager → search "golang"
77
+ # Or use: https://github.com/getCUJO/ThreatFox/tree/main/ghidra-golang
78
+ # Recovers function names, string references, interface tables
79
+ ```
80
+
81
+ **redress (Go binary analysis):**
82
+ ```bash
83
+ # https://github.com/goretk/redress
84
+ redress -src binary # Reconstruct source tree
85
+ redress -pkg binary # List packages
86
+ redress -type binary # List types and methods
87
+ redress -interface binary # List interfaces
88
+ ```
89
+
90
+ ### Go Memory Layout
91
+
92
+ Understanding Go's data structures in decompilation:
93
+
94
+ ```c
95
+ # String: {pointer, length} (16 bytes on 64-bit)
96
+ # NOT null-terminated! Length field is critical.
97
+ struct GoString {
98
+ char *ptr; // pointer to UTF-8 data
99
+ int64 len; // byte length
100
+ };
101
+
102
+ # Slice: {pointer, length, capacity} (24 bytes on 64-bit)
103
+ struct GoSlice {
104
+ void *ptr; // pointer to backing array
105
+ int64 len; // current length
106
+ int64 cap; // allocated capacity
107
+ };
108
+
109
+ # Interface: {type_descriptor, data_pointer} (16 bytes)
110
+ struct GoInterface {
111
+ void *type; // points to type metadata (itab for non-empty interface)
112
+ void *data; // points to actual value
113
+ };
114
+
115
+ # Map: pointer to runtime.hmap struct
116
+ # Channel: pointer to runtime.hchan struct
117
+ ```
118
+
119
+ **In Ghidra/IDA:** When you see a function taking `(ptr, int64)` — it's likely a Go string. Three-field `(ptr, int64, int64)` is a slice.
120
+
121
+ ### Goroutine and Concurrency Analysis
122
+
123
+ ```bash
124
+ # Identify goroutine spawns in disassembly
125
+ strings binary | grep "runtime.newproc"
126
+ # newproc1 is the internal goroutine creation function
127
+
128
+ # In GDB with Go support:
129
+ gdb ./binary
130
+ (gdb) source /usr/local/go/src/runtime/runtime-gdb.py
131
+ (gdb) info goroutines # List all goroutines
132
+ (gdb) goroutine 1 bt # Backtrace for goroutine 1
133
+ ```
134
+
135
+ **Channel operations in disassembly:**
136
+ - `runtime.chansend1` → `ch <- value`
137
+ - `runtime.chanrecv1` → `value = <-ch`
138
+ - `runtime.selectgo` → `select { case ... }`
139
+ - `runtime.closechan` → `close(ch)`
140
+
141
+ ### Common Go Patterns in Decompilation
142
+
143
+ **Defer mechanism:**
144
+ - `runtime.deferproc` → registers deferred function
145
+ - `runtime.deferreturn` → executes deferred functions at function exit
146
+ - Deferred calls execute in LIFO order — relevant for cleanup/crypto key wiping
147
+
148
+ **Error handling (the `if err != nil` pattern):**
149
+ ```text
150
+ # In disassembly, this appears as:
151
+ # call some_function → returns (result, error) as two values
152
+ # test rax, rax → check if error (second return value) is nil
153
+ # jne error_handler
154
+ ```
155
+
156
+ **String concatenation:**
157
+ - `runtime.concatstrings` → `s1 + s2 + s3`
158
+ - `fmt.Sprintf` → formatted string building
159
+ - Look for format strings in `.rodata`: `"%s%d"`, `"%x"`
160
+
161
+ **Common stdlib patterns in CTF:**
162
+ ```go
163
+ // Crypto operations → look for these in strings/imports:
164
+ // "crypto/aes", "crypto/cipher", "crypto/sha256", "encoding/hex", "encoding/base64"
165
+
166
+ // Network operations:
167
+ // "net/http", "net.Dial", "bufio.NewReader"
168
+
169
+ // File operations:
170
+ // "os.Open", "io.ReadAll", "os.ReadFile"
171
+ ```
172
+
173
+ ### Go Binary Reversing Workflow
174
+
175
+ ```bash
176
+ 1. file binary # Confirm Go, get arch
177
+ 2. GoReSym -d binary > syms.json # Recover symbols
178
+ 3. strings binary | grep -i flag # Quick win check
179
+ 4. Load in Ghidra with golang-loader # Apply recovered symbols
180
+ 5. Find main.main # Entry point
181
+ 6. Identify string comparisons # GoString {ptr, len} pairs
182
+ 7. Trace crypto operations # crypto/* package usage
183
+ 8. Check for embedded resources # embed.FS in Go 1.16+
184
+ ```
185
+
186
+ **Go embed.FS (Go 1.16+):** Binaries can embed files at compile time:
187
+ ```bash
188
+ # Look for embedded file data
189
+ strings binary | grep "embed"
190
+ # Embedded files appear as raw data in the binary
191
+ # Search for known file signatures (PK for zip, PNG header, etc.)
192
+ ```
193
+
194
+ **Key insight:** Go's runtime embeds extensive metadata even in stripped binaries. Use GoReSym before any manual analysis — it often recovers 90%+ of function names, making decompilation dramatically easier. Go strings are `{ptr, len}` tuples, not null-terminated — Ghidra's default string analysis will miss them without the golang-loader plugin.
195
+
196
+ **Detection:** Large static binary (2MB+ for simple programs), `go.buildid`, `runtime.gopanic`, source paths like `/home/user/go/src/`.
197
+
198
+ ### Go Binary UUID Patching for C2 Client Enumeration (BSidesSF 2026)
199
+
200
+ **Pattern (see-two):** A Go-compiled C2 client has a UUID embedded via `-ldflags -X`. The C2 server uses mTLS for authentication. To enumerate other clients and their files, patch the UUID to register as a new client, then use the C2 API to list all clients and download their exfiltrated files.
201
+
202
+ **Approach:**
203
+ 1. Extract embedded UUID from Go build metadata: `go version -m client_binary`
204
+ 2. Binary-patch the UUID (simple byte replacement — Go strings have fixed-length backing arrays)
205
+ 3. Register with the C2 server using the patched binary (mTLS certs are embedded or in distfiles)
206
+ 4. Enumerate clients via API: `GET /api/clients` or iterate known endpoints
207
+ 5. List and download files from each client's GCS bucket or file store
208
+ 6. Grep downloaded files for the flag
209
+
210
+ ```bash
211
+ # Extract Go build info
212
+ go version -m ./client_binary | grep ldflags
213
+ # Output shows: -X main.clientUUID=<uuid>
214
+
215
+ # Patch UUID in binary (replace old UUID bytes with new UUID)
216
+ python3 -c "
217
+ import sys
218
+ data = open('client_binary', 'rb').read()
219
+ old_uuid = b'original-uuid-value-here'
220
+ new_uuid = b'attacker-uuid-value-here'
221
+ patched = data.replace(old_uuid, new_uuid)
222
+ open('client_patched', 'wb').write(patched)
223
+ "
224
+ chmod +x client_patched
225
+ ./client_patched --register
226
+ ```
227
+
228
+ **Key insight:** Go binaries embed string values from `-ldflags -X` directly in the binary data section. Since Go strings are `{ptr, len}` pairs pointing to backing byte arrays, replacing the UUID bytes (same length) produces a valid patched binary. The mTLS certificates authenticate the client to the server but don't bind to a specific UUID.
229
+
230
+ **References:** BSidesSF 2026 "see-two"
231
+
232
+ ---
233
+
234
+ ## Rust Binary Reversing
235
+
236
+ Rust binaries are common in modern CTFs, especially for crypto, systems, and security tooling challenges.
237
+
238
+ ### Rust Recognition
239
+
240
+ ```bash
241
+ # Detect Rust binary
242
+ strings binary | grep -c "rust"
243
+ strings binary | grep "rustc" # Compiler version
244
+ strings binary | grep "/rustc/" # Source paths
245
+ strings binary | grep "core::panicking" # Panic infrastructure
246
+ ```
247
+
248
+ **Key indicators:**
249
+ - `core::panicking::panic` in strings
250
+ - Mangled symbols starting with `_ZN` (Itanium ABI) — e.g., `_ZN4main4main17h...`
251
+ - `.rustc` section in ELF
252
+ - References to `/rustc/<commit_hash>/library/`
253
+ - Large binary size (Rust statically links by default)
254
+
255
+ ### Symbol Demangling
256
+
257
+ ```bash
258
+ # Rust uses Itanium ABI mangling (same as C++)
259
+ # rustfilt demangles Rust-specific symbols
260
+ cargo install rustfilt
261
+ nm binary | rustfilt | grep "main"
262
+
263
+ # Or use c++filt (works for most Rust symbols)
264
+ nm binary | c++filt | grep "main"
265
+
266
+ # In Ghidra: Window → Script Manager → search "Demangler"
267
+ # Enable "DemangleAllScript" for automatic demangling
268
+ ```
269
+
270
+ ### Common Rust Patterns in Decompilation
271
+
272
+ **Option/Result enum:**
273
+ ```text
274
+ # Option<T> in memory: {discriminant (0=None, 1=Some), value}
275
+ # Result<T, E>: {discriminant (0=Ok, 1=Err), union{ok_val, err_val}}
276
+
277
+ # In disassembly:
278
+ # cmp byte [rbp-0x10], 0 → check if None/Err
279
+ # je handle_none_case
280
+ ```
281
+
282
+ **Vec<T> (same as Go slice):**
283
+ ```c
284
+ struct RustVec {
285
+ void *ptr; // heap pointer
286
+ uint64 cap; // capacity
287
+ uint64 len; // length
288
+ };
289
+ ```
290
+
291
+ **String / &str:**
292
+ ```text
293
+ # String (owned): {ptr, capacity, length} — 24 bytes, heap-allocated
294
+ # &str (borrowed): {ptr, length} — 16 bytes, can point anywhere
295
+
296
+ # In decompilation, look for:
297
+ # alloc::string::String::from → String creation
298
+ # core::str::from_utf8 → byte slice to str
299
+ ```
300
+
301
+ **Iterator chains:**
302
+ ```text
303
+ # .iter().map().filter().collect() compiles to loop fusion
304
+ # In disassembly: tight loop with inlined closures
305
+ # Look for: core::iter::adapters::map, filter, etc.
306
+ ```
307
+
308
+ **Panic unwinding:**
309
+ ```bash
310
+ # Panic strings reveal source locations and error messages
311
+ strings binary | grep "panicked at"
312
+ strings binary | grep "called .unwrap().. on"
313
+ # These often contain file paths, line numbers, and variable names
314
+ ```
315
+
316
+ ### Rust-Specific Analysis Tools
317
+
318
+ ```bash
319
+ # cargo-bloat: analyze binary size by function
320
+ cargo install cargo-bloat
321
+ cargo bloat --release -n 50
322
+
323
+ # Ghidra Rust helper scripts
324
+ # https://github.com/AmateursCTF/ghidra-rust (community scripts for Rust RE)
325
+ ```
326
+
327
+ **Key insight:** Rust panic messages are goldmines — they contain source file paths, line numbers, and descriptive error strings even in release builds. Always `strings binary | grep "panicked"` first. Rust's monomorphization means generic functions get duplicated per type — expect many similar-looking functions.
328
+
329
+ **Detection:** `core::panicking`, `.rustc` section, `/rustc/` paths, `_ZN` mangled symbols with Rust-style module paths.
330
+
331
+ ---
332
+
333
+ ## Swift Binary Reversing
334
+
335
+ See [platforms.md](platforms.md#swift-binary-reversing) for full Swift reversing guide including demangling, runtime structures, and Ghidra integration. Key quick reference:
336
+
337
+ ```bash
338
+ # Detect Swift binary
339
+ strings binary | grep "swift"
340
+ otool -l binary | grep "swift"
341
+
342
+ # Demangle Swift symbols
343
+ swift demangle 's14MyApp0A8ClassC10checkInput6resultSbSS_tF'
344
+ # → MyApp.MyAppClass.checkInput(result: String) -> Bool
345
+
346
+ # Key runtime functions: swift_allocObject, swift_release, swift_once
347
+ # String: small (≤15 bytes inline) or large (heap pointer + length)
348
+ # Protocol witness tables = dynamic dispatch (like vtables)
349
+ ```
350
+
351
+ **Detection:** `__swift5_*` sections in Mach-O, `swift_` runtime symbols, `s` prefix in mangled names.
352
+
353
+ ---
354
+
355
+ ## Kotlin / JVM Binary Reversing
356
+
357
+ Kotlin compiles to JVM bytecode or native (via Kotlin/Native). Common in Android and server-side CTF.
358
+
359
+ ### JVM Bytecode (Android/Server)
360
+
361
+ ```bash
362
+ # Detect Kotlin
363
+ strings classes.dex | grep "kotlin"
364
+ # Look for: kotlin.Metadata annotation, kotlin/jvm/internal/*
365
+
366
+ # Decompile
367
+ jadx classes.dex # Best for Kotlin bytecode
368
+ cfr classes.jar --kotlin # CFR with Kotlin mode
369
+ fernflower classes.jar output/ # IntelliJ's decompiler
370
+
371
+ # Kotlin-specific patterns in decompiled output:
372
+ # - Companion objects: ClassName$Companion
373
+ # - Data classes: copy(), component1(), component2(), toString()
374
+ # - Coroutines: ContinuationImpl, invokeSuspend, state machine
375
+ # - Null checks: Intrinsics.checkNotNull() everywhere
376
+ # - When expression: compiled as tableswitch/lookupswitch
377
+ # - Sealed classes: instanceof checks in chain
378
+ ```
379
+
380
+ **Kotlin coroutines in disassembly:**
381
+ ```text
382
+ # Coroutines compile to state machines:
383
+ # invokeSuspend(result) {
384
+ # switch (this.label) {
385
+ # case 0: this.label = 1; return suspendFunction();
386
+ # case 1: processResult(result); return Unit;
387
+ # }
388
+ # }
389
+ # Each suspend point becomes a state in the switch.
390
+ # Follow the state machine to understand async flow.
391
+ ```
392
+
393
+ ### Kotlin/Native
394
+
395
+ ```bash
396
+ # Kotlin/Native produces platform binaries (no JVM)
397
+ # Recognize by: konan, kotlin.native strings
398
+ strings binary | grep "konan"
399
+
400
+ # Much harder to reverse — no reflection metadata
401
+ # Uses LLVM backend, looks similar to C/C++ in disassembly
402
+ # Key functions: InitRuntime, DeinitRuntime, CreateStablePointer
403
+ # Memory management: automatic reference counting (not GC)
404
+ ```
405
+
406
+ **Detection:** `kotlin.Metadata` annotations (JVM), `konan` strings (Native), `kotlin/` package paths.
407
+
408
+ ---
409
+
410
+ ## D Language Binary Reversing (CSAW CTF 2016)
411
+
412
+ D language binaries have unique symbol mangling different from C++. Template instantiation at compile-time produces many function variants.
413
+
414
+ ```bash
415
+ # Recognition: D binaries use different mangling than C++
416
+ # Symbols contain "_D" prefix and numeric length-prefixed names
417
+ # Example: _D4mainQaFNaNbNfZv
418
+
419
+ # Symbol demangling:
420
+ # GDB: set language d
421
+ # Radare2: export names show demangled D symbols
422
+ # Online: dlang.org/phobos/core_demangle.html
423
+
424
+ # Common D binary patterns:
425
+ # - Templates instantiated at compile-time: enc!("111"), enc!("222"), ...
426
+ # - Garbage collector references (GC.malloc, GC.free)
427
+ # - Phobos standard library functions (_D3std...)
428
+ # - String processing: std.string, std.conv.to
429
+
430
+ # Reversing a D cipher (XOR with cycling key):
431
+ def reverse_d_cipher(encrypted, num_functions=500):
432
+ """D binaries may chain multiple transformation functions.
433
+ Each function XORs with key character, then XORs with key length.
434
+ Process in reverse order."""
435
+ result = encrypted[:]
436
+ for i in range(num_functions - 1, -1, -1):
437
+ key = str(i) * 3 # e.g., "499499499" for function enc!("499")
438
+ key_len = len(key)
439
+ for j in range(len(result)):
440
+ result[j] ^= key_len
441
+ result[j] ^= ord(key[j % key_len])
442
+ return bytes(result)
443
+ ```
444
+
445
+ **Key insight:** D binaries are rare in CTFs but identifiable by `_D` symbol prefixes and Phobos library references. The compile-time template system means D functions may be duplicated hundreds of times with different parameters — look for patterns like `enc!("N")` where N varies.
446
+
447
+ ---
448
+
449
+ ### Haskell Binary Reversing via STG Closures and hsdecomp (hxp CTF 2017, Codegate 2018)
450
+
451
+ GHC-compiled Haskell binaries use the STG (Spineless Tagless G-machine) execution model, making them notoriously difficult to reverse due to lazy evaluation, closures, and thunks. The STG machine turns everything into closure calls rather than direct function calls.
452
+
453
+ **Recognition:**
454
+ - Shared libraries: `libHSbase-*`, `libHSrts-*`
455
+ - Entry symbol: `hs_main` (replaces standard `main`)
456
+ - Mangled symbols use Z-encoding: `z` = prefix, `Z` = uppercase, `zd` = `.`, `zi` = `$`
457
+ - GHC calling convention register mapping: `rbx` = R1, `r14` = R2
458
+
459
+ **Closure structure:**
460
+ Closures are structs where the first qword points to the info table/code. The info table precedes the code pointer and contains metadata (closure type, layout info, SRT).
461
+
462
+ ```bash
463
+ # Identify Haskell binary
464
+ ldd ./binary | grep libHS
465
+ readelf -s ./binary | grep hs_main
466
+
467
+ # Decompile with hsdecomp (github.com/gereeter/hsdecomp)
468
+ # Recovers closure structure and pattern matching into pseudo-Haskell
469
+ python2 hsdecomp ./binary
470
+
471
+ # Compile reference for monkey-patching
472
+ ghc -O0 reference.hs -o reference
473
+ objcopy --dump-section .text=main_code reference
474
+ ```
475
+
476
+ **Monkey-patching technique:**
477
+ When decompilation fails or closures are opaque, compile a minimal Haskell program with the same GHC version, extract the compiled `Main_main_info` closure code, and patch it into the challenge binary. This forces evaluation of hidden closures and prints their results by replacing the main entry point with a known evaluator.
478
+
479
+ ```haskell
480
+ -- reference.hs: minimal program that evaluates and prints the target closure
481
+ module Main where
482
+ main :: IO ()
483
+ main = print targetClosure -- replace with the closure you want to evaluate
484
+ ```
485
+
486
+ **Key insight:** Haskell binaries are notoriously hard to reverse due to lazy evaluation, closures, and thunks. The STG machine turns everything into closure calls rather than direct function calls. `hsdecomp` recovers the closure structure and pattern matching. When decompilation fails, monkey-patching a known `Main_main_info` from a reference binary forces evaluation of hidden closures and prints results.
487
+
488
+ **Detection:** `libHSbase-*` shared libraries, `hs_main` entry, Z-encoded symbols (e.g., `MainZCmain`), GHC version strings.
489
+
490
+ **References:** hxp CTF 2017, Codegate 2018
491
+
492
+ ---
493
+
494
+ ### Haskell Binary RE via GHC CMM Intermediate Language (N1CTF 2018)
495
+
496
+ GHC-compiled Haskell binaries are nearly impossible to decompile with IDA due to the STG execution model. When a `.cmm` (C-- intermediate) file is available or recoverable, read it to understand thunks, closures, and lazy evaluation semantics. For exponentially-growing recursive structures, compute segment sizes with memoization and use binary search instead of materializing the full string.
497
+
498
+ **Pattern:** The binary builds a recursive string structure where `f(n) = s1 + f(n-1) + s2 + f(n-1) + s3`. Direct evaluation is `O(2^n)` in both time and space. Instead, compute the size of each recursion level with memoization, then binary-search for the target character index by walking the segment boundaries.
499
+
500
+ ```python
501
+ # Haskell recursive string: f(n) = s1 + f(n-1) + s2 + f(n-1) + s3
502
+ # Direct evaluation is O(2^n) -- use size memoization:
503
+ from functools import lru_cache
504
+
505
+ @lru_cache(maxsize=None)
506
+ def fsize(n):
507
+ if n == 0: return len(s0)
508
+ return len(s1) + fsize(n-1) + len(s2) + fsize(n-1) + len(s3)
509
+
510
+ def char_at(n, offset):
511
+ if n == 0: return s0[offset]
512
+ if offset < len(s1): return s1[offset]
513
+ offset -= len(s1)
514
+ if offset < fsize(n-1): return char_at(n-1, offset)
515
+ offset -= fsize(n-1)
516
+ if offset < len(s2): return s2[offset]
517
+ offset -= len(s2)
518
+ return char_at(n-1, offset)
519
+ ```
520
+
521
+ **Key insight:** GHC's CMM (C minus minus) intermediate representation preserves enough structure to identify algorithms. For recursive string constructions that double in size each level, compute segment sizes with memoization and binary-search for target indices instead of materializing the exponentially-growing string.
522
+
523
+ **Detection:** Haskell binary (see recognition above) with a `.cmm` file included in the challenge distribution. Look for recursive closure applications that produce string-like data with exponential growth.
524
+
525
+ **References:** N1CTF 2018
526
+
527
+ ---
528
+
529
+ ## .NET / C# Binary Reversing
530
+
531
+ .NET 托管程序(C# 编译的 exe/dll)有完整独立工作流,详见 [`../dotnet-reverse/SKILL.md`](../dotnet-reverse/SKILL.md)。
532
+
533
+ **速查要点:**
534
+ - 识别:PE 头 CLR runtime header 非零、`mscoree.dll` 导入、`mscorlib`/`System.Private.CoreLib` 字符串
535
+ - 工具:**dnSpyEx**(反编译+调试+IL 编辑,Windows GUI)/ **ILSpy**(CLI)/ **de4dot**(脱混淆)/ **dnlib**(脚本化)
536
+ - 脱混淆:ConfuserEx / SmartAssembly / Babel / .NET Reactor → `de4dot`,详见 [`../dotnet-reverse/references/obfuscators.md`](../dotnet-reverse/references/obfuscators.md)
537
+ - **IL 优先**:关键判断与 patch 用 IL 编辑器而非 C# 反编译器(避免编译器生成代码重编译失真)
538
+ - 红队 Sharp* 工具(Rubeus/SharpHound)分析 → [`../dotnet-reverse/references/sharp-tools.md`](../dotnet-reverse/references/sharp-tools.md)
539
+
540
+ **边界:** IL2CPP / NativeAOT 编译产物是 native(无 CLR),不走 dnSpy → 走 `ida-reverse/` / `radare2/`(见 [seed-014](../field-journal/seed-014_unity-il2cpp-reverse.md))。Codegate 2013 两阶段 XOR+AES-CBC 模式见 [tools.md](tools.md#net-analysis) `.NET Analysis` 段。
541
+
542
+ ---
543
+
544
+ ## C++ Binary Reversing (Quick Reference)
545
+
546
+ While C++ RE is well-covered by general tools, these patterns are CTF-specific:
547
+
548
+ ### vtable Reconstruction
549
+
550
+ ```text
551
+ # Virtual function tables (vtables):
552
+ # First 8 bytes of object → pointer to vtable
553
+ # vtable entries: [typeinfo_ptr, destructor, method1, method2, ...]
554
+ # In Ghidra: Data → Create Pointer at vtable address
555
+
556
+ # Identify polymorphic dispatch:
557
+ # mov rax, [rdi] # Load vtable from this pointer
558
+ # call [rax + 0x18] # Call 4th virtual method (0x18/8 = 3rd after typeinfo+dtor)
559
+ ```
560
+
561
+ ### RTTI (Run-Time Type Information)
562
+
563
+ ```bash
564
+ # If not stripped, RTTI reveals class hierarchy
565
+ strings binary | grep -E "^[0-9]+[A-Z]" # Mangled type names
566
+ c++filt _ZTI7MyClass # → typeinfo for MyClass
567
+
568
+ # In Ghidra: search for vtable references, follow typeinfo pointer
569
+ # typeinfo struct: {vtable_for_typeinfo, name_string, base_class_ptr}
570
+ ```
571
+
572
+ ### Standard Library Patterns
573
+
574
+ ```text
575
+ std::string (libstdc++):
576
+ SSO (Small String Optimization): inline buffer for ≤15 chars
577
+ Layout: {char* ptr, size_t size, union{size_t cap, char buf[16]}}
578
+
579
+ std::vector<T>:
580
+ {T* begin, T* end, T* capacity_end}
581
+
582
+ std::map<K,V>:
583
+ Red-black tree: each node has {left, right, parent, color, key, value}
584
+
585
+ std::unordered_map<K,V>:
586
+ Hash table: {bucket_array, size, load_factor_max, ...}
587
+ ```