zyrexnn/cybermes/arbitrary-write-to-rce
Claude Code and agent skill by zyrexnn/cybermes
- community
Checking that the SKILL.md file is still in the repository.
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.
Install
npx vskill@latest install zyrexnn/cybermes/arbitrary-write-to-rceSKILL.md
The same SKILL.md was published earlier as zyrexnn/cybermes/arbitrary-write-to-rce.
SKILL: Arbitrary Write to Code Execution — Expert Attack Playbook
AI LOAD INSTRUCTION: Expert techniques for converting an arbitrary write primitive into code execution. Covers every major overwrite target organized by glibc version compatibility: GOT, __malloc_hook, __free_hook, _IO_FILE vtable, __exit_funcs, TLS_dtor_list, _dl_fini, modprobe_path, .fini_array, C++ vtable, and setcontext gadget. This is the "last mile" skill. Base models often target hooks that no longer exist (post-glibc 2.34) or miss pointer mangling requirements.
0. RELATED ROUTING
- heap-exploitation — obtaining the arbitrary write via heap attacks
- format-string-exploitation — obtaining the arbitrary write via %n
- stack-overflow-and-rop — stack-based write primitives
- binary-protection-bypass — which targets are available given protection configuration
- heap-exploitation IO_FILE_EXPLOITATION.md — deep _IO_FILE structure exploitation
1. TARGET SELECTION BY GLIBC VERSION
| Target | glibc < 2.24 | 2.24–2.33 | ≥ 2.34 | Required Knowledge | |
|---|---|---|---|---|---|
| GOT overwrite | OK (Partial RELRO) | OK (Partial RELRO) | OK (Partial RELRO) | Binary base | |
__malloc_hook | OK | OK | Removed | libc base | |
__free_hook | OK | OK | Removed | libc base | |
__realloc_hook | OK | OK | Removed | libc base | |
_IO_FILE vtable (direct) | OK | Vtable range check | Vtable range check | libc base + heap | |
_IO_FILE via _IO_str_jumps | N/A | OK (2.24–2.27) | Patched | libc base + heap | |
_IO_FILE via _IO_wfile_jumps | N/A | OK (≥ 2.28) | OK | libc base + heap | |
__exit_funcs | OK | OK | OK | libc base + pointer guard | |
TLS_dtor_list | N/A | N/A | OK | TLS addr + pointer guard | |
_dl_fini / link_map | OK | OK | OK | ld.so base | |
modprobe_path (kernel) | OK | OK | OK | Kernel base | |
.fini_array | OK | OK | OK | Binary base (if writable) | |
| C++ vtable | OK | OK | OK | Object address + heap | |
setcontext gadget | OK | OK (changed in 2.29) | OK | libc base | |
| Stack return address | Always | Always | Always | Stack address |
2. GOT OVERWRITE
Replace a function pointer in the Global Offset Table.
Requirements
- Partial RELRO (
.got.pltwritable) — Full RELRO blocks this entirely
Common Targets
| Overwrite From | Overwrite To | Trigger | |
|---|---|---|---|
printf@GOT | system | Next printf(user_input) with input = /bin/sh | |
free@GOT | system | Next free(ptr) where ptr points to "/bin/sh" | |
strlen@GOT | system | Next strlen(user_input) | |
atoi@GOT | system | Next atoi(user_input) with input = "sh" | |
puts@GOT | system | Next puts(user_input) | |
exit@GOT | main or gadget | Create loop for multi-shot exploit | |
__stack_chk_fail@GOT | ret gadget | Neutralize canary check |
3. __malloc_hook / __free_hook (glibc < 2.34)
__malloc_hook
__free_hook
Realloc Trick for one_gadget Constraints
4. _IO_FILE VTABLE
See IO_FILE_EXPLOITATION.md for full details.
Quick Summary by Version
| glibc | Method | Vtable Target | |
|---|---|---|---|
| < 2.24 | Direct vtable overwrite | Point vtable to fake table with system at __overflow offset | |
| 2.24–2.27 | _IO_str_jumps | Within valid range; _IO_str_finish calls _s._free_buffer | |
| ≥ 2.28 | _IO_wfile_jumps | Wide-char path: _wide_data->_wide_vtable not range-checked | |
| ≥ 2.35 | House of Cat | _IO_wfile_seekoff → _IO_switch_to_wget_mode → fake wide vtable call |
FSOP Trigger
5. __exit_funcs / __atexit
Exploitation
Without Pointer Guard Knowledge
If you can overwrite both the function pointer AND the pointer guard (in TLS at fs:[0x30]):
- Set pointer guard to 0
- Set function pointer to
ROL(target, 0x11) - Demangling:
ROR(stored, 0x11) ^ 0 = ROR(ROL(target, 0x11), 0x11) = target
6. TLS_dtor_list (glibc ≥ 2.34)
Thread-local destructor list — the primary post-2.34 target.
Location
Exploitation
7. _dl_fini / LINK_MAP CORRUPTION
Attack Vector
During exit(), _dl_fini iterates the link_map list and calls DT_FINI_ARRAY entries.
Exploitation
- Corrupt a
link_mapentry'sl_addr(relocation base) to shift the FINI_ARRAY pointer - Or corrupt
l_info[DT_FINI_ARRAY]to point to fake array - Fake array contains target function pointer (system, one_gadget)
- Trigger:
exit()→_dl_fini→ calls fake destructor
Advantage: No pointer mangling (function pointers in FINI_ARRAY are not mangled).
8. modprobe_path (KERNEL)
Overwrite the kernel's `modprobe_path` to execute arbitrary commands as root.
See kernel-exploitation for kernel write primitives.
9. .fini_array
Overwrite destructor function pointers called during normal program exit.
Limitation: .fini_array may be read-only in Full RELRO binaries.
10. C++ VTABLE OVERWRITE
11. setcontext GADGET
setcontext in libc loads registers from a ucontext_t structure — useful as a pivot gadget.
glibc < 2.29
glibc ≥ 2.29
12. DECISION TREE
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/arbitrary-write-to-rce/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/zyrexnn/cybermes/arbitrary-write-to-rce)