Actor(s): Turla
There is no description at this point.
rule win_cobra_auto { meta: author = "Felix Bilstein - yara-signator at cocacoding dot com" date = "2023-12-06" version = "1" description = "Detects win.cobra." 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.cobra" malpedia_rule_date = "20231130" malpedia_hash = "fc8a0e9f343f6d6ded9e7df1a64dac0cc68d7351" malpedia_version = "20230808" 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 = { 7511 e8???????? 85c0 7508 ff15???????? } // n = 5, score = 2900 // 7511 | cmp cx, bx // e8???????? | // 85c0 | jne 0xfffffff6 // 7508 | pop esi // ff15???????? | $sequence_1 = { ff25???????? 53 56 57 8bd9 33f6 } // n = 6, score = 2500 // ff25???????? | // 53 | test eax, eax // 56 | test eax, eax // 57 | jne 6 // 8bd9 | xor eax, eax // 33f6 | jmp 0x6e $sequence_2 = { 7514 391d???????? 754d 33c0 } // n = 4, score = 2500 // 7514 | jne 0x16 // 391d???????? | // 754d | jne 0x4f // 33c0 | xor eax, eax $sequence_3 = { 85c0 0f8e8c000000 83e801 8905???????? } // n = 4, score = 2500 // 85c0 | test eax, eax // 0f8e8c000000 | jle 0x92 // 83e801 | sub eax, 1 // 8905???????? | $sequence_4 = { 751c 8bcf ff15???????? 8d8fe8030000 8bf9 } // n = 5, score = 2500 // 751c | jne 0x1e // 8bcf | mov ecx, edi // ff15???????? | // 8d8fe8030000 | lea ecx, [edi + 0x3e8] // 8bf9 | mov edi, ecx $sequence_5 = { 757f 8b05???????? 85c0 0f8e8c000000 } // n = 4, score = 2500 // 757f | jne 0x81 // 8b05???????? | // 85c0 | test eax, eax // 0f8e8c000000 | jle 0x92 $sequence_6 = { 5b c3 85db 7405 83fb03 } // n = 5, score = 2500 // 5b | pop ebx // c3 | ret // 85db | test ebx, ebx // 7405 | je 7 // 83fb03 | cmp ebx, 3 $sequence_7 = { 85c0 750e 3905???????? 7e2c ff0d???????? 83f801 8b0d???????? } // n = 7, score = 2500 // 85c0 | mov eax, 0xc0000005 // 750e | test eax, eax // 3905???????? | // 7e2c | je 0xe // ff0d???????? | // 83f801 | mov eax, 0xc0000005 // 8b0d???????? | $sequence_8 = { e8???????? 85c0 750e 33ff 8bc7 } // n = 5, score = 2500 // e8???????? | // 85c0 | test eax, eax // 750e | jne 0x10 // 33ff | xor edi, edi // 8bc7 | mov eax, edi $sequence_9 = { 5f 5e 5b c3 85ff 7418 } // n = 6, score = 2500 // 5f | pop edi // 5e | pop esi // 5b | pop ebx // c3 | ret // 85ff | test edi, edi // 7418 | je 0x1a $sequence_10 = { 753c b980000000 e8???????? 85c0 a3???????? 7504 33c0 } // n = 7, score = 2500 // 753c | mov dword ptr [ebp - 0x44], 1 // b980000000 | mov dword ptr [ebp - 0x40], 0 // e8???????? | // 85c0 | push 0 // a3???????? | // 7504 | push 0 // 33c0 | lea edx, [ebp - 0x54] $sequence_11 = { 5e 5b c3 83fb01 7405 83fb02 } // n = 6, score = 2500 // 5e | pop esi // 5b | pop ebx // c3 | ret // 83fb01 | cmp ebx, 1 // 7405 | je 7 // 83fb02 | cmp ebx, 2 $sequence_12 = { 33d2 b9e8030000 f7f1 83f805 } // n = 4, score = 2300 // 33d2 | mov ebx, ecx // b9e8030000 | xor esi, esi // f7f1 | test eax, eax // 83f805 | jne 6 $sequence_13 = { c9 c3 3ac8 7606 8ad1 } // n = 5, score = 1900 // c9 | xor esi, esi // c3 | mov ecx, 0x80 // 3ac8 | test eax, eax // 7606 | jne 8 // 8ad1 | xor eax, eax $sequence_14 = { d2e0 0802 ff45f8 837df808 7c0b 8a041f 47 } // n = 7, score = 1900 // d2e0 | push edi // 0802 | mov ebx, ecx // ff45f8 | xor esi, esi // 837df808 | mov ecx, 0x80 // 7c0b | test eax, eax // 8a041f | jne 0xd // 47 | xor eax, eax $sequence_15 = { e8???????? 83c410 85c0 7517 ff7520 ff751c } // n = 6, score = 1900 // e8???????? | // 83c410 | cmp eax, 1 // 85c0 | mov ecx, dword ptr [ecx] // 7517 | jne 0x3e // ff7520 | mov ecx, 0x80 // ff751c | test eax, eax $sequence_16 = { 7407 33c0 e9???????? ff15???????? e9???????? } // n = 5, score = 1900 // 7407 | test eax, eax // 33c0 | jne 8 // e9???????? | // ff15???????? | // e9???????? | $sequence_17 = { 7f07 e8???????? eb26 83c0ff } // n = 4, score = 1200 // 7f07 | jg 9 // e8???????? | // eb26 | jmp 0x28 // 83c0ff | add eax, -1 $sequence_18 = { e8???????? eb6d e8???????? 85c0 } // n = 4, score = 1200 // e8???????? | // eb6d | jmp 0x6f // e8???????? | // 85c0 | test eax, eax $sequence_19 = { e8???????? 33db 3bc3 741a } // n = 4, score = 1200 // e8???????? | // 33db | xor ebx, ebx // 3bc3 | cmp eax, ebx // 741a | je 0x1c $sequence_20 = { e8???????? 8bc7 eb0e 4883c108 e8???????? b801005921 } // n = 6, score = 1100 // e8???????? | // 8bc7 | mov ebp, dword ptr [esp + 0x38] // eb0e | dec eax // 4883c108 | mov esi, dword ptr [esp + 0x40] // e8???????? | // b801005921 | call dword ptr [eax + 0x64] $sequence_21 = { 85c0 7564 488b0b 488b01 } // n = 4, score = 1100 // 85c0 | je 0x1c // 7564 | test eax, eax // 488b0b | jne 0x66 // 488b01 | dec eax $sequence_22 = { ff5024 488d4d08 e8???????? 488d4d08 e8???????? 488bcd } // n = 6, score = 1100 // ff5024 | mov eax, edi // 488d4d08 | jmp 0x10 // e8???????? | // 488d4d08 | dec eax // e8???????? | // 488bcd | add ecx, 8 $sequence_23 = { ff501c 488d4d08 e8???????? 498bce e8???????? 48832700 ba02000000 } // n = 7, score = 1100 // ff501c | mov ecx, dword ptr [esi] // 488d4d08 | dec eax // e8???????? | // 498bce | add ecx, 8 // e8???????? | // 48832700 | dec eax // ba02000000 | mov ebx, dword ptr [esp + 0x30] $sequence_24 = { ff5064 488b0e 4883c108 e8???????? 488b5c2430 488b6c2438 488b742440 } // n = 7, score = 1100 // ff5064 | mov ecx, dword ptr [ebx] // 488b0e | dec eax // 4883c108 | mov eax, dword ptr [ecx] // e8???????? | // 488b5c2430 | call dword ptr [eax + 0x64] // 488b6c2438 | dec eax // 488b742440 | mov ecx, dword ptr [esi] $sequence_25 = { 83781400 750a b865005921 e9???????? } // n = 4, score = 900 // 83781400 | lea ecx, [ebp + 8] // 750a | call dword ptr [eax + 0x24] // b865005921 | dec eax // e9???????? | $sequence_26 = { 8bec 56 6a00 6880000000 6a03 6a00 6a03 } // n = 7, score = 800 // 8bec | sub eax, 1 // 56 | mov eax, dword ptr [esp + 0x38] // 6a00 | test eax, eax // 6880000000 | jne 0x87 // 6a03 | test eax, eax // 6a00 | jle 0x9c // 6a03 | pop ebx $sequence_27 = { 83feff 7505 33c0 5e 5d c3 8b4d08 } // n = 7, score = 800 // 83feff | cmp ebx, 3 // 7505 | jne 0x42 // 33c0 | ret // 5e | test ebx, ebx // 5d | je 0xa // c3 | cmp ebx, 3 // 8b4d08 | cmp eax, 1 $sequence_28 = { 6a03 68000000c0 50 ff15???????? 8bf0 83feff 7505 } // n = 7, score = 800 // 6a03 | xor eax, eax // 68000000c0 | cmp esi, -1 // 50 | jne 0xa // ff15???????? | // 8bf0 | xor eax, eax // 83feff | pop esi // 7505 | pop ebp $sequence_29 = { 83c0fe 668b4802 83c002 663bcb 75f4 8b15???????? 8b0d???????? } // n = 7, score = 800 // 83c0fe | test eax, eax // 668b4802 | jne 0x1b // 83c002 | push dword ptr [ebp + 0x20] // 663bcb | push dword ptr [ebp + 0x1c] // 75f4 | jmp 0x10 // 8b15???????? | // 8b0d???????? | $sequence_30 = { 8908 8b0d???????? 895004 894808 33c0 } // n = 5, score = 800 // 8908 | mov dl, cl // 8b0d???????? | // 895004 | mov cl, al // 894808 | mov al, dl // 33c0 | add esp, 0x10 $sequence_31 = { c3 8b4d08 57 51 6a00 } // n = 5, score = 800 // c3 | jle 0x94 // 8b4d08 | sub eax, 1 // 57 | jne 0x81 // 51 | test eax, eax // 6a00 | jle 0x96 $sequence_32 = { 6689440ffc 6685c0 75ee f685c003000010 } // n = 4, score = 800 // 6689440ffc | mov ecx, 0x80 // 6685c0 | test eax, eax // 75ee | mov eax, dword ptr [esp + 8] // f685c003000010 | test eax, eax $sequence_33 = { 8d45e8 50 6a00 6aff e8???????? 85c0 } // n = 6, score = 800 // 8d45e8 | lea ecx, [ebp + 8] // 50 | dec ecx // 6a00 | mov ecx, esi // 6aff | dec eax // e8???????? | // 85c0 | and dword ptr [edi], 0 $sequence_34 = { 68???????? 51 ffd6 83c40c 6a28 } // n = 5, score = 800 // 68???????? | // 51 | ret // ffd6 | mov ecx, dword ptr [ebp + 8] // 83c40c | add eax, 2 // 6a28 | cmp cx, bx $sequence_35 = { ff15???????? 83f87a 740b 3d230000c0 } // n = 4, score = 800 // ff15???????? | // 83f87a | cmp eax, 1 // 740b | mov ecx, dword ptr [ecx] // 3d230000c0 | jne 0x3e $sequence_36 = { 8b7d0c 3bc3 7508 3bfb } // n = 4, score = 800 // 8b7d0c | ret // 3bc3 | test edi, edi // 7508 | je 0x1d // 3bfb | pop ebx $sequence_37 = { ff15???????? 488bcf ff15???????? 41b701 } // n = 4, score = 700 // ff15???????? | // 488bcf | test eax, eax // ff15???????? | // 41b701 | test al, al $sequence_38 = { 48894c2450 4c89642448 488d4c2468 48894c2440 4c89642438 } // n = 5, score = 700 // 48894c2450 | jne 0x12 // 4c89642448 | jle 0x32 // 488d4c2468 | mov ecx, dword ptr [ecx] // 48894c2440 | jne 0x3e // 4c89642438 | mov ecx, 0x80 $sequence_39 = { 75e8 85f6 74e4 418936 b801000000 4881c4480d0000 } // n = 6, score = 700 // 75e8 | mov ecx, esi // 85f6 | mov ecx, 0x14 // 74e4 | test al, al // 418936 | cmovne edi, ecx // b801000000 | dec eax // 4881c4480d0000 | mov ecx, esi $sequence_40 = { 48f7d1 66837c4bfc5c 7413 488bfb 4883c9ff 66f2af 8b05???????? } // n = 7, score = 700 // 48f7d1 | mov ecx, 0x14 // 66837c4bfc5c | test al, al // 7413 | cmovne edi, ecx // 488bfb | dec eax // 4883c9ff | mov ecx, esi // 66f2af | mov edx, edi // 8b05???????? | $sequence_41 = { 8d8588feffff 68???????? 50 ff15???????? 83c42c } // n = 5, score = 700 // 8d8588feffff | ret // 68???????? | // 50 | test ebx, ebx // ff15???????? | // 83c42c | je 0xb $sequence_42 = { b914000000 84c0 0f45f9 488bce } // n = 4, score = 700 // b914000000 | test eax, eax // 84c0 | mov eax, dword ptr [esp + 8] // 0f45f9 | test eax, eax // 488bce | jne 0x12 $sequence_43 = { 488bce 8bd7 ff15???????? 85c0 } // n = 4, score = 700 // 488bce | div ecx // 8bd7 | cmp eax, 5 // ff15???????? | // 85c0 | cmp eax, 0x7a $sequence_44 = { 7507 32c0 e9???????? c745b818000000 } // n = 4, score = 600 // 7507 | mov ecx, dword ptr [esi] // 32c0 | cmp dword ptr [eax + 0x14], 0 // e9???????? | // c745b818000000 | jne 0xc $sequence_45 = { 668b08 83c002 6685c9 75f5 2bc2 d1f8 66837c43fe5c } // n = 7, score = 500 // 668b08 | pop ebx // 83c002 | ret // 6685c9 | test edi, edi // 75f5 | je 0x1e // 2bc2 | pop ebx // d1f8 | ret // 66837c43fe5c | test ebx, ebx $sequence_46 = { 05a1000000 50 8d84249c0d0000 68???????? } // n = 4, score = 300 // 05a1000000 | test edi, edi // 50 | je 0x1e // 8d84249c0d0000 | pop esi // 68???????? | $sequence_47 = { 0f8456feffff 807c241301 6800080000 0f8544020000 } // n = 4, score = 300 // 0f8456feffff | push eax // 807c241301 | call esi // 6800080000 | add eax, 0xa1 // 0f8544020000 | push eax $sequence_48 = { 0f8431ffffff 8b4d08 5f 8931 } // n = 4, score = 300 // 0f8431ffffff | cmp word ptr [ebx + eax*2 - 2], 0x5c // 8b4d08 | test cx, cx // 5f | jne 0xfffffffa // 8931 | sub eax, edx $sequence_49 = { 0f84100f0000 6800080000 57 56 } // n = 4, score = 300 // 0f84100f0000 | pop ebx // 6800080000 | ret // 57 | cmp ebx, 1 // 56 | je 0xc $sequence_50 = { 05a2000000 50 8d94249c0d0000 68???????? } // n = 4, score = 300 // 05a2000000 | pop ebx // 50 | ret // 8d94249c0d0000 | test ebx, ebx // 68???????? | $sequence_51 = { 05a2000000 50 8d8c249c0d0000 68???????? } // n = 4, score = 300 // 05a2000000 | test ebx, ebx // 50 | je 0xb // 8d8c249c0d0000 | jne 0x1e // 68???????? | $sequence_52 = { 668cc8 c3 53 50 } // n = 4, score = 200 // 668cc8 | push -1 // c3 | test eax, eax // 53 | lea eax, [ebp - 0x18] // 50 | push eax $sequence_53 = { 85c0 740a b8050000c0 e9???????? } // n = 4, score = 200 // 85c0 | push 0 // 740a | push -1 // b8050000c0 | test eax, eax // e9???????? | $sequence_54 = { c745bc04390100 66c745d81800 66c745da1a00 c745dc10390100 } // n = 4, score = 100 // c745bc04390100 | add eax, edx // 66c745d81800 | adc ecx, esi // 66c745da1a00 | push ecx // c745dc10390100 | xor esi, esi $sequence_55 = { c745bc01000000 c745c000000000 6a00 6a00 8d55ac 52 } // n = 6, score = 100 // c745bc01000000 | push 0 // c745c000000000 | push -1 // 6a00 | test eax, eax // 6a00 | je 0xb // 8d55ac | push eax // 52 | push 0 condition: 7 of them and filesize < 1368064 }
rule win_cobra_w0 { meta: author = "ESET Research" source = "https://www.welivesecurity.com/2017/03/30/carbon-paper-peering-turlas-second-stage-backdoor/#_footnote_2" malpedia_reference = "https://malpedia.caad.fkie.fraunhofer.de/details/win.cobra" malpedia_version = "20170512" malpedia_sharing = "TLP:WHITE" malpedia_license = "" strings: $s1 = "ModStart" $s2 = "ModuleStart" $t1 = "STOP|OK" $t2 = "STOP|KILL" condition: (uint16(0) == 0x5a4d) and (1 of ($s*)) and (1 of ($t*)) }
import "pe" rule win_cobra_w1 { meta: author = "ESET Research" source = "https://www.welivesecurity.com/2017/03/30/carbon-paper-peering-turlas-second-stage-backdoor/#_footnote_2" malpedia_reference = "https://malpedia.caad.fkie.fraunhofer.de/details/win.cobra" malpedia_version = "20170512" malpedia_sharing = "TLP:WHITE" malpedia_license = "" condition: (pe.version_info["InternalName"] contains "SERVICE.EXE" or pe.version_info["InternalName"] contains "MSIMGHLP.DLL" or pe.version_info["InternalName"] contains "MSXIML.DLL") and pe.version_info["CompanyName"] contains "Microsoft Corporation" }
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