rule Lazarus_DPAPILoader_Hunting { meta: description = "Hunting rule to detect DPAPILoader, a loader used to load RemotePE." author = "Fox-IT / NCC Group" strings: $msg_1 = "[!] Could not allocate memory at the desired base!\n" $msg_2 = "[!] Virtual section size is out ouf bounds: " $msg_3 = "[!] Invalid relocDir pointer\n" $msg_4 = "[-] Not supported relocations format at %d: %d\n" $msg_5 = "[!] Cannot fill imports into 32 bit PE via 64 bit loader!\n" condition: any of them and pe.imports("Crypt32.dll", "CryptUnprotectData") } rule Lazarus_RemotePE_C2_strings { meta: description = "RemotePE strings used for C2." author = "Fox-IT / NCC Group" strings: $a = "MicrosoftApplicationsTelemetryDeviceId" wide ascii xor $b = "armAuthorization" wide ascii xor $c = "ai_session" wide ascii xor condition: uint16(0) == 0x5A4D and all of them } rule Lazarus_RemotePE_class_strings { meta: description = "RemotePE class strings." author = "Fox-IT / NCC Group" strings: $a = "IMiddleController" ascii wide xor $b = "IChannelController" ascii wide xor $c = "IConfigProfile" ascii wide xor $d = "IKernelModule" ascii wide xor condition: all of them } rule Lazarus_RemotePE_DPAPI_Encrypted_config { meta: description = "Detects RemotePE DPAPI-encrypted config on disk" author = "Fox-IT Security Research Team" condition: filesize == 3094 and uint32(0) == 0x00000001 // DPAPI blob version = 1 and uint32(0x8E) == 0x00000B40 // dwDataLen = 0xB40 (padded config) }