Skip to content

0x1BE/OSEE-Prep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 

Repository files navigation

OSEE / EXP-401: Advanced Windows Exploitation

Self-Study Preparation Guide


This is an independent, community-built prep guide for the OSEE (EXP-401) certification. Not affiliated with or endorsed by Offensive Security. Every resource linked here is free and publicly available.



Table of Contents


📌 Official References

OffSec Links

Resource Link
EXP-401 Course Page offsec.com
OSEE Exam Guide help.offsec.com
EXP-401 Syllabus PDF appliedtechnologyacademy.com

Community Prep Repos

These are the best community resources that already exist. Start here before anything else.

Course Reviews Worth Reading


Module 1 - Prerequisites, Tools and Environment

Before you write a single line of shellcode, make sure these fundamentals are solid. The course assumes you already know x64 assembly, Windows internals, the PE format, and can navigate a debugger comfortably.

1.1 Required Reading

1.2 Tools You Will Use Every Day

Tool What it's for Link
WinDbg Preview Primary kernel and user-mode debugger Microsoft Store
IDA Pro Freeware Disassembler and decompiler hex-rays.com
Ghidra Free RE tool from NSA ghidra-sre.org
x64dbg Open-source user-mode debugger x64dbg.com
rp++ ROP gadget finder GitHub
Ropper ROP chain builder GitHub
ROPgadget Python ROP gadget tool GitHub
mona.py Exploit dev plugin for Immunity/WinDbg GitHub
Process Hacker Process and memory inspector processhacker.sourceforge.io
HEVD Intentionally vulnerable kernel driver GitHub
Sickle Shellcode and opcode generation GitHub

1.3 Setting Up Kernel Debugging

You need two VMs talking to each other over serial or KDNET. One is your debugger, one is your target. Get this working before anything else in Module 5.


Module 2 - Custom Shellcode Creation

This module is about writing shellcode that works anywhere, without hardcoded addresses or assumptions about the target environment. You need to understand PIC, PEB walking, and how to resolve Win32 APIs at runtime.

2.1 64-bit Architecture

The jump from 32-bit to 64-bit changes a lot: register widths, calling conventions, shadow space, RSP alignment requirements, and how the PEB is accessed.

2.2 Position-Independent Code and PEB Walking

Every shellcode starts the same way: find kernel32.dll without any hardcoded base address. You do this by walking the PEB, parsing the export table, and resolving functions by hash. This is the foundation.

2.3 Building a Shellcode Framework

Once you can resolve APIs, the next step is packaging everything into a reusable framework: find the base, walk the export table, resolve functions by hash, then run whatever payload you want.

2.4 Writing a Reverse Shell

The end goal of most shellcode: connect back to your machine over TCP and drop a shell. Write this from scratch in PIC assembly or PIC C. Do not use msfvenom for this exercise.

2.5 Visual Studio for Exploit Development

Use Visual Studio to write and compile shellcode in C, then extract raw opcodes from the Release build. You need to disable /GS, runtime checks, and optimizations that break PIC code.


Module 3 - VMware Workstation Guest-to-Host Escape

CVE-2017-4901 | Use-After-Free in the Drag-and-Drop RPCI mechanism

This is the hardest module in the course. You are exploiting a use-after-free in vmware-vmx.exe and chaining it with heap grooming, ASLR bypass, a ROP chain, and shellcode execution to break out of the VM entirely. Every technique from Module 2 gets used here.

3.1 Vulnerability Overview

3.2 VMware Internals

You need to understand how the backdoor I/O port works, what RPCI is, and how the DnD (drag-and-drop) subsystem interacts with vmware-vmx.exe on the host.

3.3 DEP Theory and Bypass

DEP marks memory pages as non-executable. The standard bypass is a ROP chain that calls VirtualProtect to flip the execute bit, then jumps to your shellcode.

3.4 Return-Oriented Programming

ROP is how you bypass DEP. You chain together small instruction sequences already present in loaded modules, each ending in a ret, to build a fake call stack that does what you want.

3.5 ASLR Bypass

ASLR randomizes base addresses. You defeat it through info leaks, finding non-ASLR modules, heap spraying, or partial overwrites depending on what the target gives you.

3.6 Windows Heap Internals

Before you can groom the heap you need to understand it. How the allocator works, what a chunk looks like, how the free lists are managed, and where your data lands after each alloc and free.

3.7 Low Fragmentation Heap

The LFH is the front-end allocator that handles commonly-sized objects. Exploiting bugs near LFH-managed memory means you need to control which bucket your allocation lands in and what neighbors it.

3.8 Use-After-Free Case Studies

UAF is the bug class behind both the VMware and Edge exploits. You free an object, control what gets allocated in its place, and then trigger the stale pointer to corrupt that new object.

3.9 Stack Pivoting

When your overflow does not land on a stack you control, you use a stack pivot gadget to redirect RSP to attacker-controlled memory where you have already staged your ROP chain.

3.10 Windows Defender Exploit Guard

The host process vmware-vmx.exe has WDEG mitigations enabled including ROP mitigations, export address filtering, and import address filtering. You need to understand what each one does before you can bypass them.


Module 4 - Microsoft Edge Type Confusion

CVE-2019-0567 | Type Confusion in the Chakra JavaScript Engine

Three-stage exploit chain. Stage 1 gets a read/write primitive in the renderer. Stage 2 defeats CFG and ACG. Stage 3 escapes the AppContainer sandbox. Each stage builds on the last and all of them are defeated by techniques unique to modern browsers.

4.1 Chakra Internals

You need to understand how ChakraCore represents JavaScript objects, how the JIT compiler works, what auxSlots are, how NaN boxing works, and the difference between inline and auxiliary property storage.

4.2 Root Cause Analysis

InitProto is incorrectly marked side-effect-free by the JIT. When this assumption is violated during a type transition, the optimizer corrupts the auxSlots pointer, giving you a type confusion.

4.3 Building the Read/Write Primitive

Corrupt the auxSlots pointer to point to a second object. Use two DataView instances to turn the type confusion into a stable arbitrary read and write primitive. NaN boxing lets you read 64-bit pointers correctly.

4.4 Controlling RIP

Use your read/write primitive to leak a vtable pointer, calculate module offsets, and then overwrite the vtable to redirect execution into your ROP chain.

4.5 Control Flow Guard Bypass

CFG validates the target of every indirect call. You bypass it by finding a call target that is not protected, or by corrupting a pointer that CFG does not check.

4.6 Arbitrary Code Guard Bypass

ACG prevents the content process from mapping new executable memory or modifying existing code pages. The bypass abuses the out-of-process JIT server using RPC calls from the content process.

4.7 Data-Only Attacks

Sometimes you cannot execute code at all. Instead you use your read/write primitive to directly modify security-relevant data: flags, tokens, ACL entries, or dispatch tables, without ever running your own shellcode.

4.8 Sandbox Escape

The Edge renderer runs inside an AppContainer. Getting code execution in the renderer is not enough. You need to abuse the JIT server or broker process, which runs with more privilege, to fully escape the sandbox.


Module 5 - Windows Kernel Exploitation

Kernel exploitation means running code at ring 0. A single mistake crashes the machine. You need to understand pool internals, how the kernel handles user-mode interactions, and how to manipulate kernel data structures like tokens and callbacks without triggering any of the hardware mitigations (SMEP, SMAP, KVAS).

5.1 Kernel Architecture

Understand the full picture: ring 0 vs ring 3, IRQL levels, how syscalls work, how IOCTLs reach driver handlers, and what the KPCR/KTHREAD/EPROCESS chain looks like in memory.

5.2 HEVD Lab Setup

HackSys Extreme Vulnerable Driver is the standard training target. It has every major kernel bug class implemented intentionally in both x86 and x64. Start every technique here before touching real targets.

5.3 Token Stealing

The classic kernel privilege escalation. Walk the EPROCESS list to find the System process, copy its token into your process's token field, and return to user mode as NT AUTHORITY\SYSTEM.

5.4 Kernel Stack Overflow

Overflow a kernel stack buffer to overwrite the return address. If GS cookies are present you need a way around them first. Then you either land on shellcode directly or use a kernel ROP chain.

5.5 Arbitrary Memory Overwrite (Write-What-Where)

Overwrite HalDispatchTable+0x8 with the address of your shellcode. Then call NtQueryIntervalProfile from user mode to trigger the overwritten pointer inside the kernel.

5.6 Kernel Pool Exploitation

Pool overflows and UAF in the non-paged or paged pool. You need to groom the pool to get your target allocation in the right place before triggering the bug.

5.7 SMEP Bypass

SMEP (CR4 bit 20) prevents the CPU from executing user-mode pages while in ring 0. The standard bypass is a ROP gadget that clears the bit before jumping to your shellcode. PTE manipulation is another option.

5.8 Unsanitized User-Mode Callbacks

The win32k subsystem can call back into user mode during kernel execution. If the kernel does not re-validate object state after the callback returns, an attacker can corrupt that state during the window.

5.9 Driver Callback Overwrite

Overwrite kernel callback pointers like PsSetCreateProcessNotifyRoutine entries or I/O completion callbacks. When the kernel triggers one of those callbacks your code runs in ring 0.


Module 6 - Hyper-V Bonus

Not always on the main syllabus but directly relevant. Understanding the hypervisor layer helps with both kernel exploitation technique and with the VMware module.


Module 7 - Exam Prep and Strategy

7.1 Exam Structure

  • 72-hour exam with two assignments
  • 75 points needed to pass (each assignment is worth up to 50 points, 25 for partial credit)
  • Penetration test report in PDF format due within 24 hours after the exam window closes
  • Official OSEE Exam Guide

7.2 Practice CVEs

These are the targets the community recommends for building skills that directly apply to the exam.

CVE Description Writeup
CVE-2021-21551 Dell BIOS Driver pool LPE CrowdStrike
CVE-2017-8601 Windows JScript type confusion Exploit-DB
CVE-2015-5736 Fortinet FortiClient Exploit-DB
CVE-2014-4113 Win32k UAF (MS14-058) Exploit-DB
CVE-2011-2005 NDIS LPE (MS11-080) Exploit-DB
CVE-2017-4901 VMware guest-to-host escape rip1s GitHub
CVE-2019-0567 Edge Chakra type confusion Connor McGarr
HEVD All kernel bug classes GitHub

7.3 Recommended Study Path

Go through this in order. Do not skip ahead to the browser stuff until you can write a kernel exploit from scratch.

  1. Complete Corelan exploit writing tutorials Parts 1 through 11
  2. Exploit HEVD stack overflow on x86 then x64
  3. Exploit HEVD write-what-where via HalDispatchTable
  4. Exploit HEVD pool UAF with non-paged pool feng shui
  5. Write a custom PIC reverse shell in x64 assembly
  6. Read both Valasek heap internals PDFs cover to cover
  7. Analyze CVE-2017-4901 (VMware) using the rip1s wiki and source code
  8. Build CVE-2019-0567 by following all three Connor McGarr posts
  9. Write a full penetration test report for each exploit you build
  10. Read every AWE course review to calibrate your expectations for the exam

Module 8 - Tools Reference

8.1 WinDbg

8.2 Scripting and Automation

8.3 Fuzzing and Patch Diffing


Module 9 - Papers and Conference Talks

9.1 Papers You Should Actually Read

Paper Year Link
Return-Oriented Programming (Shacham) 2007 ACM
ROP Without Returns (Checkoway et al.) 2010 ACM
Non-Control-Data Attacks (Chen et al.) 2005 ACM
Bypassing Hardware-Enforced DEP (Skape, Skywing) 2005 Archive
Heap Feng Shui in JavaScript (Sotirov) 2007 BlackHat PDF

9.2 Conference Talks

Talk Event Link
Kernel Attacks Through User-Mode Callbacks (Tarjei Mandt) BlackHat 2011 PDF
The Great Escapes of VMware BlackHat EU 2017 PDF
Cross The Wall: Bypass All Mitigations in Edge BlackHat US 2017 PDF
Bypassing Control Flow Guard on Windows 10 BlackHat US 2014 PDF
Advanced Windows 10 Kernel Exploitation (Morten Schenk) DEF CON 25 YouTube

9.3 Free Training Platforms

Platform What it covers Link
ROP Emporium Practical ROP x64 ropemporium.com
RET2 Wargames Exploit development wargames.ret2.systems
pwn.college Binary and kernel exploitation pwn.college
OpenSecurityTraining2 Architecture and exploitation, free ost2.fyi
Nightmare Binary exploitation course guyinatuxedo.github.io
LiveOverflow Exploitation YouTube series YouTube
exploit.education Vulnerable VMs exploit.education

CVE Reference Table

CVE Application Bug Class Module
CVE-2017-4901 VMware Workstation Use-After-Free (DnD RPCI) 3
CVE-2019-0567 Microsoft Edge / Chakra Type Confusion (JIT) 4
CVE-2019-0539 Microsoft Edge / Chakra Type Confusion 4
CVE-2017-8637 Microsoft Edge ACG Bypass (JIT Server) 4
CVE-2017-8601 Windows JScript Type Confusion 4
CVE-2021-21551 Dell BIOSConnect Pool Overflow (LPE) 5
CVE-2014-4113 win32k.sys Use-After-Free 5
CVE-2015-0057 win32k.sys Use-After-Free (Callback) 5
CVE-2011-2005 NDIS Buffer Overflow 5

Independent community resource. Not affiliated with Offensive Security.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors