opencode-skills-collection 4.0.43 → 4.0.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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,801 @@
1
+ # CTF Reverse - Patterns & Techniques
2
+
3
+ ## Table of Contents
4
+ - [Custom VM Reversing](#custom-vm-reversing)
5
+ - [Analysis Steps](#analysis-steps)
6
+ - [Common VM Patterns](#common-vm-patterns)
7
+ - [RVA-Based Opcode Dispatching](#rva-based-opcode-dispatching)
8
+ - [State Machine VMs (90K+ states)](#state-machine-vms-90k-states)
9
+ - [Custom VM Reverse Engineering via Fuzzing and Instruction Set Discovery (hxp CTF 2017)](#custom-vm-reverse-engineering-via-fuzzing-and-instruction-set-discovery-hxp-ctf-2017)
10
+ - [Anti-Debugging Techniques](#anti-debugging-techniques)
11
+ - [Common Checks](#common-checks)
12
+ - [Bypass Technique](#bypass-technique)
13
+ - [LD_PRELOAD Hook](#ld_preload-hook)
14
+ - [pwntools Binary Patching (Crypto-Cat)](#pwntools-binary-patching-crypto-cat)
15
+ - [Nanomites](#nanomites)
16
+ - [Linux (Signal-Based)](#linux-signal-based)
17
+ - [Windows (Debug Events)](#windows-debug-events)
18
+ - [Analysis](#analysis)
19
+ - [Self-Modifying Code](#self-modifying-code)
20
+ - [Pattern: XOR Decryption](#pattern-xor-decryption)
21
+ - [Known-Plaintext XOR (Flag Prefix)](#known-plaintext-xor-flag-prefix)
22
+ - [Variant: XOR with Position Index](#variant-xor-with-position-index)
23
+ - [Mixed-Mode (x86-64 / x86) Stagers](#mixed-mode-x86-64--x86-stagers)
24
+ - [LLVM (Low Level Virtual Machine) Obfuscation (Control Flow Flattening)](#llvm-low-level-virtual-machine-obfuscation-control-flow-flattening)
25
+ - [Pattern](#pattern)
26
+ - [De-obfuscation](#de-obfuscation)
27
+ - [S-Box / Keystream Generation](#s-box--keystream-generation)
28
+ - [Fisher-Yates Shuffle (Xorshift32)](#fisher-yates-shuffle-xorshift32)
29
+ - [Xorshift64* Keystream](#xorshift64-keystream)
30
+ - [Identifying Patterns](#identifying-patterns)
31
+ - [SECCOMP/BPF Filter Analysis](#seccompbpf-filter-analysis)
32
+ - [BPF Analysis](#bpf-analysis)
33
+ - [Exception Handler Obfuscation](#exception-handler-obfuscation)
34
+ - [RtlInstallFunctionTableCallback](#rtlinstallfunctiontablecallback)
35
+ - [Vectored Exception Handlers (VEH)](#vectored-exception-handlers-veh)
36
+ - [Memory Dump Analysis](#memory-dump-analysis)
37
+ - [When Binary Dumps Memory](#when-binary-dumps-memory)
38
+ - [Known Plaintext Attack](#known-plaintext-attack)
39
+ - [Byte-Wise Uniform Transforms](#byte-wise-uniform-transforms)
40
+ - [x86-64 Gotchas](#x86-64-gotchas)
41
+ - [Sign Extension](#sign-extension)
42
+ - [Loop Boundary State Updates](#loop-boundary-state-updates)
43
+ - [Custom Mangle Function Reversing](#custom-mangle-function-reversing)
44
+ - [Position-Based Transformation Reversing](#position-based-transformation-reversing)
45
+ - [Hex-Encoded String Comparison](#hex-encoded-string-comparison)
46
+ - [Signal-Based Binary Exploration](#signal-based-binary-exploration)
47
+ - [Malware Anti-Analysis Bypass via Patching](#malware-anti-analysis-bypass-via-patching)
48
+ - [Multi-Stage Shellcode Loaders](#multi-stage-shellcode-loaders)
49
+ - [Timing Side-Channel Attack](#timing-side-channel-attack)
50
+ - [Multi-Thread Anti-Debug with Decoy + Signal Handler Mixed Boolean-Arithmetic (ApoorvCTF 2026)](#multi-thread-anti-debug-with-decoy--signal-handler-mixed-boolean-arithmetic-apoorvctf-2026)
51
+ - [INT3 Patch + Coredump Brute-Force Oracle (Pwn2Win 2016)](#int3-patch--coredump-brute-force-oracle-pwn2win-2016)
52
+ - [Signal Handler Chain + LD_PRELOAD Oracle (Nuit du Hack 2016)](#signal-handler-chain--ld_preload-oracle-nuit-du-hack-2016)
53
+ - [printf Format String VM Decompilation to Z3 (SECCON 2017)](#printf-format-string-vm-decompilation-to-z3-seccon-2017)
54
+
55
+ ---
56
+
57
+ ## Custom VM Reversing
58
+
59
+ ### Analysis Steps
60
+ 1. Identify VM structure: registers, memory, instruction pointer
61
+ 2. Reverse `executeIns`/`runvm` function for opcode meanings
62
+ 3. Write a disassembler to parse bytecode
63
+ 4. Decompile disassembly to understand algorithm
64
+
65
+ ### Common VM Patterns
66
+ ```c
67
+ switch (opcode) {
68
+ case 1: *R[op1] *= op2; break; // MUL
69
+ case 2: *R[op1] -= op2; break; // SUB
70
+ case 3: *R[op1] = ~*R[op1]; break; // NOT
71
+ case 4: *R[op1] ^= mem[op2]; break; // XOR
72
+ case 5: *R[op1] = *R[op2]; break; // MOV
73
+ case 7: if (R0) IP += op1; break; // JNZ
74
+ case 8: putc(R0); break; // PRINT
75
+ case 10: R0 = getc(); break; // INPUT
76
+ }
77
+ ```
78
+
79
+ ### RVA-Based Opcode Dispatching
80
+ - Opcodes are RVAs pointing to handler functions
81
+ - Handler performs operation, reads next RVA, jumps
82
+ - Map all handlers by following RVA chain
83
+
84
+ ### State Machine VMs (90K+ states)
85
+ ```java
86
+ // BFS for valid path
87
+ var agenda = new ArrayDeque<State>();
88
+ agenda.add(new State(0, ""));
89
+ while (!agenda.isEmpty()) {
90
+ var current = agenda.remove();
91
+ if (current.path.length() == TARGET_LENGTH) {
92
+ println(current.path);
93
+ continue;
94
+ }
95
+ for (var transition : machine.get(current.state).entrySet()) {
96
+ agenda.add(new State(transition.getValue(),
97
+ current.path + (char)transition.getKey()));
98
+ }
99
+ }
100
+ ```
101
+
102
+ **Key insight:** Custom VMs appear when the challenge bundles a bytecode blob alongside a dispatcher loop. Reverse the opcode switch table first, then write a disassembler to lift the bytecode before attempting to understand the algorithm.
103
+
104
+ ### Custom VM Reverse Engineering via Fuzzing and Instruction Set Discovery (hxp CTF 2017)
105
+
106
+ Methodical black-box approach to reversing unknown VM bytecode when static analysis of the dispatch loop is too complex:
107
+
108
+ **Step 1: Determine instruction alignment.**
109
+ Dump the bytecode as bit strings at various widths (6-11 bits) to identify instruction alignment. Look for repeating patterns that suggest opcode boundaries.
110
+
111
+ **Step 2: Fuzz with random bytes.**
112
+ Send single instructions and observe effects on registers/memory to map opcodes. Reduce to minimal programs: find the shortest input that produces each observable effect.
113
+
114
+ **Step 3: Build the instruction set.**
115
+ Example discovered ISA (variable-length 6-11 bit):
116
+ ```text
117
+ 000 xxxxxxxx jmpz 001 xxxxxxxx jmp 010 xxxxxxxx call
118
+ 011 xxxxxxxx label 1000 xxxxxxx loadram 1001 xxxxxxx saveram
119
+ 110 xxxxxxxx loadi 11100 xxxxxx shl 11101 xxxxxx shr
120
+ 111100 not 111101 and 111110 or 111111 setif
121
+ ```
122
+
123
+ **Step 4: Build assembler/disassembler.**
124
+ Write tools to assemble and disassemble the discovered ISA, then disassemble the challenge bytecode to understand its algorithm.
125
+
126
+ **Step 5: Implement missing primitives.**
127
+ If the ISA lacks expected operations, synthesize them from available instructions. Example: implementing XTEA decryption using only AND/OR/NOT (no native XOR or ADD):
128
+ ```python
129
+ # XOR from AND/OR/NOT: XOR(a, b) = (a OR b) AND NOT(a AND b)
130
+ # ADD via full-adder chains using AND/OR/NOT for carry propagation
131
+ def xor_from_primitives(a, b):
132
+ return (a | b) & ~(a & b)
133
+
134
+ def add_from_primitives(a, b, bits=32):
135
+ carry = 0
136
+ result = 0
137
+ for i in range(bits):
138
+ ai = (a >> i) & 1
139
+ bi = (b >> i) & 1
140
+ sum_bit = xor_from_primitives(xor_from_primitives(ai, bi), carry)
141
+ carry = (ai & bi) | (carry & xor_from_primitives(ai, bi))
142
+ result |= (sum_bit << i)
143
+ return result
144
+ ```
145
+
146
+ **Key insight:** When static analysis of a VM's dispatch loop is too complex, black-box fuzzing can map the ISA faster. Send single instructions and observe state changes. Variable-length instruction sets require testing multiple bit widths. Once the ISA is known, complex algorithms (XTEA) can be implemented even with minimal primitives (AND/OR/NOT).
147
+
148
+ **References:** hxp CTF 2017
149
+
150
+ ---
151
+
152
+ ## Anti-Debugging Techniques
153
+
154
+ ### Common Checks
155
+ - `IsDebuggerPresent()` (Windows)
156
+ - `ptrace(PTRACE_TRACEME)` (Linux)
157
+ - `/proc/self/status` TracerPid
158
+ - Timing checks (`rdtsc`, `time()`)
159
+ - Registry checks (Windows)
160
+
161
+ ### Bypass Technique
162
+ 1. Identify `test` instructions after debug checks
163
+ 2. Set breakpoint at the `test`
164
+ 3. Modify register to bypass conditional
165
+
166
+ ```bash
167
+ # In radare2
168
+ db 0x401234 # Break at test
169
+ dc # Run
170
+ dr eax=0 # Clear flag
171
+ dc # Continue
172
+ ```
173
+
174
+ ### LD_PRELOAD Hook
175
+ ```c
176
+ #define _GNU_SOURCE
177
+ #include <dlfcn.h>
178
+ #include <sys/ptrace.h>
179
+
180
+ long int ptrace(enum __ptrace_request req, ...) {
181
+ long int (*orig)(enum __ptrace_request, pid_t, void*, void*);
182
+ orig = dlsym(RTLD_NEXT, "ptrace");
183
+ // Log or modify behavior
184
+ return orig(req, pid, addr, data);
185
+ }
186
+ ```
187
+
188
+ Compile: `gcc -shared -fPIC -ldl hook.c -o hook.so`
189
+ Run: `LD_PRELOAD=./hook.so ./binary`
190
+
191
+ **Key insight:** Anti-debugging checks are the first obstacle in most reversing challenges. Look for `ptrace`, `IsDebuggerPresent`, or timing checks early in `main()` and patch or hook them before attempting deeper analysis.
192
+
193
+ ### pwntools Binary Patching (Crypto-Cat)
194
+ Patch out anti-debug calls directly using pwntools — replaces function with `ret` instruction:
195
+ ```python
196
+ from pwn import *
197
+
198
+ elf = ELF('./challenge', checksec=False)
199
+ elf.asm(elf.symbols.ptrace, 'ret') # Replace ptrace() with immediate return
200
+ elf.save('patched') # Save patched binary
201
+ ```
202
+
203
+ Other common patches:
204
+ ```python
205
+ elf.asm(addr, 'nop') # NOP out an instruction
206
+ elf.asm(addr, 'xor eax, eax; ret') # Return 0 (bypass checks)
207
+ elf.asm(addr, 'mov eax, 1; ret') # Return 1 (force success)
208
+ ```
209
+
210
+ ---
211
+
212
+ ## Nanomites
213
+
214
+ ### Linux (Signal-Based)
215
+ - `SIGTRAP` (`int 3`) → Custom operation
216
+ - `SIGILL` (`ud2`) → Custom operation
217
+ - `SIGFPE` (`idiv 0`) → Custom operation
218
+ - `SIGSEGV` (null deref) → Custom operation
219
+
220
+ ### Windows (Debug Events)
221
+ - `EXCEPTION_DEBUG_EVENT` → Main handler
222
+ - Parent modifies child via `PTRACE_POKETEXT`
223
+ - Magic markers: `0x1337BABE`, `0xDEADC0DE`
224
+
225
+ ### Analysis
226
+ 1. Check for `fork()` + `ptrace(PTRACE_TRACEME)`
227
+ 2. Find `WaitForDebugEvent` loop
228
+ 3. Map EAX values to operations
229
+ 4. Log operations to reconstruct algorithm
230
+
231
+ **Key insight:** Nanomites hide the real computation inside signal/exception handlers that only fire under a debugger parent. If the binary forks and the child calls `ptrace(TRACEME)`, the parent is the real CPU -- log its POKE operations to reconstruct the algorithm.
232
+
233
+ ---
234
+
235
+ ## Self-Modifying Code
236
+
237
+ ### Pattern: XOR Decryption
238
+ ```asm
239
+ lea rax, next_block
240
+ mov dl, [rcx] ; Input char
241
+ xor_loop:
242
+ xor [rax+rbx], dl
243
+ inc rbx
244
+ cmp rbx, BLOCK_SIZE
245
+ jnz xor_loop
246
+ jmp rax ; Execute decrypted
247
+ ```
248
+
249
+ **Solution:** Known opcode at block start reveals XOR key (flag char).
250
+
251
+ **Key insight:** Self-modifying code decrypts the next block using each input character as a key. A known-good opcode at the start of each decrypted block (e.g., function prologue) reveals the correct key byte, recovering the flag one character at a time.
252
+
253
+ ---
254
+
255
+ ## Known-Plaintext XOR (Flag Prefix)
256
+
257
+ **Pattern:** Encrypted bytes given; flag format known (e.g., `0xL4ugh{`).
258
+
259
+ **Approach:**
260
+ 1. Assume repeating XOR key.
261
+ 2. Use known prefix (and any hint phrase) to recover key bytes.
262
+ 3. Try small key lengths and validate printable output.
263
+
264
+ ```python
265
+ enc = bytes.fromhex("...") # ciphertext
266
+ known = b"0xL4ugh{say_yes_to_me"
267
+ for klen in range(2, 33):
268
+ key = bytearray(klen)
269
+ ok = True
270
+ for i, b in enumerate(known):
271
+ if i >= len(enc):
272
+ break
273
+ ki = i % klen
274
+ v = enc[i] ^ b
275
+ if key[ki] != 0 and key[ki] != v:
276
+ ok = False
277
+ break
278
+ key[ki] = v
279
+ if not ok:
280
+ continue
281
+ pt = bytes(enc[i] ^ key[i % klen] for i in range(len(enc)))
282
+ if all(32 <= c < 127 for c in pt):
283
+ print(klen, key, pt)
284
+ ```
285
+
286
+ **Note:** Challenge hints often appear verbatim in the flag body (e.g., "say_yes_to_me").
287
+
288
+ ### Variant: XOR with Position Index
289
+ **Pattern:** `cipher[i] = plain[i] ^ key[i % k] ^ i` (or `^ (i & 0xff)`).
290
+
291
+ **Symptoms:**
292
+ - Repeating-key XOR almost fits known prefix but breaks at later positions
293
+ - XOR with known prefix yields a "key" that changes by +1 per index
294
+
295
+ **Fix:** Remove index first, then recover key with known prefix.
296
+ ```python
297
+ enc = bytes.fromhex("...")
298
+ known = b"0xL4ugh{say_yes_to_me"
299
+ for klen in range(2, 33):
300
+ key = bytearray(klen)
301
+ ok = True
302
+ for i, b in enumerate(known):
303
+ if i >= len(enc):
304
+ break
305
+ ki = i % klen
306
+ v = (enc[i] ^ i) ^ b # strip index XOR
307
+ if key[ki] != 0 and key[ki] != v:
308
+ ok = False
309
+ break
310
+ key[ki] = v
311
+ if not ok:
312
+ continue
313
+ pt = bytes((enc[i] ^ i) ^ key[i % klen] for i in range(len(enc)))
314
+ if all(32 <= c < 127 for c in pt):
315
+ print(klen, key, pt)
316
+ ```
317
+
318
+ ---
319
+
320
+ ## Mixed-Mode (x86-64 / x86) Stagers
321
+
322
+ **Pattern:** 64-bit ELF jumps into a 32-bit blob via far return (`retf`/`retfq`), often after anti-debug.
323
+
324
+ **Identification:**
325
+ - Bytes `0xCB` (retf) or `0xCA` (retf imm16), sometimes preceded by `0x48` (retfq)
326
+ - 32-bit disasm shows SSE ops (`psubb`, `pxor`, `paddb`) in a tight loop
327
+ - Computed jumps into the 32-bit region
328
+
329
+ **Gotchas:**
330
+ - `retf` pops **6 bytes**: 4-byte EIP + 2-byte CS (not 8)
331
+ - 32-bit blob may rely on inherited **XMM state** and **EFLAGS**
332
+ - Missing XMM/flags transfer when switching emulators yields wrong output
333
+
334
+ **Bypass/Emulation Tips:**
335
+ 1. Create a UC_MODE_32 emulator, copy memory + GPRs, **EFLAGS**, and **XMM regs**
336
+ 2. Run 32-bit block, then copy memory + regs back to 64-bit
337
+ 3. If anti-debug uses `fork/ptrace` + patching, emulate parent to log POKEs and apply them in child
338
+
339
+ ---
340
+
341
+ ## LLVM (Low Level Virtual Machine) Obfuscation (Control Flow Flattening)
342
+
343
+ ### Pattern
344
+ ```c
345
+ while (1) {
346
+ if (i == 0xA57D3848) { /* block */ }
347
+ if (i != 0xA5AA2438) break;
348
+ i = 0x39ABA8E6; // Next state
349
+ }
350
+ ```
351
+
352
+ ### De-obfuscation
353
+ 1. GDB script to break at `je` instructions
354
+ 2. Log state variable values
355
+ 3. Map state transitions
356
+ 4. Reconstruct true control flow
357
+
358
+ **Key insight:** Control flow flattening replaces structured if/else/loops with a single dispatcher switch. The state variable is the key -- trace its values at runtime to reconstruct the original control flow graph without fighting the obfuscation statically.
359
+
360
+ ---
361
+
362
+ ## S-Box / Keystream Generation
363
+
364
+ ### Fisher-Yates Shuffle (Xorshift32)
365
+ ```python
366
+ def gen_sbox():
367
+ sbox = list(range(256))
368
+ state = SEED
369
+ for i in range(255, -1, -1):
370
+ state = ((state << 13) ^ state) & 0xffffffff
371
+ state = ((state >> 17) ^ state) & 0xffffffff
372
+ state = ((state << 5) ^ state) & 0xffffffff
373
+ j = state % (i + 1) if i > 0 else 0
374
+ sbox[i], sbox[j] = sbox[j], sbox[i]
375
+ return sbox
376
+ ```
377
+
378
+ ### Xorshift64* Keystream
379
+ ```python
380
+ def gen_keystream():
381
+ ks = []
382
+ state = SEED_64
383
+ mul = 0x2545f4914f6cdd1d
384
+ for _ in range(256):
385
+ state ^= (state >> 12)
386
+ state ^= (state << 25)
387
+ state ^= (state >> 27)
388
+ state = (state * mul) & 0xffffffffffffffff
389
+ ks.append((state >> 56) & 0xff)
390
+ return ks
391
+ ```
392
+
393
+ ### Identifying Patterns
394
+ - Xorshift32: shifts 13, 17, 5 (no multiplication constant)
395
+ - Xorshift64*: shifts 12, 25, 27, then multiply by `0x2545f4914f6cdd1d`
396
+ - Other common constant: `0x9e3779b97f4a7c15` (golden ratio)
397
+
398
+ **Key insight:** Recognize S-box generation by the Fisher-Yates shuffle pattern (loop counting down from 255, swap with PRNG-chosen index) and keystream generators by the xorshift constants. Once the PRNG family is identified, the algorithm is fully determined by its seed.
399
+
400
+ ---
401
+
402
+ ## SECCOMP/BPF Filter Analysis
403
+
404
+ ```bash
405
+ seccomp-tools dump ./binary
406
+ ```
407
+
408
+ ### BPF Analysis
409
+ - `A = sys_number` followed by comparisons
410
+ - `mem[N] = A`, `A = mem[N]` for memory ops
411
+ - Map to constraint equations, solve with z3
412
+
413
+ ```python
414
+ from z3 import *
415
+ flag = [BitVec(f'c{i}', 32) for i in range(14)]
416
+ s = Solver()
417
+ s.add(flag[0] >= 0x20, flag[0] < 0x7f)
418
+ # Add constraints from filter
419
+ if s.check() == sat:
420
+ m = s.model()
421
+ print(''.join(chr(m[c].as_long()) for c in flag))
422
+ ```
423
+
424
+ **Key insight:** SECCOMP (Secure Computing Mode) filters encode flag validation as BPF bytecode operating on syscall arguments. Dump the filter with `seccomp-tools`, translate the comparisons and memory operations into z3 constraints, and solve for the flag without ever running the binary.
425
+
426
+ ---
427
+
428
+ ## Exception Handler Obfuscation
429
+
430
+ ### RtlInstallFunctionTableCallback
431
+ - Dynamic exception handler registration
432
+ - Handler installs new handler, modifies code
433
+ - Use x64dbg with exception handler breaks
434
+
435
+ ### Vectored Exception Handlers (VEH)
436
+ - `AddVectoredExceptionHandler` installs handler
437
+ - Handler decrypts code at exception address
438
+ - Step through, dump decrypted code
439
+
440
+ **Key insight:** Exception-handler-based obfuscation hides the real control flow inside SEH/VEH handlers that trigger on deliberate faults. Set breakpoints inside the exception handlers rather than on the faulting instructions to follow the actual execution path.
441
+
442
+ ---
443
+
444
+ ## Memory Dump Analysis
445
+
446
+ ### When Binary Dumps Memory
447
+ - Check for `/proc/self/maps` reads
448
+ - Check for `/proc/self/mem` reads
449
+ - Heap data often appended to dump
450
+
451
+ ### Known Plaintext Attack
452
+ ```python
453
+ prologue = bytes([0xf3, 0x0f, 0x1e, 0xfa, 0x55, 0x48, 0x89, 0xe5])
454
+ encrypted = data[func_offset:func_offset+8]
455
+ partial_key = bytes(a ^ b for a, b in zip(encrypted, prologue))
456
+ ```
457
+
458
+ **Key insight:** When a binary reads `/proc/self/mem` or `/proc/self/maps`, it is dumping its own memory -- possibly after encrypting it. Use known function prologues (`endbr64; push rbp; mov rbp, rsp`) as known plaintext to recover the XOR key from the encrypted dump.
459
+
460
+ ---
461
+
462
+ ## Byte-Wise Uniform Transforms
463
+
464
+ **Pattern:** Output buffer depends on each input byte independently (no cross-byte coupling).
465
+
466
+ **Detection:**
467
+ - Change one input position → only one output position changes
468
+ - Fill input with a single byte → output buffer becomes constant
469
+
470
+ **Solve:**
471
+ 1. For each byte value 0..255, run the program with that byte repeated
472
+ 2. Record output byte → build mapping and inverse mapping
473
+ 3. Apply inverse mapping to static target bytes to recover the flag
474
+
475
+ ---
476
+
477
+ ## x86-64 Gotchas
478
+
479
+ ### Sign Extension
480
+ ```python
481
+ esi = 0xffffffc7 # NOT -57
482
+
483
+ # For XOR: low byte only
484
+ esi_xor = esi & 0xff # 0xc7
485
+
486
+ # For addition: full 32-bit with overflow
487
+ r12 = (r13 + esi) & 0xffffffff
488
+ ```
489
+
490
+ ### Loop Boundary State Updates
491
+ Assembly often splits state updates across loop boundaries:
492
+ ```asm
493
+ jmp loop_middle ; First iteration in middle!
494
+
495
+ loop_top: ; State for iterations 2+
496
+ mov r13, sbox[a & 0xf]
497
+ ; Uses OLD 'a', not new!
498
+
499
+ loop_middle:
500
+ ; Main computation
501
+ inc a
502
+ jne loop_top
503
+ ```
504
+
505
+ **Key insight:** Decompilers often get x86-64 sign extension and loop boundary state updates wrong. Always verify decompiled output against the raw assembly for operations involving `movsx`/`cdqe`, and check whether loop variables update before or after their use in each iteration.
506
+
507
+ ---
508
+
509
+ ## Custom Mangle Function Reversing
510
+
511
+ **Pattern (Flag Appraisal):** Binary mangles input 2 bytes at a time with intermediate state, compares to static target.
512
+
513
+ **Approach:**
514
+ 1. Extract static target bytes from `.rodata` section
515
+ 2. Understand mangle: processes pairs with running state value
516
+ 3. Write inverse function (process in reverse, undo each operation)
517
+ 4. Feed target bytes through inverse → recovers flag
518
+
519
+ **Key insight:** When a binary mangles input in pairs with running state and compares to a static target, extract the target from `.rodata` and write the inverse function. Process the target bytes in reverse order, undoing each operation, to recover the original input.
520
+
521
+ ---
522
+
523
+ ## Position-Based Transformation Reversing
524
+
525
+ **Pattern (PascalCTF 2026):** Binary transforms input by adding/subtracting position index.
526
+
527
+ **Reversing:**
528
+ ```python
529
+ expected = [...] # Extract from .rodata
530
+ flag = ''
531
+ for i, b in enumerate(expected):
532
+ if i % 2 == 0:
533
+ flag += chr(b - i) # Even: input = output - i
534
+ else:
535
+ flag += chr(b + i) # Odd: input = output + i
536
+ ```
537
+
538
+ ---
539
+
540
+ ## Hex-Encoded String Comparison
541
+
542
+ **Pattern (Spider's Curse):** Input converted to hex, compared against hex constant.
543
+
544
+ **Quick solve:** Extract hex constant from strings/Ghidra, decode:
545
+ ```bash
546
+ echo "4d65746143..." | xxd -r -p
547
+ ```
548
+
549
+ ---
550
+
551
+ ## Signal-Based Binary Exploration
552
+
553
+ **Pattern (Signal Signal Little Star):** Binary uses UNIX signals as a binary tree navigation mechanism.
554
+
555
+ **Identification:**
556
+ - Multiple `sigaction()` calls with `SA_SIGINFO`
557
+ - `sigaltstack()` setup (alternate signal stack)
558
+ - Handler decodes embedded payload, installs next pair of signals
559
+ - Two types: Node (installs children) vs Leaf (prints message + exits)
560
+
561
+ **Solving approach:**
562
+ 1. Hook `sigaction` via `LD_PRELOAD` to log signal installations
563
+ 2. DFS through the binary tree by sending signals
564
+ 3. At each stage, observe which 2 signals are installed
565
+ 4. Send one, check if program exits (leaf) or installs 2 more (node)
566
+ 5. If wrong leaf, backtrack and try sibling
567
+
568
+ ```c
569
+ // LD_PRELOAD interposer to log sigaction calls
570
+ int sigaction(int signum, const struct sigaction *act, ...) {
571
+ if (act && (act->sa_flags & SA_SIGINFO))
572
+ log("SET %d SA_SIGINFO=1\n", signum);
573
+ return real_sigaction(signum, act, oldact);
574
+ }
575
+ ```
576
+
577
+ ---
578
+
579
+ ## Malware Anti-Analysis Bypass via Patching
580
+
581
+ **Pattern (Carrot):** Malware with multiple environment checks before executing payload.
582
+
583
+ **Common checks to patch:**
584
+ | Check | Technique | Patch |
585
+ |-------|-----------|-------|
586
+ | `ptrace(PTRACE_TRACEME)` | Anti-debug | Change `cmp -1` to `cmp 0` |
587
+ | `sleep(150)` | Anti-sandbox timing | Change sleep value to 1 |
588
+ | `/proc/cpuinfo` "hypervisor" | Anti-VM | Flip `JNZ` to `JZ` |
589
+ | "VMware"/"VirtualBox" strings | Anti-VM | Flip `JNZ` to `JZ` |
590
+ | `getpwuid` username check | Environment | Flip comparison |
591
+ | `LD_PRELOAD` check | Anti-hook | Skip check |
592
+ | Fan count / hardware check | Anti-VM | Flip `JLE` to `JGE` |
593
+ | Hostname check | Environment | Flip `JNZ` to `JZ` |
594
+
595
+ **Ghidra patching workflow:**
596
+ 1. Find check function, identify the conditional jump
597
+ 2. Click on instruction → `Ctrl+Shift+G` → modify opcode
598
+ 3. For `JNZ` (0x75) → `JZ` (0x74), or vice versa
599
+ 4. For immediate values: change operand bytes directly
600
+ 5. Export: press `O` → choose "Original File" format
601
+ 6. `chmod +x` the patched binary
602
+
603
+ **Server-side validation bypass:**
604
+ - If patched binary sends system info to remote server, patch the data too
605
+ - Modify string addresses in data-gathering functions
606
+ - Change format strings to embed correct values directly
607
+
608
+ ---
609
+
610
+ ## Multi-Stage Shellcode Loaders
611
+
612
+ **Pattern (I Heard You Liked Loaders):** Nested shellcode with XOR decode loops and anti-debug.
613
+
614
+ **Debugging workflow:**
615
+ 1. Break at `call rax` in launcher, step into shellcode
616
+ 2. Bypass ptrace anti-debug: step to syscall, `set $rax=0`
617
+ 3. Step through XOR decode loop (or break on `int3` if hidden)
618
+ 4. Repeat for each stage until final payload
619
+
620
+ **Flag extraction from `mov` instructions:**
621
+ ```python
622
+ # Final stage loads flag 4 bytes at a time via mov ebx, value
623
+ # Extract little-endian 4-byte chunks
624
+ values = [0x6174654d, 0x7b465443, ...] # From disassembly
625
+ flag = b''.join(v.to_bytes(4, 'little') for v in values)
626
+ ```
627
+
628
+ ---
629
+
630
+ ## Timing Side-Channel Attack
631
+
632
+ **Pattern (Clock Out):** Validation time varies per correct character (longer sleep on match).
633
+
634
+ **Exploitation:**
635
+ ```python
636
+ import time
637
+ from pwn import *
638
+
639
+ flag = ""
640
+ for pos in range(flag_length):
641
+ best_char, best_time = '', 0
642
+ for c in string.printable:
643
+ io = remote(host, port)
644
+ start = time.time()
645
+ io.sendline((flag + c).ljust(total_len, 'X'))
646
+ io.recvall()
647
+ elapsed = time.time() - start
648
+ if elapsed > best_time:
649
+ best_time = elapsed
650
+ best_char = c
651
+ io.close()
652
+ flag += best_char
653
+ ```
654
+
655
+ ---
656
+
657
+ ## Multi-Thread Anti-Debug with Decoy + Signal Handler Mixed Boolean-Arithmetic (ApoorvCTF 2026)
658
+
659
+ **Pattern (A Golden Experience Requiem):** Multi-threaded binary with layered anti-analysis: Thread 1 performs decoy operations (fake AES + deliberate crash via `ud2`), Thread 2 does the real flag computation in a SIGSEGV signal handler using Mixed Boolean Arithmetic (MBA), Thread 3 erases memory to prevent post-mortem analysis.
660
+
661
+ **Thread layout:**
662
+ | Thread | Purpose | Trap |
663
+ |--------|---------|------|
664
+ | Thread 1 | Decoy: AES-looking operations → `ud2` crash | Analysts waste time reversing fake crypto |
665
+ | Thread 2 | Real flag: SIGSEGV handler with MBA transforms | Hidden in signal handler, not main code path |
666
+ | Thread 3 | Memory eraser: zeros out flag data after computation | Prevents memory dumping |
667
+ | Main | rdtsc-based anti-debug timing check | Penalizes debugger-attached execution |
668
+
669
+ **Solving approach — pure Python emulation of MBA logic:**
670
+ ```python
671
+ # MBA helpers (extracted from assembly)
672
+ def mba_add(a, b): return (a + b) & 0xff
673
+ def mba_xor(a, b): return (a ^ b) & 0xff
674
+
675
+ def mba_transform(i):
676
+ """Position-dependent transform from signal handler."""
677
+ val = (i * 7 + 0x3f) & 0xff
678
+ rotated = ((i << 3) | (i >> 5)) & 0xff
679
+ return mba_xor(val, rotated)
680
+
681
+ # S-box (SHA-256 initial hash values repurposed)
682
+ SBOX = [0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,
683
+ 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19]
684
+
685
+ def sbox_lookup(i):
686
+ idx = i & 7
687
+ shift = ((i >> 3) & 3) * 8
688
+ return (SBOX[idx] >> shift) & 0xff
689
+
690
+ # Two interleaved rodata arrays (even indices → array1, odd → array2)
691
+ rodata1 = bytes.fromhex("39407691b717c97879013adf3a2adea11c2b04e0")
692
+ rodata2 = bytes.fromhex("bb19b025e37eaa786c4116e7aeea00c9c623940d")
693
+
694
+ flag = []
695
+ for i in range(40): # flag length
696
+ t = mba_transform(i)
697
+ s = sbox_lookup(i)
698
+ mem = rodata1[i // 2] if i % 2 == 0 else rodata2[i // 2]
699
+ flag.append(chr(t ^ s ^ mem))
700
+
701
+ print(''.join(flag))
702
+ ```
703
+
704
+ **Key insight:** The real flag logic is in the signal handler (SIGSEGV/SIGILL), not the main thread. Thread 1's AES-like code and `ud2` crash are intentional misdirection. The `rdtsc` timing check detects debuggers and corrupts output. Bypass by extracting the MBA logic from assembly and reimplementing in Python — never run the binary under a debugger.
705
+
706
+ **Detection indicators:**
707
+ - Multiple `pthread_create` calls with different handler functions
708
+ - `signal(SIGSEGV, handler)` or `sigaction` setup
709
+ - `ud2` instruction (deliberate illegal instruction)
710
+ - `rdtsc` instructions for timing checks
711
+ - SHA-256 constants (0x6a09e667...) used as lookup tables, not for hashing
712
+
713
+ ---
714
+
715
+ ## INT3 Patch + Coredump Brute-Force Oracle (Pwn2Win 2016)
716
+
717
+ Instead of reversing complex transformation logic, patch a byte to `0xCC` (INT3) after the transform, enable core dumps, brute-force each character by running the binary and extracting the transformed result from the coredump via `strings`.
718
+
719
+ ```bash
720
+ # Patch byte at transform output point to 0xCC
721
+ printf '\xcc' | dd of=binary bs=1 seek=$((0x400ebb)) conv=notrunc
722
+ ulimit -c unlimited
723
+ # Brute-force each position:
724
+ for c in $(seq 32 126); do
725
+ echo -ne "$(printf '\\x%02x' $c)$known_suffix" | ./binary 2>/dev/null
726
+ strings core | grep -q "$expected" && echo "Found: $c"
727
+ done
728
+ ```
729
+
730
+ **Key insight:** Use INT3/SIGTRAP as a breakpoint oracle -- the coredump captures computed state at the crash point. Avoids full reverse engineering of the transformation.
731
+
732
+ ---
733
+
734
+ ## Signal Handler Chain + LD_PRELOAD Oracle (Nuit du Hack 2016)
735
+
736
+ Binary uses Unix signals for flow control: `main()` sends SIGINT to itself 1024 times, each handler checks one password character, then calls `signal()` to install the next handler. Bypass: LD_PRELOAD a custom `signal()` that logs when it's called (indicating correct character), brute-force each position.
737
+
738
+ ```c
739
+ // LD_PRELOAD library:
740
+ #include <signal.h>
741
+ sighandler_t signal(int sig, sighandler_t handler) {
742
+ write(2, "CORRECT\n", 8); // signal() called = char was correct
743
+ return SIG_DFL;
744
+ }
745
+ ```
746
+
747
+ **Key insight:** Signal-handler-chain anti-reversing can be defeated by hooking `signal()` via LD_PRELOAD. The call to `signal()` (to install the next handler) acts as a side-channel confirming the current character.
748
+
749
+ ---
750
+
751
+ ### printf Format String VM Decompilation to Z3 (SECCON 2017)
752
+
753
+ A "virtual machine" implemented entirely via `%hhn` format strings. Format string `%hhn` writes the count of printed characters (mod 256) to a pointed-to byte. A sequence of `%Nc%hhn` instructions implements arbitrary byte-to-memory writes, effectively creating a bytecode VM.
754
+
755
+ **Step 1: Identify instruction types.**
756
+ Count unique format patterns to determine the instruction set:
757
+ ```bash
758
+ # Normalize numbers and count unique patterns
759
+ sed -e 's/[[:digit:]]\+/1/g' program.fs | sort | uniq -c | sort -nr
760
+ ```
761
+
762
+ **Step 2: Write a decompiler.**
763
+ Convert format patterns to C-style pseudocode. Each `%N...%hhn` pair maps to a memory write: extract the write address (from the argument pointer) and value (from the character count).
764
+
765
+ **Step 3: Recognize the algorithm.**
766
+ The pseudocode typically reveals a linear equation system over bytes. Map memory addresses to symbolic variables.
767
+
768
+ **Step 4: Generate Z3 constraints and solve.**
769
+ ```python
770
+ from z3 import *
771
+
772
+ flag_len = 32 # adjust based on decompiled output
773
+ flag = [BitVec(f'f{i}', 8) for i in range(flag_len)]
774
+ s = Solver()
775
+
776
+ # Constrain to printable ASCII
777
+ for f in flag:
778
+ s.add(f >= 0x20, f <= 0x7e)
779
+
780
+ # Add constraints from decompiled format string operations
781
+ # e.g., flag[3] + flag[7] == 0xAB (mod 256)
782
+ # These come from the write sequences: each %hhn accumulates
783
+ # character counts and writes the result to a target byte
784
+ s.add((flag[0] + flag[1]) & 0xFF == 0x9A) # example constraint
785
+ s.add((flag[2] ^ flag[3]) & 0xFF == 0x3F) # example constraint
786
+ # ... (add all constraints from decompilation)
787
+
788
+ if s.check() == sat:
789
+ m = s.model()
790
+ print(bytes([m[f].as_long() for f in flag]))
791
+ ```
792
+
793
+ **Decompilation approach in detail:**
794
+ 1. Extract the write address and value from each `%N...%hhn` pair
795
+ 2. Map memory addresses to symbolic variables (flag bytes)
796
+ 3. Build an equation system from the write sequences
797
+ 4. Solve with Z3
798
+
799
+ **Key insight:** Format string `%hhn` writes the count of printed characters (mod 256) to a pointed-to byte. A sequence of `%Nc%hhn` instructions implements arbitrary byte-to-memory writes, effectively creating a bytecode VM. Decompile by: (1) extract the write address and value from each `%N...%hhn` pair, (2) map memory addresses to symbolic variables, (3) build an equation system from the write sequences, (4) solve with Z3.
800
+
801
+ **References:** SECCON 2017