Lab: FlagYard Lab 5 (PWN) · Points: 150
A phone-book binary with a Use-After-Free in the delete path. Free chunks go into
tcache unsorted, and the pointer is not nulled. We poison a tcache fd to redirect
allocation to __free_hook, write system there, and trigger it with "/bin/sh".
After delete_contact(), the chunk is freed but the global pointer array still
holds the address. A second free of the same index double-frees into tcache.
__free_hook - 0x10.__free_hook; write system."/bin/sh" in a chunk, free it → system("/bin/sh").from pwn import *
context.arch = "amd64"
# ... (full script in repo /home/kali/fy_challenges)
FlagY{062364abc9ade43694ea98da4ecf0f89} — submitted, +150.
Never trust a free list after free() without nulling the source pointer.
tcache poisoning is the fastest path to __free_hook on glibc 2.27–2.31.