skills/binary-exploitation/libc-heap/house-of-force/SKILL.md
How to perform House of Force heap exploitation attacks. Use this skill whenever the user mentions heap exploitation, House of Force, top chunk manipulation, arbitrary memory allocation, malloc manipulation, or wants to allocate chunks at specific addresses. Also trigger for CTF challenges involving heap overflows, top chunk size overwrites, or when the user needs to calculate evil_size for heap attacks. Make sure to use this skill for any binary exploitation task involving glibc heap manipulation, even if they don't explicitly say "House of Force".
npx skillsauth add abelrguezr/hacktricks-skills house-of-force-exploitInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
A heap exploitation technique that allows allocating a chunk at a specific address by manipulating the top chunk size.
Use House of Force when:
-1 or 0xffffffffffffffff)Overwrite the top chunk size with -1 (or p64(0xffffffffffffffff) in Python). This ensures malloc won't use mmap for any allocation since the top chunk will always appear to have enough space.
# Example: overwrite top chunk size with -1
payload = b'A' * offset_to_top_chunk_size + p64(0xffffffffffffffff)
Calculate the allocation size needed to move the top chunk to your target address:
evil_size = target_address - current_top_chunk_address - 4 * sizeof(long)
Why 4 longs?
Python calculation:
from pwn import *
evil_size = target_addr - top_chunk_addr - 4 * 8 # 8 bytes per long on 64-bit
Perform a malloc with the calculated evil_size. This moves the top chunk to the target address.
io.recvuntil(b'prompt>')
io.sendline(str(evil_size).encode())
Perform another malloc to get a chunk at the target address. Now you can write to that address.
io.recvuntil(b'prompt>')
io.sendline(b'/bin/sh') # or whatever payload you need
Goal: Redirect function calls to your code
-1system)Goal: Modify a function pointer to point to ret2win
-1Goal: Overwrite __free_hook to call system
-1__free_hook__free_hook addresssystem address/bin/shUse scripts/calculate_evil_size.py to compute the evil_size for your attack:
python scripts/calculate_evil_size.py --target 0x404000 --top-chunk 0x602000
malloc(): corrupted top size error in newer versions. Works on glibc < 2.26 or with specific conditions.p64(0xffffffffffffffff) for -1heap commands or vmmap to find the top chunk-1testing
How to perform a House of Lore (small bin attack) heap exploitation. Use this skill whenever the user mentions heap exploitation, small bin attacks, fake chunks, glibc heap vulnerabilities, or needs to insert fake chunks into small bins for arbitrary read/write. Trigger for CTF challenges involving heap corruption, glibc 2.31+ exploitation, or when the user needs to bypass malloc sanity checks using fake chunk linking.
tools
How to perform House of Einherjar heap exploitation to allocate memory at arbitrary addresses. Use this skill whenever the user mentions heap exploitation, glibc heap attacks, arbitrary memory allocation, off-by-one overflow exploitation, tcache poisoning, fast bin attacks, or any CTF challenge involving heap manipulation. This is essential for binary exploitation tasks where you need to control malloc() return addresses.
testing
How to identify, analyze, and exploit heap overflow vulnerabilities in binary exploitation challenges and real-world scenarios. Use this skill whenever the user mentions heap overflows, memory corruption, heap grooming, tcache poisoning, fast-bin attacks, or any heap-related vulnerability in CTF challenges, binary analysis, or security research. This skill covers heap overflow fundamentals, exploitation techniques, heap grooming strategies, and real-world CVE analysis.
testing
How to analyze and exploit the unlink operation in glibc heap management. Use this skill whenever the user mentions heap exploitation, unlink attacks, glibc malloc, heap chunks, double-linked lists, heap leaks, libc leaks, or any CTF challenge involving heap memory corruption. This skill helps understand the unlink mechanism, security checks, and how to leak addresses from unlinked chunks.