Back to Skills

arbitrary-write-to-rce

Arbitrary write to RCE playbook. Use when you have an arbitrary write primitive (from heap exploitation, format string, or OOB write) and need to convert it into code execution by targeting GOT, hooks, _IO_FILE vtable, exit_funcs, TLS_dtor_list, modprobe_path, .fini_array, or C++ vtables.

1,297stars177forksUpdated 7/7/2026

Security Assessment

Safe(100/100)
Security Score100/100

About arbitrary-write-to-rce

A binary-exploitation playbook for the 'last mile' of an exploit: converting an arbitrary write primitive, obtained from heap exploitation, a format string bug, or an out-of-bounds write, into code execution. It catalogs the major overwrite targets and, critically, organizes them by glibc version compatibility so an operator can pick a target that still exists in the runtime being attacked. Targets include GOT entries, the legacy malloc/free/realloc hooks (removed in glibc 2.34), the _IO_FILE vtable, __exit_funcs, TLS_dtor_list, _dl_fini/link_map, the kernel's modprobe_path, .fini_array, C++ vtables, and setcontext gadgets.

Each target is described with its requirements and trigger. GOT overwrites need Partial RELRO and list common function-pointer swaps (for example replacing free, printf, or strlen with system). The hook sections show one_gadget and system overwrites plus the realloc trick for satisfying one_gadget register and stack constraints. Later sections cover FILE-structure exploitation across glibc versions (direct vtable, _IO_str_jumps, _IO_wfile_jumps, House of Cat) and the pointer-mangling requirements for __exit_funcs and TLS_dtor_list, including how the stored pointer is rotated and XORed with the pointer guard and how to work around it when the guard can also be overwritten.

Reach for this material after you already have a write-what-where primitive and need to decide where to aim it given the target's protections and glibc version. It highlights mistakes base models commonly make, such as targeting hooks that no longer exist after glibc 2.34 or forgetting pointer-mangling requirements, and pairs the version table with concrete pwntools-style snippets. The routing section connects it to related skills for obtaining the write in the first place (heap exploitation, format-string exploitation, stack overflow and ROP) and for reasoning about which targets are available under a given binary-protection configuration. The content is intended for authorized exploitation practice such as CTFs and security research.

FAQ

What do I need before using this skill?

An existing arbitrary write primitive, from heap exploitation, a format string bug, or an out-of-bounds write, that you want to turn into code execution.

Why does it organize targets by glibc version?

Because target availability changes across versions; for example __malloc_hook, __free_hook, and __realloc_hook were removed in glibc 2.34, and it flags post-2.34 alternatives like TLS_dtor_list.

What does a GOT overwrite require?

Partial RELRO so that .got.plt is writable; Full RELRO blocks it entirely. Common swaps include overwriting free, printf, strlen, or atoi with system.

How does it handle pointer mangling?

For __exit_funcs and TLS_dtor_list it explains that function pointers are mangled by rotating and XORing with the pointer guard, and shows how to compute the mangled value or bypass it if the guard itself can be overwritten.

Is this for real-world attacks?

It is written for authorized exploitation contexts such as CTF challenges and security research, describing techniques factually.

Install arbitrary-write-to-rce

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill