gen_Excel_xll_addin_suspicious
Description
Detects suspicious XLL add-ins to Excel
Query · yara
strings:
$s1 = "CryptStringToBinaryA"
$s2 = "NtQueueApcThread"
$cs1 = "dsrole.dll"
$cs2 = "user32.dll"
$debug = "SeDebugPrivilege"
condition:
filesize < 1MB
and uint16(0) == 0x5a4d
and pe.characteristics & pe.DLL
and pe.exports("xlAutoOpen")
and (
((pe.imports("KERNEL32.dll", "LookupPrivilegeValueW") or pe.imports("KERNEL32.dll", "LookupPrivilegeValueA"))
and pe.imports("KERNEL32.dll", "AdjustTokenPrivileges")
and pe.imports("KERNEL32.dll", "OpenProcess")
and $debug)
or (pe.imports("ADVAPI32.dll", "CryptDecrypt")
and pe.imports("ADVAPI32.dll", "CryptImportKey"))
or (pe.imports("DNSAPI.dll", "DnsQuery_A") or pe.imports("DNSAPI.dll", "DnsQuery_W"))
or ((pe.imports("KERNEL32.dll", "FindResourceA") or pe.imports("KERNEL32.dll", "FindResourceW"))
and pe.imports("KERNEL32.dll", "LoadResource")
and pe.imports("KERNEL32.dll", "LockResource")
and (pe.imports("KERNEL32.dll", "VirtualAlloc") or pe.imports("KERNEL32.dll", "VirtualAllocEx"))
and pe.imports("KERNEL32.dll", "WriteProcessMemory")
and pe.imports("KERNEL32.dll", "SetThreadContext"))
or (pe.imports("KERNEL32.dll", "GetThreadContext")
and pe.imports("KERNEL32.dll", "VirtualAllocEx")
and pe.imports("KERNEL32.dll", "ResumeThread")
and pe.imports("KERNEL32.dll", "SetThreadContext"))
or (pe.imports("KERNEL32.dll", "WinExec"))
or (all of ($s*))
or (all of ($cs*) and pe.imports("KERNEL32.dll", "VirtualAllocEx")
and pe.imports("KERNEL32.dll", "TerminateProcess")
and pe.imports("KERNEL32.dll", "Sleep"))
)