Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Principle:416rehman DeepZero PE Header Analysis

From Leeroopedia
Knowledge Sources
Domains PE_Analysis, Security_Research
Last Updated 2026-10-27 00:00 GMT

Overview

Static analysis of Portable Executable (PE) headers to extract driver metadata, detect kernel-mode subsystems, identify dangerous API imports, and score vulnerability priority without executing the binary.

Description

PE header analysis is a static analysis technique: it reads the binary's structure without executing it. For Windows kernel drivers (PE files with NATIVE subsystem), the headers reveal:

  • Subsystem: NATIVE (1) indicates a kernel-mode driver; GUI (2) indicates user-mode. This is the first filter for BYOVD (Bring Your Own Vulnerable Driver) research.
  • Import table: the DLLs and functions the driver imports. Specific function names reveal capabilities:
    • IoCreateDevice / IoCreateSymbolicLink: the driver creates a device object, exposing an IOCTL surface.
    • MmMapIoSpace / ZwMapViewOfSection: physical memory access—a high-severity capability.
    • PsLookupProcessByProcessId / ZwTerminateProcess: process manipulation.
    • __readmsr / __writemsr: Model-Specific Register access (kernel privilege escalation).
  • Imphash: a hash of the import table, useful for detecting variants of known drivers.
  • Signatures: whether the driver is signed (authenticode).

A priority score combines these signals into a 0-10 ranking, allowing a pipeline to focus expensive downstream analysis on the most promising candidates.

Usage

Use this technique when:

  • Triaging a corpus of PE files for vulnerability research
  • Filtering for kernel-mode drivers (subsystem = NATIVE)
  • Identifying drivers with dangerous capabilities (physical memory, process manipulation, MSR access)
  • Prioritizing analysis targets by risk surface

Theoretical Basis

The PE file format organizes a binary into headers and sections. The optional header contains the subsystem field:

# Abstract algorithm (NOT real implementation)
def analyze_pe(binary_data):
    pe = parse_pe_headers(binary_data)
    return {
        "subsystem": pe.optional_header.subsystem,  # NATIVE=1 (kernel), GUI=2 (user)
        "is_kernel_driver": pe.optional_header.subsystem == "NATIVE",
        "imported_functions": [fn for dll in pe.imports for fn in dll.entries],
        "has_ioctl_surface": any(fn in IOCTL_INDICATORS for fn in imported_functions),
        "is_signed": len(pe.signatures) > 0,
    }

The priority scoring is a weighted feature combination:

Failed to parse (syntax error): {\displaystyle \text{score} = \min(10, w_1 \cdot \text{phys\_mem} + w_2 \cdot \text{proc\_manip} + w_3 \cdot \text{msr\_io} + w_4 \cdot \text{small\_sections} + w_5 \cdot \text{modern\_os})}

Related Pages

Implemented By

Uses Heuristic

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment