exploiting-memory-corruption

exploiting-memory-corruption is a skill for Claude Code from trilwu/secskills. It costs 118 tokens per session (2,533 once invoked), scanned A, original, MIT.

A binary-exploitation guide for turning memory-corruption bugs in native programs into controlled behavior. It covers overflows, use-after-free bugs, type confusion, and defenses such as ASLR and stack canaries.

In plain words
What is it for?
Use it on authorized binaries or capture-the-flag challenges to build exploits, create ROP or JOP chains, and assess stack or heap vulnerabilities.
Why use it?
It helps determine whether a crash is exploitable and whether a program's built-in protections prevent or limit code execution.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the secskills-offense plugin — 40 skills shipped together

Install

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.

agentmods
npx agentmods add skills/trilwu/secskills/exploiting-memory-corruption
Any agent
npx skills add trilwu/secskills --skill exploiting-memory-corruption
Clone the repo
git clone --depth 1 https://github.com/trilwu/secskills

Made for: Claude Code.

Or install secskills-offense, the plugin that ships this one along with the rest of its 40 skills.

Wrote 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.

agentmods badge for exploiting-memory-corruption

README.md
[![agentmods](https://agentmods.dev/badge/skills/trilwu/secskills/exploiting-memory-corruption.svg)](https://agentmods.dev/skills/trilwu/secskills/exploiting-memory-corruption)
Your own site
<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>
Per session 118 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,533 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 2d ago against content hash 73f929f48fc6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

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.

secskills-offense/skills/exploiting-memory-corruption/SKILL.md · 194 lines

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

Read the full file on GitHub · 194 lines

Changes

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.

  1. 2d ago First seen · 194 lines · 118 tokens per session scan A 73f929f48fc6

Subscribe to this mod's changes

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.

Related

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.

addyosmani/agent-skills · 59 tokens

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…

google/skills · 83 tokens

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…

google/skills · 112 tokens

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…

google/skills · 107 tokens

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…

google/skills · 125 tokens

systematic-debugging

Skill "systematic-debugging" from jnMetaCode/superpowers-zh, covering 系统化调试, 概述, 铁律, 何时使用 and 四个阶段.

jnMetaCode/superpowers-zh · 24 tokens