offensive-windows-mitigations

Analyzes Windows exploit mitigations like ASLR, DEP, CFG, and CET with detection and bypass techniques.

Updated Sep 23, 2026
One-click install
npx skills add https://github.com/ehadziabdic/WAgents --skill offensive-windows-mitigations-ehadziabdic
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: offensive-windows-mitigations
Source: https://github.com/ehadziabdic/WAgents/tree/main/opencode/skills/offensive-windows-mitigations
Command: npx skills add https://github.com/ehadziabdic/WAgents --skill offensive-windows-mitigations-ehadziabdic

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Security researchers and exploit developers need to understand how Windows defensive mechanisms (ASLR, DEP/NX, CFG, CET, SEHOP, heap guards, ACG) work, how to detect them on target binaries, and why exploits fail against protected systems. This Skill provides a structured methodology for auditing, testing, and reasoning about these mitigations. ## Core Features & Use Cases - Mitigation Identification: Maps crash dump exception codes (0xC0000005, 0xC0000409, 0xC0000407) to the specific mitigation that terminated the process, using WinDbg analysis. - Controlled Lab Testing: Provides compiler/linker flag references (/NXCOMPAT, /DYNAMICBASE, /GS, /guard:cf, /CETCOMPAT) and vulnerable test binaries to verify each mitigation in isolation. - Bypass Strategy Research: Documents how ASLR breaks fixed-address ROP chains and prepares researchers for advanced bypass study. - Use Case: A researcher analyzing why a Week 5 stack overflow exploit fails on a hardened Windows 11 binary can use this Skill to compile graduated test targets, trigger /GS cookie checks, and confirm via WinDbg which mitigation blocked execution. ## Quick Start Ask the AI to explain how CFG and CET shadow stacks block indirect calls and how to verify them on a compiled Windows binary using dumpbin and WinDbg.

Frequently Asked Questions about offensive-windows-mitigations

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check which exploit mitigations a Windows binary has enabled?▼

Use dumpbin /headers to inspect PE flags for NX compatibility, Dynamic base (ASLR), and High Entropy VA. Stack cookies (/GS) do not appear in headers, so check disassembly for __security_cookie references. PowerShell's Get-ProcessMitigation audits per-binary and system-wide settings.

What is the difference between DEP, ASLR, CFG, and CET in Windows?▼

DEP/NX prevents executing code from data pages, ASLR randomizes module and stack addresses, CFG validates indirect call targets, and CET shadow stacks enforce return address integrity in hardware. Each blocks a different stage of exploitation and they are typically layered together.

How do I identify which mitigation caused a crash from a dump file?▼

Open the dump in WinDbg and run !analyze -v to read the exception code. 0xC0000005 with parameter 8 indicates DEP, 0xC0000409 subcode 2 indicates /GS cookie corruption, subcode 10 indicates CFG failure, and 0xC0000407 indicates a CET shadow stack mismatch.

Why does my ROP exploit work on one binary but fail after enabling ASLR?▼

ASLR randomizes the binary's load base each run, so gadgets at fixed addresses like 0x140001078 become invalid pointers. The exploit succeeds only against binaries compiled with /DYNAMICBASE:NO /FIXED, and even then system DLL addresses change after reboot.

Does MSVC always add stack cookies to functions with buffers?▼

No, MSVC uses heuristics and may skip /GS protection for simple loops. Patterns like fgets with a size larger than the destination buffer or strcpy into local arrays reliably trigger cookie insertion. Verify by disassembling and looking for the __security_cookie load pattern.