DIRT: Driver Initial Reconnaissance Tool
DIRT: Driver Initial Reconnaissance Tool
get an initial assessment of drivers installed on a Windows system (e.g. master images developed by OEMs or enterprises). It’s supposed to help with target selection, finding low-hanging fruit, and some assistance with deep-dive binary analysis. Currently unstable, undergoing active development.
Primary Features
- Listing of kernel-mode drivers non-administrative users can interact with via DeviceIoControl.
- This can be useful to narrow down on drivers that can potentially be used toward LPE.
- Retrieval of company names associated with drivers to determine ownership.
- This can be useful in target selection to separate third-party drivers from Microsoft drivers.
- Resolution of the DispatchDeviceControl routine used to handle requests from DeviceIoControl.
- This makes it easier to find the function in IDA (versus relying on heuristics in static analysis).
- The function can be analyzed to enumerate IOCTL codes and perform attack surface analysis.
- Enumeration of the IOCTL codes supported by DispatchDeviceControl.
- There might be an opportunity for symbolic execution like this, but not sure how robust it can be.
- Enumeration of user-mode drivers that make calls to a given kernel-mode driver.
Secondary Features
- CLI and GUI modes.
- Output formats: JSON, CSV, and human-readable text.
Download
git clone https://github.com/jthuraisamy/DIRT.git
Usage
- Enable debug mode with bcdedit -debug on with an administrative Command Prompt.
- Place
kldbgdrv.sys
(found with WinDbg) in the same directory as DIRT.exe. - Run DIRT.exe > output.txt with administrative privileges.
The –lp-only and –no-msft switches can be used to filter results.
Below is some sample output to know what to expect:
There is also a CSV output available using DIRT::Main::ExportCSV():
Copyright (c) 2018 Jackson Thuraisamy
Source: https://github.com/jthuraisamy/