ioctlbf is an IOCTL fuzzer for Windows. Given a target devicem it opens up a handle to it like this:
<code>deviceHandle = CreateFile((HANDLE) deviceName,
GENERIC_READ,
0,
NULL,
OPEN_EXISTING,
0,
NULL);
if (deviceHandle == INVALID_HANDLE_VALUE) {
printf("FAILED, error code: %dn%sn", GetLastError(),
errorCode2String(GetLastError()));
exit(1);
}
</code>
<code>deviceHandle = CreateFile((HANDLE) deviceName,
GENERIC_READ,
0,
NULL,
OPEN_EXISTING,
0,
NULL);
if (deviceHandle == INVALID_HANDLE_VALUE) {
printf("FAILED, error code: %dn%sn", GetLastError(),
errorCode2String(GetLastError()));
exit(1);
}
</code>
deviceHandle = CreateFile((HANDLE) deviceName,
GENERIC_READ,
0,
NULL,
OPEN_EXISTING,
0,
NULL);
if (deviceHandle == INVALID_HANDLE_VALUE) {
printf("FAILED, error code: %dn%sn", GetLastError(),
errorCode2String(GetLastError()));
exit(1);
}
The problem is, even when I am running the tool from administrator console, I am getting “Access is denied, Error code 5”. I am not familiar with Windows driver programming. Where should I be looking at to investigate this? Could it anyway be related to protected process / ACL / Exclusive bit in IoDeviceCreate
?
- Ran ioctlbf deom administrator console so that the privilege does not become an issue
- The device is marked as “Exclusive”, but current handle count in DeviceTree is
0
. So, I guess that the number of handle is not the issue here - Tried other tools like
ioctlpus