skills/binary-exploitation/common-binary-protections-and-bypasses/cet-and-shadow-stack/SKILL.md
Control Flow Enforcement Technology (CET) and Shadow Stack analysis for binary exploitation. Use this skill whenever the user mentions CET, shadow stack, control flow integrity, ROP/JOP attacks, binary security protections, or needs to understand how modern CPU features prevent control-flow hijacking. Trigger for security research, binary analysis, exploitation learning, or when discussing hardware-level security mitigations.
npx skillsauth add abelrguezr/hacktricks-skills cet-shadow-stackInstall 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 skill for understanding and analyzing Control Flow Enforcement Technology (CET) and Shadow Stack security features in binary exploitation contexts.
CET is a hardware-level security feature designed to prevent control-flow hijacking attacks like Return-Oriented Programming (ROP) and Jump-Oriented Programming (JOP).
Two main components:
Indirect Branch Tracking (IBT)
Shadow Stack
The shadow stack is a dedicated stack used solely for storing return addresses.
Key properties:
Protection mechanism:
ROP and JOP attacks work by:
How CET stops these attacks:
| Attack Vector | CET Countermeasure | |--------------|-------------------| | Arbitrary gadget execution | IBT requires explicit target markers | | Return address overwrite | Shadow stack detects discrepancies | | Control flow hijacking | Hardware-level validation blocks invalid branches |
When analyzing a binary, look for these indicators:
ELF headers and sections:
.note.gnu.property section for CET flagsCommand-line tools:
# Check for CET support
readelf -n binary | grep -i cet
# Look for ENDBRANCH instructions
objdump -d binary | grep -i endbranch
# Check binary properties
readelf -p binary | grep -i property
What CET protects:
What CET does NOT protect:
When analyzing CET-protected targets:
First, verify CET is actually enabled
Understand the attack surface
Consider bypass scenarios
CET is Intel's Control Flow Enforcement Technology, a hardware security feature that prevents control-flow hijacking attacks through Indirect Branch Tracking and Shadow Stack mechanisms.
The shadow stack is a protected, CPU-managed stack that stores only return addresses. It's separate from the regular stack and cannot be accessed or modified by normal program instructions.
CET significantly raises the bar for exploitation but isn't invulnerable. Bypasses typically require:
Yes. CET provides strong protection against common exploitation techniques with minimal performance overhead. Enable it via compiler flags (-fcf-protection=full for GCC/Clang).
CET works alongside other security features:
| Protection | What It Does | Works With CET? | |------------|-------------|-----------------| | ASLR | Randomizes memory addresses | ✅ Yes | | DEP/NX | Marks memory as non-executable | ✅ Yes | | Stack Canaries | Detects stack buffer overflows | ✅ Yes | | PIE | Position-independent executable | ✅ Yes |
When to use this skill:
Key references:
CET Components:
Attack Prevention:
Analysis Commands:
readelf -n binary - Check CET propertiesobjdump -d binary | grep endbranch - Find ENDBRANCH instructionschecksec --file=binary - View all protectionsRemember: CET is a powerful defense but not a silver bullet. Always consider the full security context and look for vulnerabilities that don't rely on control flow hijacking.
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.