Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/trilwu/secskills/exploiting-memory-corruptionnpx skills add trilwu/secskills --skill exploiting-memory-corruptiongit clone --depth 1 https://github.com/trilwu/secskillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/trilwu/secskills/exploiting-memory-corruption)<a href="https://agentmods.dev/skills/trilwu/secskills/exploiting-memory-corruption"><img src="https://agentmods.dev/badge/skills/trilwu/secskills/exploiting-memory-corruption.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00118 | $0.02533 |
| Opus 5 | $0.00059 | $0.01267 |
| Sonnet 5 | $0.00024 | $0.00507 |
| Haiku 4.5 | $0.00012 | $0.00253 |
Grade A, and why
exploiting-memory-corruption scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 194 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Exploiting Memory Corruption
Reverse engineering tells you a binary is buggy. Exploitation is the separate craft of turning that bug into a controlled primitive and then into code execution, against the mitigations the target actually ships. The work is a chain of conversions — bug to primitive, primitive to leak, leak to control — and each link is chosen by what the binary's protections allow, not by rote.
When to Use
- You have a crash or a known bug class in an ELF/PE and need to assess exploitability and build a working exploit
- Constructing a ROP/JOP chain, a ret2libc, or a heap-grooming sequence
- Defeating a specific mitigation set (ASLR, NX/DEP, canary, PIE, RELRO) on a lab or CTF target
- Working an authorized binary-exploitation task or a CTF pwn challenge
When NOT to Use
- Recovering what the binary does — disassembly, decompilation, algorithm
recovery — is
analyzing-binaries; do that first if the bug is not yet understood. - Unpacking or de-virtualizing a protected binary before you can even see
the code — use
unpacking-protected-binaries. - Web, deserialization, or injection bugs — those are their own skills
(
testing-web-applications,exploiting-deserialization); this skill is native memory corruption only. - Kernel/driver exploitation specifically — the primitives differ enough (no libc, SMEP/SMAP/KASLR, syscall context) that it is out of scope here; the userland method still informs it.
- Fuzzing to find the bug — that is a discovery step; this skill starts once you have a crash.
Enumerate the Mitigations First
The exploit you can build is dictated by what is turned on. Read them before
planning anything (checksec, or pwntools' checksec/ELF):
| Mitigation | What it blocks | The usual answer |
|---|---|---|
| NX / DEP | Executing your shellcode on the stack/heap | ROP / ret2libc — reuse existing executable code |
| ASLR | Hardcoding addresses | An info leak to recover a base, then compute offsets |
| Stack canary | Naive stack-return overwrite | Leak the canary, overwrite something else, or brute a forking server |
| PIE | Hardcoding the binary's own addresses | Leak a binary address; until then only relative/partial overwrites |
| Partial RELRO | Little — GOT is still writable | GOT overwrite is on the table |
| Full RELRO | GOT overwrite | Target __malloc_hook/__free_hook (pre-2.34), or a ROP-only path |
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 194 lines · 118 tokens per session scan A 73f929f48fc6
exploiting-memory-corruption is a skill published in the GitHub repository trilwu/secskills (134 stars, last pushed yesterday), licensed MIT. It adds 118 tokens to every session and 2,533 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other skills, from other repositories
performance-optimization
Optimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks.
gke-ai-troubleshooting-jobset-interruption
Diagnoses GKE JobSet interruptions, restarts, and preemptions for AI/ML training workloads autonomously. Use when troubleshooting JobSet restart loops, spot VM preemptions, node readiness failures, host VM issues, or coordinator worker crashes. Don't use for general GKE cluster creation, basic workload deployment, or…
gke-node-notready
Diagnoses GKE nodes reporting NotReady or Unknown status by inspecting node conditions, events, kubelet/containerd logs, and node metrics, then proposing safe remediations. Use when nodes show NotReady, when the kubelet stops posting node status, or when workloads are evicted or stuck Pending due to node health. Don't…
gke-ai-troubleshooting-tpu-dynamic-slices-monitoring
Monitors, troubleshoots, and manages GKE TPU Dynamic Slices custom resources. Use when checking TPU slice lifecycle states, troubleshooting slice provisioning failures, validating single-slice or multi-slice (JobSet) workload manifests, or safely patching stuck finalizers and disabling the slice controller. Don't use…
gke-ai-troubleshooting-tpu-vbar-oom
Diagnoses and prevents vbarcontrolagent segfaults, out-of-memory (OOM) errors, and TPU device initialization failures on TPU v6e nodes in GKE caused by race conditions during TPU device resets or high-frequency metrics polling. Use when troubleshooting vbarcontrolagent crashes, memory cgroup OOMs in serial console…
systematic-debugging
Skill "systematic-debugging" from jnMetaCode/superpowers-zh, covering 系统化调试, 概述, 铁律, 何时使用 and 四个阶段.