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,822 @@
1
+ # CTF Reverse - Advanced Tools & Deobfuscation
2
+
3
+ Advanced tooling for commercial packers/protectors, binary diffing, deobfuscation frameworks, emulation, and symbolic execution beyond angr.
4
+
5
+ ## Table of Contents
6
+ - [VMProtect Analysis](#vmprotect-analysis)
7
+ - [Recognition](#recognition)
8
+ - [Approach](#approach)
9
+ - [Tools](#tools)
10
+ - [CTF Strategy](#ctf-strategy)
11
+ - [Themida / WinLicense Analysis](#themida--winlicense-analysis)
12
+ - [Themida Recognition](#themida-recognition)
13
+ - [Approach for CTF](#approach-for-ctf)
14
+ - [Binary Diffing](#binary-diffing)
15
+ - [BinDiff](#bindiff)
16
+ - [Diaphora](#diaphora)
17
+ - [Deobfuscation Frameworks](#deobfuscation-frameworks)
18
+ - [D-810 (IDA)](#d-810-ida)
19
+ - [GOOMBA (Ghidra)](#goomba-ghidra)
20
+ - [Miasm](#miasm)
21
+ - [Qiling Framework (Emulation)](#qiling-framework-emulation)
22
+ - [Triton (Dynamic Symbolic Execution)](#triton-dynamic-symbolic-execution)
23
+ - [Manticore (Symbolic Execution)](#manticore-symbolic-execution)
24
+ - [Rizin / Cutter](#rizin--cutter)
25
+ - [RetDec (Retargetable Decompiler)](#retdec-retargetable-decompiler)
26
+ - [Custom VM Bytecode Lifting to LLVM IR (Google CTF 2017)](#custom-vm-bytecode-lifting-to-llvm-ir-google-ctf-2017)
27
+ - [Advanced GDB Techniques](#advanced-gdb-techniques)
28
+ - [Python Scripting](#python-scripting)
29
+ - [Brute-Force with GDB Script](#brute-force-with-gdb-script)
30
+ - [Conditional Breakpoints](#conditional-breakpoints)
31
+ - [Watchpoints](#watchpoints)
32
+ - [Reverse Debugging (rr)](#reverse-debugging-rr)
33
+ - [GDB Dashboard / GEF / pwndbg](#gdb-dashboard--gef--pwndbg)
34
+ - [Advanced Ghidra Scripting](#advanced-ghidra-scripting)
35
+ - [Patching Strategies](#patching-strategies)
36
+ - [Binary Ninja Patching (Python API)](#binary-ninja-patching-python-api)
37
+ - [LIEF (Library for Instrumenting Executable Formats)](#lief-library-for-instrumenting-executable-formats)
38
+ - [GDB Constraint Extraction with ILP/LP Solver (BackdoorCTF 2017)](#gdb-constraint-extraction-with-ilplp-solver-backdoorctf-2017)
39
+ - [GDB Position-Encoded Input with Zero Flag Monitoring (EKOPARTY 2017)](#gdb-position-encoded-input-with-zero-flag-monitoring-ekoparty-2017)
40
+ - [LD_PRELOAD to Dump Execute-Only Binary (BackdoorCTF 2017)](#ld_preload-to-dump-execute-only-binary-backdoorctf-2017)
41
+
42
+ ---
43
+
44
+ ## VMProtect Analysis
45
+
46
+ VMProtect virtualizes x86/x64 code into custom bytecode interpreted by a generated VM. One of the most challenging protectors in CTF.
47
+
48
+ ### Recognition
49
+
50
+ ```bash
51
+ # VMProtect signatures
52
+ strings binary | grep -i "vmp\|vmprotect"
53
+ # PE sections: .vmp0, .vmp1 (VMProtect adds its own sections)
54
+ readelf -S binary | grep ".vmp"
55
+ # Large binary with entropy > 7.5 in certain sections
56
+ ```
57
+
58
+ **Key indicators:**
59
+ - `push` / `pop` heavy prologues (VM entry pushes all registers to stack)
60
+ - Large switch-case dispatcher (the VM handler loop)
61
+ - Anti-debug checks embedded in VM handlers
62
+ - Mutation engine: same opcode has different handlers per build
63
+
64
+ ### Approach
65
+
66
+ ```text
67
+ 1. Identify VM entry points — look for pushad/pushaq-like sequences
68
+ 2. Find the handler table — large indirect jump (jmp [reg + offset])
69
+ 3. Trace handler execution — each handler ends with jump to next
70
+ 4. Identify handlers:
71
+ - vAdd, vSub, vMul, vXor, vNot (arithmetic)
72
+ - vPush, vPop (stack operations)
73
+ - vLoad, vStore (memory access)
74
+ - vJmp, vJcc (control flow)
75
+ - vRet (VM exit — restores real registers)
76
+ 5. Build disassembler for VM bytecode
77
+ 6. Simplify / deobfuscate the lifted IL
78
+ ```
79
+
80
+ ### Tools
81
+
82
+ - **VMPAttack** (IDA plugin): Automatically identifies VM handlers
83
+ - **NoVmp**: Devirtualization via VTIL (open-source)
84
+ - **VMProtect devirtualizer scripts**: Community IDA/Binary Ninja scripts
85
+ - **Approach for CTF:** Often easier to trace specific operations (crypto, comparisons) than fully devirtualize
86
+
87
+ ### CTF Strategy
88
+
89
+ ```python
90
+ # Trace VM execution dynamically to extract operations on flag
91
+ # Hook VM handler dispatch to log opcode + operands
92
+
93
+ import frida
94
+
95
+ script = """
96
+ var vm_dispatch = ptr('0x...'); // Address of handler table jump
97
+ Interceptor.attach(vm_dispatch, {
98
+ onEnter(args) {
99
+ // Log handler index and stack state
100
+ var handler_idx = this.context.rax; // or whichever register
101
+ console.log('Handler:', handler_idx, 'RSP:', this.context.rsp);
102
+ }
103
+ });
104
+ """
105
+ ```
106
+
107
+ **Key insight:** Full devirtualization is rarely needed for CTF. Focus on tracing what operations are performed on your input. Hook comparison/crypto functions called from within the VM.
108
+
109
+ ---
110
+
111
+ ## Themida / WinLicense Analysis
112
+
113
+ Similar to VMProtect but with additional anti-debug layers.
114
+
115
+ ### Themida Recognition
116
+ - Sections: `.themida`, `.winlice`
117
+ - Extremely heavy anti-debug (kernel-level checks, driver installation)
118
+ - Code mutation + virtualization + packing combined
119
+
120
+ ### Approach for CTF
121
+ 1. **Dump unpacked code:** Let it run, dump process memory after unpacking
122
+ 2. **Bypass anti-debug:** ScyllaHide in x64dbg with Themida-specific preset
123
+ 3. **Fix imports:** Use Scylla plugin for IAT reconstruction
124
+ 4. **Focus on dumped code:** Once unpacked, analyze as normal binary
125
+
126
+ ```bash
127
+ # x64dbg workflow for Themida:
128
+ 1. Load binary
129
+ 2. Enable ScyllaHide → Profile: Themida
130
+ 3. Run to OEP (Original Entry Point) — may need several attempts
131
+ 4. Dump with Scylla: OEP → IAT Autosearch → Get Imports → Dump
132
+ 5. Fix dump: Scylla → Fix Dump
133
+ 6. Analyze fixed dump in Ghidra/IDA
134
+ ```
135
+
136
+ ---
137
+
138
+ ## Binary Diffing
139
+
140
+ Critical for patch analysis, 1-day exploit development, and CTF challenges that provide two versions of a binary.
141
+
142
+ ### BinDiff
143
+
144
+ ```bash
145
+ # Export from IDA/Ghidra first, then diff
146
+ # IDA: File → BinExport → Export as BinExport2
147
+ # Ghidra: Use BinExport plugin
148
+
149
+ # Command line diffing
150
+ bindiff primary.BinExport secondary.BinExport
151
+ # Opens in BinDiff GUI — shows matched/unmatched functions
152
+ ```
153
+
154
+ **Key metrics:**
155
+ - Similarity score (0.0-1.0) per function pair
156
+ - Changed instructions highlighted
157
+ - Unmatched functions = new/removed code
158
+
159
+ ### Diaphora
160
+
161
+ Free, open-source alternative to BinDiff, runs as IDA plugin.
162
+
163
+ ```bash
164
+ # In IDA:
165
+ # File → Script file → diaphora.py
166
+ # Export first binary, then open second and diff
167
+
168
+ # Ghidra version: diaphora_ghidra.py
169
+ ```
170
+
171
+ **Useful for CTF:** When challenge provides "patched" and "original" binaries, diff reveals the vulnerability or hidden functionality.
172
+
173
+ ---
174
+
175
+ ## Deobfuscation Frameworks
176
+
177
+ > OLLVM 脱密的完整工作流、变种生态和社区工具调研见 [ollvm-deobfuscation.md](references/ollvm-deobfuscation.md)。
178
+
179
+ ### d810-ng (IDA) — 本地首选
180
+
181
+ D-810 的现代维护版(Next Generation),集成 **Z3 SMT** 求解器,覆盖 OLLVM / Tigress / Hodur(PlugX) / Approov 多种变种。
182
+
183
+ ```text
184
+ Capabilities:
185
+ - MBA simplification (Z3-verified): (a ^ b) + 2*(a & b) → a + b
186
+ - Opaque predicate removal (Pred0/PredFF/PredSetz/PredSetnz)
187
+ - Constant folding (22 rules)
188
+ - Control flow unflattening (多种 unflattener):
189
+ * Unflattener → O-LLVM (switch/if-chain)
190
+ * UnflattenerSwitchCase → Tigress (m_jtbl)
191
+ * UnflattenerTigressIndirect → Tigress (m_ijmp)
192
+ * HodurUnflattener → Hodur/PlugX (while(1) + jnz state)
193
+ * BadWhileLoop → Approov (0xF6000–0xF6FFF 状态常量)
194
+ - Hacker's Delight 位运算等价
195
+ - PlugX (Hodur) 恶意软件专用 MBA 模式
196
+
197
+ Installation: clone → 复制到 IDA plugins 目录 → Ctrl-Shift-D 加载
198
+ Source: https://github.com/w00tzenheimer/d810-ng
199
+ ```
200
+
201
+ ### obpo-plugin (IDA) — 效果最强,云插件
202
+
203
+ 基于 Hex-Rays **microcode** + 数据流跟踪 + 程序切片 + 混合执行(concolic)。社区公认效果最强之一。
204
+
205
+ ```text
206
+ - 在 microcode 层优化反编译输出(不是改 ASM)
207
+ - 支持 IDA 7.5-7.7 + Hex-Rays,多架构 (ARM/ARM64/x86/x64/PPC/MIPS)
208
+ - 云插件:目标函数上传 obpo-server 处理(核心闭源,插件免费)
209
+ - ⚠️ 敏感样本慎用(二进制上传云服务)
210
+ - 用法:右键 dispatcher → OBPO → Mark and process function
211
+ Source: https://github.com/obpo-project/obpo-plugin
212
+ ```
213
+
214
+ ### ollvm-unflattener — Miasm 纯脚本
215
+
216
+ 无 IDA 依赖,基于 Miasm 符号执行,BFS 多层处理,支持 x86/x64 Win/Linux。
217
+
218
+ ```bash
219
+ git clone https://github.com/cdong1012/ollvm-unflattener
220
+ pip install -r requirements.txt # miasm, graphviz, keystone-engine
221
+ python unflattener -i <input> -o <output> -t <func_addr> -a # -a 自动多层
222
+ ```
223
+
224
+ ### ollvm-breaker (Binary Ninja)
225
+
226
+ Binary Ninja 去平坦化,仓库自带 Android 加固样本 `libvdog.so` 实战。Source: amimo/ollvm-breaker
227
+
228
+ ### DeObfBR — BR 混淆专项
229
+
230
+ 专门去除 Goron/Arkari 风格的 BR(间接分支)混淆。简易技巧:设置数据段只读可部分对抗。Source: Mrack/DeObfBR
231
+
232
+ ### deollvm — ARM64 Unicorn
233
+
234
+ 无 IDA 时处理 ARM64 .so 的备选,基于 Unicorn。Source: GeT1t/deollvm
235
+
236
+ ### GOOMBA (Ghidra)
237
+
238
+ ```text
239
+ GOOMBA (Ghidra-based Obfuscated Object Matching and Bytes Analysis):
240
+ - Integrates with Ghidra's P-Code
241
+ - Simplifies MBA expressions
242
+ - Pattern matching for known obfuscation
243
+
244
+ Installation: Copy .jar to Ghidra extensions
245
+ Usage: Code Browser → Analysis → GOOMBA
246
+ ```
247
+
248
+ ### Miasm
249
+
250
+ Powerful reverse engineering framework with symbolic execution and IR lifting.
251
+
252
+ ```python
253
+ from miasm.analysis.binary import Container
254
+ from miasm.analysis.machine import Machine
255
+ from miasm.expression.expression import *
256
+
257
+ # Load binary and lift to Miasm IR
258
+ cont = Container.from_stream(open("binary", "rb"))
259
+ machine = Machine(cont.arch)
260
+ mdis = machine.dis_engine(cont.bin_stream, loc_db=cont.loc_db)
261
+
262
+ # Disassemble function
263
+ asmcfg = mdis.dis_multiblock(entry_addr)
264
+
265
+ # Lift to IR
266
+ lifter = machine.lifter_model_call(loc_db=cont.loc_db)
267
+ ircfg = lifter.new_ircfg_from_asmcfg(asmcfg)
268
+
269
+ # Symbolic execution
270
+ from miasm.ir.symbexec import SymbolicExecutionEngine
271
+ sb = SymbolicExecutionEngine(lifter)
272
+ # Execute symbolically, then simplify expressions
273
+ ```
274
+
275
+ **Use case:** Deobfuscate expression trees, simplify complex arithmetic, trace data flow through obfuscated code.
276
+
277
+ ---
278
+
279
+ ## Qiling Framework (Emulation)
280
+
281
+ Cross-platform emulation framework built on Unicorn, with OS-level support (syscalls, filesystem, registry).
282
+
283
+ ```python
284
+ from qiling import Qiling
285
+ from qiling.const import QL_VERBOSE
286
+
287
+ # Emulate Linux ELF
288
+ ql = Qiling(["./binary"], "rootfs/x8664_linux",
289
+ verbose=QL_VERBOSE.DEBUG)
290
+
291
+ # Hook specific address
292
+ @ql.hook_address
293
+ def hook_check(ql, address, size):
294
+ if address == 0x401234:
295
+ ql.arch.regs.rax = 0 # Bypass check
296
+ ql.log.info("Anti-debug bypassed")
297
+
298
+ # Hook syscall
299
+ @ql.hook_syscall(name="ptrace")
300
+ def hook_ptrace(ql, request, pid, addr, data):
301
+ return 0 # Always succeed
302
+
303
+ # Hook API (Windows)
304
+ @ql.set_api("IsDebuggerPresent", target=ql.os.user_defined_api)
305
+ def hook_isdebug(ql, address, params):
306
+ return 0
307
+
308
+ ql.run()
309
+ ```
310
+
311
+ **Advantages over Unicorn:**
312
+ - OS emulation (file I/O, network, registry)
313
+ - Multi-platform (Linux, Windows, macOS, Android, UEFI)
314
+ - Built-in debugger interface
315
+ - Rootfs for library loading
316
+
317
+ **CTF use cases:**
318
+ - Emulate binaries for foreign architectures (ARM, MIPS, RISC-V)
319
+ - Bypass all anti-debug at once (no debugger artifacts)
320
+ - Fuzz embedded/IoT firmware without hardware
321
+ - Trace execution without code modification
322
+
323
+ ---
324
+
325
+ ## Triton (Dynamic Symbolic Execution)
326
+
327
+ Pin-based dynamic binary analysis framework with symbolic execution, taint analysis, and AST simplification.
328
+
329
+ ```python
330
+ from triton import *
331
+
332
+ ctx = TritonContext(ARCH.X86_64)
333
+
334
+ # Load binary sections
335
+ with open("binary", "rb") as f:
336
+ binary = f.read()
337
+ ctx.setConcreteMemoryAreaValue(0x400000, binary)
338
+
339
+ # Symbolize input
340
+ for i in range(32):
341
+ ctx.symbolizeMemory(MemoryAccess(INPUT_ADDR + i, CPUSIZE.BYTE), f"input_{i}")
342
+
343
+ # Emulate instructions
344
+ pc = ENTRY_POINT
345
+ while pc:
346
+ inst = Instruction(pc, ctx.getConcreteMemoryAreaValue(pc, 16))
347
+ ctx.processing(inst)
348
+
349
+ # At comparison point, extract path constraint
350
+ if pc == CMP_ADDR:
351
+ ast = ctx.getPathConstraintsAst()
352
+ model = ctx.getModel(ast)
353
+ for k, v in sorted(model.items()):
354
+ print(f"input[{k}] = {chr(v.getValue())}", end="")
355
+ break
356
+
357
+ pc = ctx.getConcreteRegisterValue(ctx.registers.rip)
358
+ ```
359
+
360
+ **Triton vs angr:**
361
+ | Feature | Triton | angr |
362
+ |---|---|---|
363
+ | Execution | Concrete + symbolic (DSE) | Fully symbolic |
364
+ | Speed | Faster (concrete-driven) | Slower (explores all paths) |
365
+ | Path explosion | Less prone (follows one path) | Major issue |
366
+ | API | C++ / Python | Python |
367
+ | Best for | Single-path deobfuscation, taint tracking | Multi-path exploration |
368
+
369
+ **Key use:** Triton excels at deobfuscation — run the program concretely, but track symbolic state, then simplify the collected constraints.
370
+
371
+ ---
372
+
373
+ ## Manticore (Symbolic Execution)
374
+
375
+ Trail of Bits' symbolic execution tool for native binaries. Its API is similar in spirit to angr.
376
+
377
+ ```python
378
+ from manticore.native import Manticore
379
+
380
+ m = Manticore("./binary")
381
+
382
+ # Hook success/failure
383
+ @m.hook(0x401234)
384
+ def success(state):
385
+ buf = state.solve_one_n_batched(state.input_symbols, 32)
386
+ print("Flag:", bytes(buf))
387
+ m.kill()
388
+
389
+ @m.hook(0x401256)
390
+ def fail(state):
391
+ state.abandon()
392
+
393
+ m.run()
394
+ ```
395
+
396
+ **Best for:** simpler Linux binaries and embedded targets. angr is generally more mature for complex RE tasks.
397
+
398
+ ---
399
+
400
+ ## Rizin / Cutter
401
+
402
+ Rizin is the maintained fork of radare2. Cutter is its Qt-based GUI.
403
+
404
+ ```bash
405
+ # Rizin CLI (r2-compatible commands)
406
+ rizin -d ./binary
407
+ > aaa # Analyze all
408
+ > afl # List functions
409
+ > pdf @ main # Print disassembly
410
+ > VV # Visual graph mode
411
+
412
+ # Cutter GUI
413
+ cutter binary # Open in GUI with decompiler
414
+ ```
415
+
416
+ **Cutter advantages:**
417
+ - Built-in Ghidra decompiler (via r2ghidra plugin)
418
+ - Graph view, hex editor, debug panel in one GUI
419
+ - Integrated Python/JavaScript scripting console
420
+ - Free and open source
421
+
422
+ ---
423
+
424
+ ## RetDec (Retargetable Decompiler)
425
+
426
+ LLVM-based decompiler supporting many architectures. Free and open-source.
427
+
428
+ ```bash
429
+ # Install
430
+ pip install retdec-decompiler
431
+ # Or use web: https://retdec.com/decompilation/
432
+
433
+ # CLI
434
+ retdec-decompiler binary
435
+ # Outputs: binary.c (decompiled C), binary.dsm (disassembly)
436
+
437
+ # Specific function
438
+ retdec-decompiler --select-ranges 0x401000-0x401100 binary
439
+ ```
440
+
441
+ **Strengths:** Multi-arch support (x86, ARM, MIPS, PowerPC, PIC32), free, produces compilable C. Good for architectures not well-supported by Ghidra.
442
+
443
+ ---
444
+
445
+ ## Custom VM Bytecode Lifting to LLVM IR (Google CTF 2017)
446
+
447
+ For complex custom VMs, transpile the VM bytecode to LLVM IR and use LLVM's optimization passes to simplify the code, then decompile the optimized IR.
448
+
449
+ ```python
450
+ # Pipeline: VM bytecode → custom disassembler → LLVM IR → optimize → decompile
451
+ # 1. Write disassembler for the custom VM opcodes
452
+ # 2. Emit LLVM IR for each opcode:
453
+ # INC reg → %reg = add i32 %reg, 1
454
+ # CDEC reg → conditional decrement
455
+ # CALL fn → call void @fn()
456
+ # 3. Use MCJIT or llc to optimize:
457
+ # opt -O3 -S vm_lifted.ll -o vm_optimized.ll
458
+ # 4. Load optimized IR in IDA or decompile with RetDec
459
+ # Result: 1300 lines → 150 lines after inlining + constant folding
460
+ ```
461
+
462
+ **Key insight:** LLVM's optimization passes (inlining, constant folding, dead code elimination) dramatically simplify lifted VM bytecode. A custom VM with 26 registers and 3 opcodes that produces 1300 lines of IL reduces to ~150 lines after `-O3`, revealing the underlying algorithm (e.g., Collatz sequence computation).
463
+
464
+ ---
465
+
466
+ ## Advanced GDB Techniques
467
+
468
+ ### Python Scripting
469
+
470
+ ```python
471
+ # ~/.gdbinit or source from GDB
472
+ import gdb
473
+
474
+ class TraceCompare(gdb.Breakpoint):
475
+ """Log all comparison operations."""
476
+ def __init__(self, addr):
477
+ super().__init__(f"*{addr}", gdb.BP_BREAKPOINT)
478
+
479
+ def stop(self):
480
+ frame = gdb.selected_frame()
481
+ rdi = int(frame.read_register("rdi"))
482
+ rsi = int(frame.read_register("rsi"))
483
+ rdx = int(frame.read_register("rdx"))
484
+ # Read compared buffers
485
+ inferior = gdb.selected_inferior()
486
+ buf1 = inferior.read_memory(rdi, rdx).tobytes()
487
+ buf2 = inferior.read_memory(rsi, rdx).tobytes()
488
+ print(f"memcmp({buf1!r}, {buf2!r}, {rdx})")
489
+ return False # Don't stop, just log
490
+
491
+ # Usage in GDB:
492
+ # (gdb) source trace_cmp.py
493
+ # (gdb) python TraceCompare(0x401234)
494
+ ```
495
+
496
+ ### Brute-Force with GDB Script
497
+
498
+ ```python
499
+ # Byte-by-byte brute force via GDB Python API
500
+ import gdb, string
501
+
502
+ def bruteforce_flag(check_addr, success_addr, fail_addr, flag_len):
503
+ flag = []
504
+ for pos in range(flag_len):
505
+ for ch in string.printable:
506
+ candidate = ''.join(flag) + ch + 'A' * (flag_len - pos - 1)
507
+ gdb.execute('start', to_string=True)
508
+ gdb.execute(f'b *{check_addr}', to_string=True)
509
+ # Write candidate to stdin pipe
510
+ # ... (setup input)
511
+ gdb.execute('continue', to_string=True)
512
+ rip = int(gdb.parse_and_eval('$rip'))
513
+ if rip == success_addr:
514
+ flag.append(ch)
515
+ break
516
+ gdb.execute('delete breakpoints', to_string=True)
517
+ return ''.join(flag)
518
+ ```
519
+
520
+ ### Conditional Breakpoints
521
+
522
+ ```bash
523
+ # Break only when register has specific value
524
+ (gdb) b *0x401234 if $rax == 0x41
525
+ (gdb) b *0x401234 if *(char*)$rdi == 'f'
526
+
527
+ # Break on Nth hit
528
+ (gdb) b *0x401234
529
+ (gdb) ignore 1 99 # Skip first 99 hits, break on 100th
530
+
531
+ # Log without stopping
532
+ (gdb) b *0x401234
533
+ (gdb) commands
534
+ > silent
535
+ > printf "rax=%lx rdi=%lx\n", $rax, $rdi
536
+ > continue
537
+ > end
538
+ ```
539
+
540
+ ### Watchpoints
541
+
542
+ ```bash
543
+ # Hardware watchpoint — break when memory changes
544
+ (gdb) watch *(int*)0x601050 # Break on write to address
545
+ (gdb) rwatch *(int*)0x601050 # Break on read
546
+ (gdb) awatch *(int*)0x601050 # Break on read or write
547
+
548
+ # Watch a variable by name (needs debug symbols)
549
+ (gdb) watch flag_buffer[0]
550
+
551
+ # Conditional watchpoint
552
+ (gdb) watch *(int*)0x601050 if *(int*)0x601050 == 0x42
553
+ ```
554
+
555
+ ### Reverse Debugging (rr)
556
+
557
+ ```bash
558
+ # Record execution
559
+ rr record ./binary
560
+ # Replay with reverse execution support
561
+ rr replay
562
+
563
+ # In rr replay (GDB commands plus):
564
+ (gdb) reverse-continue # Run backward to previous breakpoint
565
+ (gdb) reverse-stepi # Step backward one instruction
566
+ (gdb) reverse-next # Reverse next
567
+ (gdb) when # Show current event number
568
+
569
+ # Set checkpoint and return to it
570
+ (gdb) checkpoint
571
+ (gdb) restart 1 # Return to checkpoint 1
572
+ ```
573
+
574
+ **Key use:** When you step past the critical moment, reverse back instead of restarting. Invaluable for anti-debug that corrupts state.
575
+
576
+ ### GDB Dashboard / GEF / pwndbg
577
+
578
+ ```bash
579
+ # pwndbg (most popular for CTF)
580
+ # https://github.com/pwndbg/pwndbg
581
+ git clone https://github.com/pwndbg/pwndbg && cd pwndbg && ./setup.sh
582
+
583
+ # Key pwndbg commands:
584
+ pwndbg> context # Show registers, stack, code, backtrace
585
+ pwndbg> vmmap # Memory map (like /proc/self/maps)
586
+ pwndbg> search -s "flag{" # Search memory for string
587
+ pwndbg> telescope $rsp 20 # Smart stack dump
588
+ pwndbg> cyclic 200 # Generate De Bruijn pattern
589
+ pwndbg> hexdump $rdi 64 # Pretty hex dump
590
+ pwndbg> got # Show GOT entries
591
+ pwndbg> plt # Show PLT entries
592
+
593
+ # GEF (alternative)
594
+ # https://github.com/hugsy/gef
595
+ bash -c "$(curl -fsSL https://gef.blah.cat/sh)"
596
+
597
+ # Key GEF commands:
598
+ gef> xinfo $rdi # Detailed info about address
599
+ gef> checksec # Binary security features
600
+ gef> heap chunks # Heap chunk listing
601
+ gef> pattern create 100 # De Bruijn pattern
602
+ ```
603
+
604
+ ---
605
+
606
+ ## Advanced Ghidra Scripting
607
+
608
+ ```python
609
+ # Ghidra Python (Jython) — run via Script Manager or headless
610
+
611
+ # Batch rename functions matching a pattern
612
+ from ghidra.program.model.symbol import SourceType
613
+ fm = currentProgram.getFunctionManager()
614
+ for func in fm.getFunctions(True):
615
+ if func.getName().startswith("FUN_"):
616
+ # Check if function contains specific instruction pattern
617
+ body = func.getBody()
618
+ inst_iter = currentProgram.getListing().getInstructions(body, True)
619
+ for inst in inst_iter:
620
+ if inst.getMnemonicString() == "CPUID":
621
+ func.setName("anti_vm_check_" + hex(func.getEntryPoint().getOffset()),
622
+ SourceType.USER_DEFINED)
623
+ break
624
+
625
+ # Extract all XOR constants from a function
626
+ def extract_xor_constants(func):
627
+ """Find all XOR operations and their immediate operands."""
628
+ constants = []
629
+ body = func.getBody()
630
+ inst_iter = currentProgram.getListing().getInstructions(body, True)
631
+ for inst in inst_iter:
632
+ if inst.getMnemonicString() == "XOR":
633
+ for i in range(inst.getNumOperands()):
634
+ op = inst.getOpObjects(i)
635
+ if op and hasattr(op[0], 'getValue'):
636
+ constants.append(int(op[0].getValue()))
637
+ return constants
638
+
639
+ # Bulk decompile and search for pattern
640
+ from ghidra.app.decompiler import DecompInterface
641
+ decomp = DecompInterface()
642
+ decomp.openProgram(currentProgram)
643
+
644
+ for func in fm.getFunctions(True):
645
+ result = decomp.decompileFunction(func, 30, monitor)
646
+ if result.depiledFunction():
647
+ code = result.getDecompiledFunction().getC()
648
+ if "strcmp" in code or "memcmp" in code:
649
+ print(f"Comparison in {func.getName()} at {func.getEntryPoint()}")
650
+ ```
651
+
652
+ ---
653
+
654
+ ## Patching Strategies
655
+
656
+ ### Binary Ninja Patching (Python API)
657
+
658
+ ```python
659
+ import binaryninja as bn
660
+
661
+ bv = bn.open_view("binary")
662
+
663
+ # NOP out instruction
664
+ bv.write(0x401234, b"\x90" * 5) # 5-byte NOP
665
+
666
+ # Patch conditional jump (JNZ → JZ)
667
+ bv.write(0x401234, b"\x74") # 0x75 (JNZ) → 0x74 (JZ)
668
+
669
+ # Insert always-true (mov eax, 1; ret)
670
+ bv.write(0x401234, b"\xb8\x01\x00\x00\x00\xc3")
671
+
672
+ bv.save("patched")
673
+ ```
674
+
675
+ ### LIEF (Library for Instrumenting Executable Formats)
676
+
677
+ ```python
678
+ import lief
679
+
680
+ # Parse and modify ELF/PE/Mach-O
681
+ binary = lief.parse("binary")
682
+
683
+ # Add a new section
684
+ section = lief.ELF.Section(".patch")
685
+ section.content = list(b"\xcc" * 0x100)
686
+ section.type = lief.ELF.SECTION_TYPES.PROGBITS
687
+ section.flags = lief.ELF.SECTION_FLAGS.EXECINSTR | lief.ELF.SECTION_FLAGS.ALLOC
688
+ binary.add(section)
689
+
690
+ # Modify entry point
691
+ binary.header.entrypoint = 0x401000
692
+
693
+ # Hook imported function
694
+ binary.patch_pltgot("strcmp", 0x401000)
695
+
696
+ binary.write("patched")
697
+ ```
698
+
699
+ **LIEF advantages:** Cross-format (ELF, PE, Mach-O), Python API, can add sections/segments, modify headers, patch imports.
700
+
701
+ ---
702
+
703
+ ## GDB Constraint Extraction with ILP/LP Solver (BackdoorCTF 2017)
704
+
705
+ When a binary enforces linear arithmetic relationships between input bytes, extract constraints automatically via GDB and solve with an ILP solver.
706
+
707
+ **Technique:** Send position-encoded input (`input[i] = i`) so that when a comparison fires, you know exactly which positions are involved and what their sum/difference must equal. Collect all constraints from logged comparisons, then feed to PuLP or Gurobi.
708
+
709
+ ```python
710
+ from pulp import *
711
+
712
+ n = 32 # flag length
713
+ prob = LpProblem("crackme", LpMinimize)
714
+ x = [LpVariable(f'x{i}', 32, 126, cat='Integer') for i in range(n)]
715
+ prob += 0 # dummy objective
716
+
717
+ # Constraints extracted via GDB automation (input[i]=i, monitor comparisons):
718
+ prob += x[3] + x[7] == 0xAB
719
+ prob += x[1] - x[5] == 0x0C
720
+ # ... add all extracted constraints ...
721
+
722
+ # Constrain to printable ASCII
723
+ for xi in x:
724
+ prob += xi >= 32
725
+ prob += xi <= 126
726
+
727
+ prob.solve(PULP_CBC_CMD(msg=0))
728
+ flag = ''.join(chr(int(value(xi))) for xi in x)
729
+ print("Flag:", flag)
730
+ ```
731
+
732
+ **GDB automation to extract constraints:**
733
+ ```python
734
+ # In GDB Python: set input[i]=i, run, log every CMP instruction result
735
+ import gdb
736
+
737
+ class CmpLogger(gdb.Breakpoint):
738
+ def stop(self):
739
+ frame = gdb.selected_frame()
740
+ # Read compared values, map back to input indices via position encoding
741
+ return False
742
+ ```
743
+
744
+ **Key insight:** When a binary enforces linear arithmetic relationships between input bytes, ILP solvers directly find the satisfying assignment once constraints are extracted via GDB automation.
745
+
746
+ **References:** BackdoorCTF 2017
747
+
748
+ ---
749
+
750
+ ## GDB Position-Encoded Input with Zero Flag Monitoring (EKOPARTY 2017)
751
+
752
+ Send input where `input[i] = i` (position-encoded). Single-step through the binary monitoring the CPU zero flag (ZF). When ZF is set at a comparison involving a specific position's value, the comparison matched — log the expected value for that position.
753
+
754
+ ```python
755
+ import gdb
756
+
757
+ # Script: single-step binary with position-encoded input, watch ZF
758
+ class ZFMonitor(gdb.Breakpoint):
759
+ def stop(self):
760
+ zf = (int(gdb.parse_and_eval('$eflags')) >> 6) & 1
761
+ if zf:
762
+ rip = int(gdb.parse_and_eval('$rip'))
763
+ # Disassemble at rip to find the compared immediate
764
+ disasm = gdb.execute(f'x/1i {rip-5}', to_string=True)
765
+ print(f"ZF set at {rip:#x}: {disasm.strip()}")
766
+ return False
767
+
768
+ # Run once with input b'\x00\x01\x02\x03...\x1f'
769
+ # ZF fires when comparison matches the position's own value -> that IS the key byte
770
+ ```
771
+
772
+ Maps each input byte to its required value in one pass without manual reversing.
773
+
774
+ **Key insight:** Position-encoded input (`input[i]=i`) combined with zero flag monitoring reveals the full key/password in one pass — the zero flag fires when the expected value for position i equals i itself.
775
+
776
+ **References:** EKOPARTY CTF 2017
777
+
778
+ ---
779
+
780
+ ## LD_PRELOAD to Dump Execute-Only Binary (BackdoorCTF 2017)
781
+
782
+ A binary has execute-only permissions (mode `--x`, no read bit). The file cannot be read directly or with standard tools, but the kernel still maps it into memory on execution.
783
+
784
+ LD_PRELOAD a shared library with a constructor that runs inside the process and reads its own memory via `/proc/self/mem`:
785
+
786
+ ```c
787
+ // dump_xo.c — compile: gcc -shared -fPIC -o dump_xo.so dump_xo.c
788
+ #include <stdio.h>
789
+ #include <stdlib.h>
790
+ #include <string.h>
791
+
792
+ __attribute__((constructor)) void dump() {
793
+ FILE *maps = fopen("/proc/self/maps", "r");
794
+ char line[256];
795
+ unsigned long base = 0, end = 0;
796
+
797
+ // Find the execute-only binary's mapping (r-xp or --xp)
798
+ while (fgets(line, sizeof(line), maps)) {
799
+ if (strstr(line, "binary_name")) {
800
+ sscanf(line, "%lx-%lx", &base, &end);
801
+ break;
802
+ }
803
+ }
804
+ fclose(maps);
805
+
806
+ FILE *mem = fopen("/proc/self/mem", "rb");
807
+ fseek(mem, base, SEEK_SET);
808
+ size_t size = end - base;
809
+ void *buf = malloc(size);
810
+ fread(buf, 1, size, mem);
811
+ fclose(mem);
812
+
813
+ FILE *out = fopen("/tmp/dumped_binary", "wb");
814
+ fwrite(buf, 1, size, out);
815
+ fclose(out);
816
+ }
817
+ // Usage: LD_PRELOAD=./dump_xo.so ./binary_xo
818
+ ```
819
+
820
+ **Key insight:** Execute-only prevents file reading but not execution. LD_PRELOAD constructors run inside the process where `/proc/self/mem` provides access to mapped memory regardless of file permissions.
821
+
822
+ **References:** BackdoorCTF 2017