Actor(s): APT34
The primary function of LONGWATCH is a keylogger that outputs keystrokes to a log.txt file in the Windows temp folder.
rule win_longwatch_auto { meta: author = "Felix Bilstein - yara-signator at cocacoding dot com" date = "2023-01-25" version = "1" description = "Detects win.longwatch." info = "autogenerated rule brought to you by yara-signator" tool = "yara-signator v0.6.0" signator_config = "callsandjumps;datarefs;binvalue" malpedia_reference = "https://malpedia.caad.fkie.fraunhofer.de/details/win.longwatch" malpedia_rule_date = "20230124" malpedia_hash = "2ee0eebba83dce3d019a90519f2f972c0fcf9686" malpedia_version = "20230125" malpedia_license = "CC BY-SA 4.0" malpedia_sharing = "TLP:WHITE" /* DISCLAIMER * The strings used in this rule have been automatically selected from the * disassembly of memory dumps and unpacked files, using YARA-Signator. * The code and documentation is published here: * https://github.com/fxb-cocacoding/yara-signator * As Malpedia is used as data source, please note that for a given * number of families, only single samples are documented. * This likely impacts the degree of generalization these rules will offer. * Take the described generation method also into consideration when you * apply the rules in your use cases and assign them confidence levels. */ strings: $sequence_0 = { 6bc830 8b0495a00b4300 f644082801 7414 } // n = 4, score = 200 // 6bc830 | imul ecx, eax, 0x30 // 8b0495a00b4300 | mov eax, dword ptr [edx*4 + 0x430ba0] // f644082801 | test byte ptr [eax + ecx + 0x28], 1 // 7414 | je 0x16 $sequence_1 = { 3934bda00b4300 7531 e8???????? 8904bda00b4300 85c0 7514 } // n = 6, score = 200 // 3934bda00b4300 | cmp dword ptr [edi*4 + 0x430ba0], esi // 7531 | jne 0x33 // e8???????? | // 8904bda00b4300 | mov dword ptr [edi*4 + 0x430ba0], eax // 85c0 | test eax, eax // 7514 | jne 0x16 $sequence_2 = { 750b 8b0d???????? e8???????? e8???????? 83ec18 } // n = 5, score = 200 // 750b | jne 0xd // 8b0d???????? | // e8???????? | // e8???????? | // 83ec18 | sub esp, 0x18 $sequence_3 = { c745e088934200 e9???????? c745e090934200 e9???????? c745e0a8934200 } // n = 5, score = 200 // c745e088934200 | mov dword ptr [ebp - 0x20], 0x429388 // e9???????? | // c745e090934200 | mov dword ptr [ebp - 0x20], 0x429390 // e9???????? | // c745e0a8934200 | mov dword ptr [ebp - 0x20], 0x4293a8 $sequence_4 = { 83c804 6a00 50 e8???????? 8d4da8 c745fc03000000 } // n = 6, score = 200 // 83c804 | or eax, 4 // 6a00 | push 0 // 50 | push eax // e8???????? | // 8d4da8 | lea ecx, [ebp - 0x58] // c745fc03000000 | mov dword ptr [ebp - 4], 3 $sequence_5 = { c1f806 83e13f 6bc930 8b0485a00b4300 } // n = 4, score = 200 // c1f806 | sar eax, 6 // 83e13f | and ecx, 0x3f // 6bc930 | imul ecx, ecx, 0x30 // 8b0485a00b4300 | mov eax, dword ptr [eax*4 + 0x430ba0] $sequence_6 = { 83e03f 6bc030 03048da00b4300 b9???????? eb07 b9???????? 8bc1 } // n = 7, score = 200 // 83e03f | and eax, 0x3f // 6bc030 | imul eax, eax, 0x30 // 03048da00b4300 | add eax, dword ptr [ecx*4 + 0x430ba0] // b9???????? | // eb07 | jmp 9 // b9???????? | // 8bc1 | mov eax, ecx $sequence_7 = { 68???????? e8???????? eb52 68???????? e8???????? } // n = 5, score = 200 // 68???????? | // e8???????? | // eb52 | jmp 0x54 // 68???????? | // e8???????? | $sequence_8 = { 56 68a0000000 8bf1 ff15???????? } // n = 4, score = 200 // 56 | push esi // 68a0000000 | push 0xa0 // 8bf1 | mov esi, ecx // ff15???????? | $sequence_9 = { 8d8d48ffffff c78548ffffffdc334200 e8???????? 83ec08 c745fc02000000 } // n = 5, score = 200 // 8d8d48ffffff | lea ecx, [ebp - 0xb8] // c78548ffffffdc334200 | mov dword ptr [ebp - 0xb8], 0x4233dc // e8???????? | // 83ec08 | sub esp, 8 // c745fc02000000 | mov dword ptr [ebp - 4], 2 condition: 7 of them and filesize < 647168 }
If your designated proposal does not fit in any other category, feel free to write a free-text in the comment field below.
Please propose all changes regarding references on the Malpedia library page
Your suggestion will be reviewed before being published. Thank you for contributing!
YYYY-MM-DD
YYYY-MM
YYYY