Andras Kabai Hunting and Exploiting Bugs in Kernel Drivers
Andras Kabai Hunting and Exploiting Bugs in Kernel Drivers
in kernel drivers
Andras Kabai
Hacktivity 2012
Who am I
Andras Kabai
OSCP, OSCE, OSEE, GPEN, GWAPT, GREM, GXPN, CEH
Manager of Deloitte Hungary's Security & Privacy group
Previously
Senior IT Security Specialist / R&D Manager
CERT-Hungary, National CyberSecurity Center
hardware
● Memory: 0x80000000 to 0xFFFFFFFF
● Documentation
● Samples
● FunctionCode
● TransferType
● RequiredAccess
● Communication with
● DeviceIoControl() // IOCTL call
● WriteFile() // pass “stream” data
● ReadFile() // receive “stream” data
Communication between user mode
program and kernel driver - 2
● I/O Request through kernel32.DeviceIoControl
● WinObj, DriverView
● Gather useful information of loaded drivers
● IrpTracker
● Monitor I/O requests
● Reverse engineering
● IDA
● Fuzzing
● ioctlbf
● ioctlfuzzer
● Kartoffel
● Kernel debugging
● Usually set the first breakpoint on function referenced
by IRP_MJ_DEVICE_CONTROL
Why we love METHOD_NEITHER?
● Jump tables
● Etc.
Code execution
● ETHREAD → EPROCESS
● EPROCESS
● UniqueProcessId (is it system process?)
structure)
● Token (security descriptor of a process)
● Virtualization
● It is not magic
Andras Kabai
contact (_at_) kabaiandras.hu