skills/binary-exploitation/common-binary-protections-and-bypasses/common-binary-protections-and-bypasses/SKILL.md
How to enable and analyze core dump files for binary exploitation debugging and crash analysis. Use this skill whenever the user mentions core dumps, crash analysis, GDB debugging, binary exploitation, reverse engineering, or needs to investigate why a program crashed. Make sure to use this skill when working with CTF challenges, security research, or any situation where understanding a program's crash state is important.
npx skillsauth add abelrguezr/hacktricks-skills binary-exploitation-core-dumpsInstall 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.
This skill helps you enable core dump generation and analyze crash dumps using GDB for binary exploitation and debugging.
Core files are memory snapshots created when a process crashes. They capture:
This is invaluable for understanding why a program crashed and where in the code the crash occurred.
ulimit -c unlimited
This allows unlimited core file size for the current shell session. Note: This is not persistent across reboots or new terminal sessions.
ulimit -c
If it returns unlimited or a large number, core dumps are enabled. If it returns 0, they're disabled.
To make core dumps permanent across reboots:
/etc/security/limits.conf* soft core unlimited
Core files are typically saved in:
/var/crash/ (systemd-based systems)/proc/sys/kernel/core_patternCheck the pattern:
cat /proc/sys/kernel/core_pattern
gdb /path/to/executable /path/to/core_file
This loads both the executable and the crash snapshot into GDB.
Once in GDB:
# See where the crash occurred
bt
# or
bt full
# Examine the instruction that caused the crash
x/10i $pc
# or
x/10i $rip
# View register values
info registers
# Examine the stack
x/20gx $sp
# or
x/20gx $rsp
# Look at specific memory addresses
x/16wx 0x7fffffffe000
# Examine variables (if debug symbols exist)
print variable_name
# Disassemble the current function
disas
# Set a breakpoint and continue (if you want to step through)
break function_name
continue
# Check what address caused the fault
info registers
# Look at rdi, rsi, rdx, rax for potential pointers
# Examine the faulting address
x/4wx $rdi # or whichever register held the bad pointer
# Check stack pointer vs base pointer
info registers
# Look at $rsp and $rbp
# Examine stack contents
x/50gx $rsp
# Look for overwritten return addresses
x/20gx $rsp
# Check if canary was overwritten (if ASLR/stack canary enabled)
info registers
# Look for 0x0000000000000000 in stack (canary failure)
ulimit -c unlimited
./vulnerable_program
# or with input
./vulnerable_program < input.txt
# or with arguments
./vulnerable_program arg1 arg2
# Find core files in current directory
ls -la core*
# Or search system-wide
find / -name "core*" -type f 2>/dev/null
gdb ./vulnerable_program core
Then run the essential commands above to understand the crash.
ulimit -c - it might be 0/proc/sys/kernel/core_pattern - might be redirecting to a different location-g flag: gcc -g program.c -o programstrip to check if symbols were removedgdb directly instead: gdb ./program# Enable core dumps
ulimit -c unlimited
# Run the vulnerable program with overflow input
python3 -c "print('A'*1000)" | ./vulnerable_program
# Find and analyze the core
ls -la core*
gdb ./vulnerable_program core
# In GDB:
(gdb) bt
# Shows: #0 0x00007ffff7a23456 in __libc_start_main ()
# #1 0x0000555555555123 in main ()
(gdb) x/20gx $rsp
# Shows stack contents - look for 'AAAA' patterns
(gdb) info registers
# Check if return address was overwritten
Use this skill when:
testing
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.
testing
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".
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.