Skip to content

meltedinhex/analyst-ai-pack / skills/analyzing-windows-driver-malware

analyzing-windows-driver-malware

Verified

Analyzes malicious and vulnerable Windows kernel drivers (.sys) by parsing the PE for the native subsystem, identifying DriverEntry/IRP dispatch and IOCTL handlers, and flagging BYOVD and kernel-callback abuse. Activates for requests to analyze a Windows driver, examine a .sys sample, or assess a BYOVD/kernel driver threat.

FileKindSize
LICENSEother340 B
SKILL.mdskill md2.8 KB
references/api-reference.mdmarkdown1.3 KB
scripts/analyst.pyscript2.8 KB

references/api-reference.md

View on GitHub
# API Reference: Analyzing Windows Driver Malware

## Overview

`scripts/analyst.py` inspects a Windows `.sys` driver: it confirms the PE native subsystem and kernel
imports, then flags IRP/IOCTL dispatch, arbitrary read/write primitives, and callback registration,
mapping them to capabilities and BYOVD risk. It reads bytes statically and never loads the driver.

## Dependencies

| Package | Version | Purpose |
|---------|---------|---------|
| (stdlib) | — | struct, regex, JSON, file IO |

## Core functions

### `inspect(path)`
Returns driver confirmation, subsystem, kernel imports, dispatch/RW/callback indicators,
capabilities, and a BYOVD-risk flag.

## Indicator classes

- Dispatch: `IoCreateDevice`, `IoCreateSymbolicLink`, `IRP_MJ_DEVICE_CONTROL`.
- RW primitives: `MmMapIoSpace`, `ZwMapViewOfSection`, `MmCopyMemory`.
- Callbacks: `PsSetCreateProcessNotifyRoutine`, `ObRegisterCallbacks`.

## Usage

```bash
python scripts/analyst.py inspect driver.sys
```

## Sources

- Windows Driver Kit (WDM/IRP, IOCTL) — https://learn.microsoft.com/windows-hardware/drivers/
- MITRE ATT&CK T1068 Exploitation for Privilege Escalation — https://attack.mitre.org/techniques/T1068/
- BYOVD arbitrary-RW IOCTL patterns and kernel callbacks from public driver-abuse research
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 470kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 470kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 470kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall