skills/binary-exploitation/arbitrary-write-2-exec/aw2exec-got-plt/SKILL.md
How to exploit GOT/PLT vulnerabilities in binary exploitation challenges. Use this skill whenever the user mentions GOT overwrites, PLT hijacking, arbitrary write to GOT, libc GOT exploitation, free2system, strlen2system, or any binary exploitation task involving dynamic linking vulnerabilities. Make sure to use this skill for CTF pwn challenges, binary analysis, or when working with dynamically linked binaries that have partial RELRO.
npx skillsauth add abelrguezr/hacktricks-skills got-plt-exploitationInstall 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 exploit Global Offset Table (GOT) and Procedure Linkage Table (PLT) vulnerabilities in dynamically linked binaries to achieve arbitrary code execution.
Key insight: GOT entries are writable (with partial RELRO), making them targets for exploitation.
First, determine if GOT exploitation is possible:
# Check RELRO status
readelf -l ./binary | grep -i relro
# or
checksec --file=./binary
# Get GOT section address
objdump -s -j .got ./binary
# In GEF/pwndbg, examine GOT
gef➤ x/20x 0xADDR_GOT
# Or use GEF's built-in command
gef➤ got
# List PLT entries
objdump -j .plt -d ./binary
# Find specific function PLT address
objdump -j .plt -d ./binary | grep system
Select a function to overwrite in GOT:
Ideal candidates:
free, strlen, printf, puts, getsIf system is in PLT:
system PLT address/bin/shIf system is NOT in PLT:
system address from libcsystem addressWhen to use: Heap vulnerabilities where you can control chunk content and overwrite GOT.
Steps:
free GOT entry with system address/bin/sh\x00 into a heap chunkfree() on that chunksystem("/bin/sh") executesExample:
# Overwrite free GOT with system
payload = p64(system_addr)
# Write /bin/sh in chunk
payload += b'/bin/sh\x00'
# Trigger free on that chunk
When to use: Binary calls strlen or puts with user input.
Steps:
strlen GOT entry with system address/bin/sh as inputstrlen is called, it executes system("/bin/sh")Why it works: puts internally calls strlen with the same argument.
When to use: Fastbin heap vulnerabilities.
Steps:
free) in GOTsystem/bin/sh# Check protections
checksec --file=./binary
# View GOT section
objdump -s -j .got ./binary
# View PLT section
objdump -j .plt -d ./binary
# Find symbol addresses
nm ./binary | grep system
readelf -s ./binary | grep system
# Start debugging
gdb ./binary
# View GOT table
gef➤ got
# Examine GOT at address
gef➤ x/20x 0xADDR
# Set breakpoint on function
gef➤ break function_name
# Continue execution
gef➤ continue
# Find one-gadget RCE payloads
one_gadget /lib/x86_64-linux-gnu/libc.so.6
# Filter for specific constraints
one_gadget /lib/x86_64-linux-gnu/libc.so.6 --no-fd
Before attempting GOT exploitation, verify:
system, either it's in PLT or you can leak libc addressAfter GOT exploitation:
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.