Giter VIP home page Giter VIP logo

driverbuddy's Introduction

Quickstart

DriverBuddy Installation Instructions

  1. Copy DriverBuddy folder and DriverBuddy.py file into the IDA plugins folder C:\Program Files (x86)\IDA 6.8\plugins or wherever you installed IDA

DriverBuddy Usage Instructions

  1. Start IDA and open a Windows kernel driver
  2. Go to Edit->Plugins and select Driver Buddy or press ctrl-alt-d
  3. Check Output window for DriverBuddy analysis results
  4. To decode IOCTLs, highlight the suspected IOCTL and press ctrl-alt-i

DriverBuddy

DriverBuddy is an IDAPython plugin that helps automate some of the tedium surrounding the reverse engineering of Windows Kernel Drivers. It has a number of handy features, such as:

  • Identifying the type of driver
  • Locating DispatchDeviceControl and DispatchInternalDeviceControl functions
  • Populating common structs for WDF and WDM drivers
    • Attempts to identify and label structs like the IRP and IO_STACK_LOCATION
    • Labels calls to WDF functions that would normally be unlabeled
  • Finding known IOCTL codes and decoding them
  • Flagging functions prone to misuse

Finding DispatchDeviceControl

Being able to automatically locate and identify the DispatchDeviceControl function is a time saving task during driver reverse engineering. This function is used to route all incoming DeviceIoControl codes to the specific driver function associated with that code. Automatically identifying this function makes finding the valid DeviceIoControl codes for each driver much quicker. Additionally, when investigating possible vulnerabilities in a driver due to a crash, knowing the location of this function helps narrow the focus to the specific function call associated with the crashing DeviceIoControl code.

Labeling WDM Structs

Several driver structures are shared among all WDM drivers. Being able to automatically identify these structures, such as the IO_STACK_LOCATION, IRP, and DeviceObject structures, can help save time during the reverse engineering process. DriverBuddy attempts to locate and identify many of these structs.

Labeling WDF Functions

As with WDM drivers, there are several functions and structures that are shared among all WDF drivers. Automatically identifying these functions and structures will save time during the reverse engineering process and provide context to unindentified areas of the driver where these functions are in use.

Decoding DeviceIoControl Codes

While reversing drivers, it is common to come across IOCTL codes as part of the analysis. These codes, when decoded, reveal useful information to reverse engineers and may draw focus to specific parts of the driver where vulnerabilities are more likely to exist.

Future things:

  1. Add obref and deref checks of some sort to help find refcount issues
  2. Polish output, gui?
  3. Strengthen/polish current features
    • Improve reliablity of DispatchDeviceControl finder
    • Write short blurbs about why things are flagged
    • MSDN doc importer

Stretch Goals:

  1. Find IOCTLs automatically
  2. IRP taint analysis aka follow aliasing of sysbuf/inbuf, size
  3. Identify other common structures
  4. Uninitialized variables, etc

Credits

License

This software is released under the MIT License, see LICENSE.

driverbuddy's People

Contributors

m1ghtym0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

driverbuddy's Issues

Crash

image

Shortcut Ctrl+Alt+I is used for two actions:
@idc:py_hotkeycb_0000000007EC6EE8
@idc:py_hotkeycb_0000000007EC6DC8
"@idc:py_hotkeycb_0000000007EC6DC8" will be deleted.
[+] Welcome to Driver Buddy
[+] Checking for DriverEntry...
[+] DriverEntry found
[+] Populating IDA functions....
[+] Searching for interesting C functions....
[+] interesting C functions detected
[+] Found 0x00011aea xref to RtlCopyMemory
[+] Found 0x00011b04 xref to RtlCopyMemory
[+] Searching for interesting Windows functions....
[+] interesting winapi functions detected
[+] Found 0x000110ae xref to ZwQuerySymbolicLinkObject
[+] Found 0x00011197 xref to ZwQuerySymbolicLinkObject
[+] Found 0x00011091 xref to ZwOpenSymbolicLinkObject
[+] Found 0x0001117e xref to ZwOpenSymbolicLinkObject
[+] Found 0x000112ca xref to ObReferenceObjectByPointer
[+] Found 0x00012493 xref to PsCreateSystemThread
[+] Found 0x000110c1 xref to ZwClose
[+] Found 0x000111a6 xref to ZwClose
[+] Found 0x000124ca xref to ZwClose
[+] Found 0x00012639 xref to ZwClose
[+] Found 0x000160d8 xref to ZwClose
[+] Found 0x00012600 xref to ZwMakeTemporaryObject
[+] Found 0x000124bd xref to ObReferenceObjectByHandle
[+] Found 0x000112d5 xref to ObfDereferenceObject
[+] Found 0x00016041 xref to ObfDereferenceObject
[+] Found 0x000118c4 xref to IofCallDriver
[+] Found 0x00011a24 xref to IofCallDriver
[+] Found 0x000125eb xref to ZwCreateDirectoryObject
[+] Searching for interesting driver functions....
[-] No interesting specific driver functions detected
[+] Trying to determine driver type...
[+] Found real DriverEntry address of ffffffffffffffff

Windows on ARM, Support?

Please let us know when can we have an ARM64 version for Windows on ARM OS. As WOA is becoming a new attack surface on ARM64 Architecture. It will help with discovering new ARM64 Windows driver issues.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.