用途:面向 glibc/ptmalloc2 堆漏洞的利用手册,帮助在 CTF 或真实场景中针对 UAF、double free、堆溢出、off-by-one/null 等漏洞选择并实施攻击链。
主要能力:讲解 malloc_chunk 布局与 PREV_INUSE/IS_MMAPPED/NON_MAIN_ARENA 标志;梳理 tcache、fastbin、unsortedbin、smallbin、largebin 的结构与 LIFO/FIFO 行为;介绍 main_arena、mp_、tcache_perthread_struct 等全局结构;给出 libc 基址泄露(unsortedbin/smallbin fd/bk、stdout FILE)与堆基址泄露(tcache fd、fastbin fd、UAF 读)方法;按 glibc 版本整理攻击:<2.26 的 fastbin dup、unsortedbin attack、unlink、House of Force/Spirit;2.26–2.28 的 tcache poisoning/dup;2.29–2.31 的 tcache key 绕过与 House of Botcake;2.32–2.33 的 safe-linking(PROTECT_PTR)编解码;≥2.34 因 hook 移除转向 _IO_FILE、exit_funcs、TLS_dtor_list 等目标。
使用方式:结合 pwndbg 的 heap、bins、tcachebins、fastbins、unsortedbin、vis_heap_chunks、find_fake_fast 等命令检查堆;参考 how2heap(git clone https://github.com/shellphish/how2heap)与 heapinspect(pip install heapinspect);用 pwntools 读取 libc 符号。safe-linking 解码为 real_fd = fd_stored ^ (chunk_addr >> 12),编码为 fd_stored = (chunk_addr >> 12) ^ target_addr。
适用场景:堆漏洞利用学习与实战,需按目标 glibc 版本选择手法。
限制:资料未提供具体平台、收费或效果信息;技术细节依赖目标版本与保护机制,需自行验证。