APT_IN_TA397_wmRAT
Description
track wmRAT based on socket usage, odd error handling, and reused strings
Query · yara
strings:
$code_sleep_loop = {
6a 64 // push 0x64
ff d6 // call esi
6a 01 // push 0x1
e8 ?? ?? ?? ?? // call operator new
83 c4 04 // add esp, 0x4
3b c7 // cmp eax, edi
}
$code_error_handling = {
88 19 // mov byte [ecx], bl
4a // dec edx
41 // inc ecx
47 // inc edi
4e // dec esi
85 d2 // test edx, edx
?? ?? // jne 0x401070
5f // pop edi {__saved_edi}
49 // dec ecx
5e // pop esi {__saved_esi}
b8 7a 00 07 80 // mov eax, 0x8007007a
}
$code_socket_recv_parsing = {
// 8b 15 20 55 41 00 mov edx, dword [data_415520]
6a 00 // push 0x0
b8 04 00 00 00 // mov eax, 0x4
2b c6 // sub eax, esi
50 // push eax {var_10_1}
8d 0c 3e // lea ecx, [esi+edi]
51 // push ecx {var_14_1}
52 // push edx {var_18_1}
ff ?? // call ebx
83 f8 ff // cmp eax, 0xffffffff
?? ?? // je 0x4082e3
03 f0 // add esi, eax
83 fe 04 // cmp esi, 0x4
}
$str1 = "-.-.-." ascii
$str2 = "PATH" ascii
$str3 = "Path=" ascii
$str4 = "https://microsoft.com" ascii
$str5 = "%s%ld M" ascii
$str6 = "%s%ld K" ascii
$str7 = "%s(%ld)" ascii
$str8 = "RFOX" ascii
$str9 = "1llll" ascii
$str10 = "%d result(s)" ascii
$str11 = "%s%ld MB" ascii
$str12 = "%s%ld KB" ascii
$str13 = "%.1f" ascii
$str14 = "%02d-%02d-%d %02d:%02d" ascii
condition:
uint16be(0x0) == 0x4d5a and
(2 of ($code*) or 10 of ($str*))