Ransomware.
rule win_cuba_auto { meta: author = "Felix Bilstein - yara-signator at cocacoding dot com" date = "2026-05-04" 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 = "20260422" malpedia_hash = "a182e35da64e6d71cb55f125c4d4225196523f14" malpedia_version = "20260504" 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 = { 0019 43 41 00444341 } // n = 4, score = 100 // 0019 | add byte ptr [ecx], bl // 43 | inc ebx // 41 | inc ecx // 00444341 | add byte ptr [ebx + eax*2 + 0x41], al $sequence_1 = { 6a00 6a02 8985c0fbffff ff15???????? 8d8dccfbffff 8985c8fbffff 51 } // n = 7, score = 100 // 6a00 | push 0 // 6a02 | push 2 // 8985c0fbffff | mov dword ptr [ebp - 0x440], eax // ff15???????? | // 8d8dccfbffff | lea ecx, [ebp - 0x434] // 8985c8fbffff | mov dword ptr [ebp - 0x438], eax // 51 | push ecx $sequence_2 = { 003a 45 41 004245 } // n = 4, score = 100 // 003a | add byte ptr [edx], bh // 45 | inc ebp // 41 | inc ecx // 004245 | add byte ptr [edx + 0x45], al $sequence_3 = { 000d???????? 384100 b538 41 } // n = 4, score = 100 // 000d???????? | // 384100 | cmp byte ptr [ecx], al // b538 | mov ch, 0x38 // 41 | inc ecx $sequence_4 = { 000c43 41 0035???????? 43 } // n = 4, score = 100 // 000c43 | add byte ptr [ebx + eax*2], cl // 41 | inc ecx // 0035???????? | // 43 | inc ebx $sequence_5 = { 000446 41 00d1 45 } // n = 4, score = 100 // 000446 | add byte ptr [esi + eax*2], al // 41 | inc ecx // 00d1 | add cl, dl // 45 | inc ebp $sequence_6 = { ff15???????? 33c0 8bf8 8985f8f7ffff 8bb778df4100 8d95fcf7ffff } // n = 6, score = 100 // ff15???????? | // 33c0 | xor eax, eax // 8bf8 | mov edi, eax // 8985f8f7ffff | mov dword ptr [ebp - 0x808], eax // 8bb778df4100 | mov esi, dword ptr [edi + 0x41df78] // 8d95fcf7ffff | lea edx, [ebp - 0x804] $sequence_7 = { 0012 45 41 0026 } // n = 4, score = 100 // 0012 | add byte ptr [edx], dl // 45 | inc ebp // 41 | inc ecx // 0026 | add byte ptr [esi], ah $sequence_8 = { 3b0cc5905d4100 7427 40 83f82d 72f1 8d41ed } // n = 6, score = 100 // 3b0cc5905d4100 | cmp ecx, dword ptr [eax*8 + 0x415d90] // 7427 | je 0x29 // 40 | inc eax // 83f82d | cmp eax, 0x2d // 72f1 | jb 0xfffffff3 // 8d41ed | lea eax, [ecx - 0x13] $sequence_9 = { 3d00002000 7710 8d85e8f7ffff 8bcf 50 e8???????? eb55 } // n = 7, score = 100 // 3d00002000 | cmp eax, 0x200000 // 7710 | ja 0x12 // 8d85e8f7ffff | lea eax, [ebp - 0x818] // 8bcf | mov ecx, edi // 50 | push eax // e8???????? | // eb55 | jmp 0x57 $sequence_10 = { 0026 45 41 003a } // n = 4, score = 100 // 0026 | add byte ptr [esi], ah // 45 | inc ebp // 41 | inc ecx // 003a | add byte ptr [edx], bh $sequence_11 = { 0026 43 41 00b043410062 } // n = 4, score = 100 // 0026 | add byte ptr [esi], ah // 43 | inc ebx // 41 | inc ecx // 00b043410062 | add byte ptr [eax + 0x62004143], dh $sequence_12 = { 5d c3 8b04c5945d4100 5d c3 } // n = 5, score = 100 // 5d | pop ebp // c3 | ret // 8b04c5945d4100 | mov eax, dword ptr [eax*8 + 0x415d94] // 5d | pop ebp // c3 | ret $sequence_13 = { ffb5e8f7ffff ff15???????? 8b8de4f7ffff 8b85e0f7ffff 3bcb 7f4c 7c07 } // n = 7, score = 100 // ffb5e8f7ffff | push dword ptr [ebp - 0x818] // ff15???????? | // 8b8de4f7ffff | mov ecx, dword ptr [ebp - 0x81c] // 8b85e0f7ffff | mov eax, dword ptr [ebp - 0x820] // 3bcb | cmp ecx, ebx // 7f4c | jg 0x4e // 7c07 | jl 9 $sequence_14 = { 33c0 c785c0f9ffff2c020000 668985ecfbffff 668985f4fdffff 8d85c0f9ffff 50 56 } // n = 7, score = 100 // 33c0 | xor eax, eax // c785c0f9ffff2c020000 | mov dword ptr [ebp - 0x640], 0x22c // 668985ecfbffff | mov word ptr [ebp - 0x414], ax // 668985f4fdffff | mov word ptr [ebp - 0x20c], ax // 8d85c0f9ffff | lea eax, [ebp - 0x640] // 50 | push eax // 56 | push esi $sequence_15 = { ffb5fcfdffff ff15???????? 85c0 750d 8b95c0fbffff 53 e8???????? } // n = 7, score = 100 // ffb5fcfdffff | push dword ptr [ebp - 0x204] // ff15???????? | // 85c0 | test eax, eax // 750d | jne 0xf // 8b95c0fbffff | mov edx, dword ptr [ebp - 0x440] // 53 | push ebx // e8???????? | 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 0F B6 47 ?? C1 E1 ?? 0B C8 0F B6 47 ?? C1 E1 ?? 0B C8 8B 45 ?? 89 4D ?? 89 4B} $p2 = {5D ?? 8B C3 C1 E8 ?? 0F B6 D0 8B C3 C1 E8 ?? 0F B6 C8 8B 04 95 [4] 33 04 8D [4] 8B CB C1 E9 ?? 33 04 8D [4] 0F B6 CB 5B 33 04 8D} $p3 = {8B 75 ?? 8B C6 C1 E8 ?? 0F B6 C8 8B 45 ?? C1 E8 ?? 0F B6 C0 8B 0C 8D [4] 8B 55 ?? 33 0C 85 [4] 8B C2 C1 E8 ?? 33 0C 85 [4] 8B 45 ?? 0F B6 C0 33 0C 85 [4] 33 0F 8B 45 ?? C1 E8 ?? 89 4D ?? 0F B6 C8 8B C6 C1 E8 ?? 0F B6 C0 8B 0C 8D [4] 33 0C 85 [4] 8B 45 ?? C1 E8 ?? 33 0C 85 [4] 0F B6 C2 33 0C 85 [4] 33 4F ?? 8B 45 ?? C1 E8 ?? 89 4D ?? 0F B6 C8 8B C2 C1 E8 ?? 0F B6 C0 C1 EA ?? 8B 1C 8D [4] 8B 4D ?? 33 1C 85 [4] 8B C6 C1 E8 ?? 33 1C 85 [4] 0F B6 C1 C1 E9 ?? 0F B6 C9 33 1C 85 [4] 33 5F ?? 0F B6 C2 8B 14 8D [4] 33 14 85 [4] 8B 45 ?? C1 E8 ?? 33 14 85 [4] 8B C6 0F B6 C0 33 14 85 [4] 8B C3 33 57 ?? C1 E8 ?? 0F B6 C8 8B 45 ?? C1 E8 ?? 0F B6 C0 8B 0C 8D [4] 33 0C 85 [4] 8B 45 ?? C1 E8 ?? 33 0C 85 [4] 0F B6 C2 33 0C 85 [4] 8B C2 33 4F ?? C1 E8 ?? 89 4D ?? 0F B6 C8 8B C3 C1 E8 ?? 8B 0C 8D [4] 0F B6 C0 33 0C 85 [4] 8B 45 ?? C1 E8 ?? 33 0C 85 [4] 8B 45 ?? 0F B6 C0 33 0C 85 [4] 8B C2 33 4F ?? C1 E8 ?? 89 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. Changes regarding references should be proposed on the Malpedia library page.
Your suggestion will be reviewed before being published. Thank you for contributing!
YYYY-MM-DD
YYYY-MM
YYYY