O'Reilly logo

Gray Hat Python by Justin Seitz

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Building a Driver Fuzzer

The first step is to create our IOCTL-dumping PyCommand to run inside Immunity Debugger. Crack open a new Python file, name it ioctl_dump.py, and enter the following code.

ioctl_dump.py

ioctl_dump.py

  import pickle
  import driverlib
  from immlib import *

  def main( args ):
      ioctl_list  = []
      device_list = []

      imm    = Debugger()
      driver = driverlib.Driver()

      # Grab the list of IOCTL codes and device names
ioctl_dump.py      ioctl_list  = driver.getIOCTLCodes()
       if not len(ioctl_list):
           return "[*] ERROR! Couldn't find any IOCTL codes."

ioctl_dump.py device_list = driver.getDeviceNames() ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required