Ransomware.
rule win_cuba_auto { meta: author = "Felix Bilstein - yara-signator at cocacoding dot com" date = "2023-01-25" version = "1" description = "Detects win.cuba." 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.cuba" 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 = { 8d850cf0ffff 50 8d47f0 50 e8???????? 8bf0 83c40c } // n = 7, score = 100 // 8d850cf0ffff | lea eax, [ebp - 0xff4] // 50 | push eax // 8d47f0 | lea eax, [edi - 0x10] // 50 | push eax // e8???????? | // 8bf0 | mov esi, eax // 83c40c | add esp, 0xc $sequence_1 = { c1c109 33c1 8945e8 8d0c03 c1c10d 314d0c 8b4d0c } // n = 7, score = 100 // c1c109 | rol ecx, 9 // 33c1 | xor eax, ecx // 8945e8 | mov dword ptr [ebp - 0x18], eax // 8d0c03 | lea ecx, [ebx + eax] // c1c10d | rol ecx, 0xd // 314d0c | xor dword ptr [ebp + 0xc], ecx // 8b4d0c | mov ecx, dword ptr [ebp + 0xc] $sequence_2 = { c1e803 03c8 8d341b 894df0 8d41fe 3bf0 } // n = 6, score = 100 // c1e803 | shr eax, 3 // 03c8 | add ecx, eax // 8d341b | lea esi, [ebx + ebx] // 894df0 | mov dword ptr [ebp - 0x10], ecx // 8d41fe | lea eax, [ecx - 2] // 3bf0 | cmp esi, eax $sequence_3 = { ff15???????? 8bf0 83c410 85f6 0f85a5010000 8b45e0 ff7004 } // n = 7, score = 100 // ff15???????? | // 8bf0 | mov esi, eax // 83c410 | add esp, 0x10 // 85f6 | test esi, esi // 0f85a5010000 | jne 0x1ab // 8b45e0 | mov eax, dword ptr [ebp - 0x20] // ff7004 | push dword ptr [eax + 4] $sequence_4 = { 83c40c 5e 5d c3 ff7510 56 } // n = 6, score = 100 // 83c40c | add esp, 0xc // 5e | pop esi // 5d | pop ebp // c3 | ret // ff7510 | push dword ptr [ebp + 0x10] // 56 | push esi $sequence_5 = { 33c8 8b85e4feffff 3385f4feffff 038d28ffffff 23c7 3385f4feffff 03c1 } // n = 7, score = 100 // 33c8 | xor ecx, eax // 8b85e4feffff | mov eax, dword ptr [ebp - 0x11c] // 3385f4feffff | xor eax, dword ptr [ebp - 0x10c] // 038d28ffffff | add ecx, dword ptr [ebp - 0xd8] // 23c7 | and eax, edi // 3385f4feffff | xor eax, dword ptr [ebp - 0x10c] // 03c1 | add eax, ecx $sequence_6 = { ff15???????? 85c0 751e ffd7 894304 32c0 5f } // n = 7, score = 100 // ff15???????? | // 85c0 | test eax, eax // 751e | jne 0x20 // ffd7 | call edi // 894304 | mov dword ptr [ebx + 4], eax // 32c0 | xor al, al // 5f | pop edi $sequence_7 = { c1e810 0fb6c0 8b0c8538524500 8b45f8 81e10000ff00 c1e808 } // n = 6, score = 100 // c1e810 | shr eax, 0x10 // 0fb6c0 | movzx eax, al // 8b0c8538524500 | mov ecx, dword ptr [eax*4 + 0x455238] // 8b45f8 | mov eax, dword ptr [ebp - 8] // 81e10000ff00 | and ecx, 0xff0000 // c1e808 | shr eax, 8 $sequence_8 = { 8be5 5d c3 57 8d45f0 56 } // n = 6, score = 100 // 8be5 | mov esp, ebp // 5d | pop ebp // c3 | ret // 57 | push edi // 8d45f0 | lea eax, [ebp - 0x10] // 56 | push esi $sequence_9 = { 8bb5ecfeffff 8bc7 8bbde8feffff c1c806 33c8 8bc7 038d68ffffff } // n = 7, score = 100 // 8bb5ecfeffff | mov esi, dword ptr [ebp - 0x114] // 8bc7 | mov eax, edi // 8bbde8feffff | mov edi, dword ptr [ebp - 0x118] // c1c806 | ror eax, 6 // 33c8 | xor ecx, eax // 8bc7 | mov eax, edi // 038d68ffffff | add ecx, dword ptr [ebp - 0x98] condition: 7 of them and filesize < 1094656 }
rule win_cuba_w0 { meta: description = "Detect_cuba_ransomware" author = "@malgamy12" date = "24/11/2022" license = "DRL 1.1" hash = "c2aad237b3f4c5a55df88ef26c25899fc4ec8170" hash = "4b41a1508f0f519396b7c14df161954f1c819e86" hash = "d5fe48b914c83711fe5313a4aaf1e8d80533543d" hash = "159b566e62dcec608a3991100d6edbca781d48c0" hash = "e1cae0d2a320a2756ae1ee5d37bfe803b39853fa" hash = "6f1d355b95546f0a5a09f7fd0b85fc9658e87813" hash = "25da0849207beb5695c8d9826b585b8cda435eba" hash = "3997d19f38ce14b7643c1ad8d6a737990b444215" hash = "f008e568c313b6f41406658a77313f89df07017e" hash = "7e42b668fd2ca96b05f39d5097943a191f1010f4" malpedia_reference = "https://malpedia.caad.fkie.fraunhofer.de/details/win.cuba" malpedia_rule_date = "20230118" malpedia_hash = "" malpedia_version = "20230118" malpedia_license = "DRL 1.1" malpedia_sharing = "TLP:WHITE" strings: $p1 = {C1 8D 73 ?? 99 83 E2 ?? 03 C2 C1 F8 ?? 8D 04 45 [4] 89 83 [4] 0F B6 0F 0F B6 47 ?? C1 E1 ?? 0B C8 0F B6 47 ?? C1 E1 ?? 0B C8 0F B6 47 ?? C1 E1 ?? 0B C8 89 0B 0F B6 47 ?? 89 4D ?? 0F B6 4F ?? C1 E1 ?? 0B C8 0F B6 47 ?? C1 E1 ?? 0B C8 0F B6 47 ?? C1 E1 ?? 0B C8 89 0E 0F B6 4F ?? 0F B6 47 ?? C1 E1 ?? 0B C8 0F B6 47 ?? C1 E1 ?? 0B C8 0F B6 47 ?? C1 E1 ?? 0B C8 89 4B ?? 0F B6 4F ?? 0F B6 47 ?? C1 E1 ?? 0B C8 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 4D ?? 0F B6 C8 8B 45 ?? C1 E8 ?? 0F B6 C0 8B 0C 8D [4] C1 EA ?? 33 0C 85 [4] 8B C3 C1 E8 ?? 33 0C 85 [4] 89 4D ?? 8B 4D ?? 8B 75 ?? 0F B6 C1 C1 E9 ?? 0F B6 C9 33 34 85 [4] 8B C6 89 75 ?? 33 47 ?? 8B 0C 8D [4] 89 45 ?? 8B 45 ?? C1 E8 ?? 0F B6 C0 33 0C 85 [4] 33 0C 95 [4] 0F B6 C3 33 0C 85 [4] 33 4F ?? 83 C7 ?? 83 6D} condition: uint16(0) == 0x5A4D and all of them }
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