SYMBOLCOMMON_NAMEaka. SYNONYMS
win.cosmicduke (Back to overview)

CosmicDuke

Actor(s): APT29

VTCollection    

There is no description at this point.

References
2025-05-10 ⋅ cocomelonc ⋅ cocomelonc
Malware development trick 47: simple Windows clipboard hijacking. Simple C example.
CosmicDuke RokRAT
2022-08-29 ⋅ Cyfirma ⋅ cyfirma
CosmicDuke Malware Analysis Report
CosmicDuke
2014-07-03 ⋅ F-Secure ⋅ F-Secure Labs
COSMICDUKE: Cosmu with a twist of MiniDuke
CosmicDuke
Yara Rules
[TLP:WHITE] win_cosmicduke_auto (20260917 | Detects win.cosmicduke.)
rule win_cosmicduke_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.cosmicduke."
        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.cosmicduke"
        malpedia_rule_date = "20260916"
        malpedia_hash = "53a643781c18e08f4a50949af60172d837a0b6f6"
        malpedia_version = "20260917"
        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 = { 53 8d84245c0d0000 50 8bc7 8d4c2430 e8???????? }
            // n = 6, score = 100
            //   53                   | push                ebx
            //   8d84245c0d0000       | lea                 eax, [esp + 0xd5c]
            //   50                   | push                eax
            //   8bc7                 | mov                 eax, edi
            //   8d4c2430             | lea                 ecx, [esp + 0x30]
            //   e8????????           |                     

        $sequence_1 = { 391d???????? 750d e8???????? 3ac3 0f84cc000000 53 ff15???????? }
            // n = 7, score = 100
            //   391d????????         |                     
            //   750d                 | jne                 0xf
            //   e8????????           |                     
            //   3ac3                 | cmp                 al, bl
            //   0f84cc000000         | je                  0xd2
            //   53                   | push                ebx
            //   ff15????????         |                     

        $sequence_2 = { 57 50 e8???????? 6a14 53 57 e8???????? }
            // n = 7, score = 100
            //   57                   | push                edi
            //   50                   | push                eax
            //   e8????????           |                     
            //   6a14                 | push                0x14
            //   53                   | push                ebx
            //   57                   | push                edi
            //   e8????????           |                     

        $sequence_3 = { 3bf8 7cda eb03 894df8 8b45f8 }
            // n = 5, score = 100
            //   3bf8                 | cmp                 edi, eax
            //   7cda                 | jl                  0xffffffdc
            //   eb03                 | jmp                 5
            //   894df8               | mov                 dword ptr [ebp - 8], ecx
            //   8b45f8               | mov                 eax, dword ptr [ebp - 8]

        $sequence_4 = { 2bc6 50 8b45e0 03c6 50 53 }
            // n = 6, score = 100
            //   2bc6                 | sub                 eax, esi
            //   50                   | push                eax
            //   8b45e0               | mov                 eax, dword ptr [ebp - 0x20]
            //   03c6                 | add                 eax, esi
            //   50                   | push                eax
            //   53                   | push                ebx

        $sequence_5 = { 6801000080 8d7c241c e8???????? 3ac3 0f84ac010000 8b442420 }
            // n = 6, score = 100
            //   6801000080           | push                0x80000001
            //   8d7c241c             | lea                 edi, [esp + 0x1c]
            //   e8????????           |                     
            //   3ac3                 | cmp                 al, bl
            //   0f84ac010000         | je                  0x1b2
            //   8b442420             | mov                 eax, dword ptr [esp + 0x20]

        $sequence_6 = { ff15???????? 85c0 7504 b001 c9 c3 68???????? }
            // n = 7, score = 100
            //   ff15????????         |                     
            //   85c0                 | test                eax, eax
            //   7504                 | jne                 6
            //   b001                 | mov                 al, 1
            //   c9                   | leave               
            //   c3                   | ret                 
            //   68????????           |                     

        $sequence_7 = { ff15???????? 8d85e4fdffff 50 ff15???????? 3d02010000 7326 68???????? }
            // n = 7, score = 100
            //   ff15????????         |                     
            //   8d85e4fdffff         | lea                 eax, [ebp - 0x21c]
            //   50                   | push                eax
            //   ff15????????         |                     
            //   3d02010000           | cmp                 eax, 0x102
            //   7326                 | jae                 0x28
            //   68????????           |                     

        $sequence_8 = { ff15???????? ff7508 8b3d???????? 8d859cebffff 50 ffd7 68???????? }
            // n = 7, score = 100
            //   ff15????????         |                     
            //   ff7508               | push                dword ptr [ebp + 8]
            //   8b3d????????         |                     
            //   8d859cebffff         | lea                 eax, [ebp - 0x1464]
            //   50                   | push                eax
            //   ffd7                 | call                edi
            //   68????????           |                     

        $sequence_9 = { 32c0 eb28 8b74240c 56 e8???????? 59 56 }
            // n = 7, score = 100
            //   32c0                 | xor                 al, al
            //   eb28                 | jmp                 0x2a
            //   8b74240c             | mov                 esi, dword ptr [esp + 0xc]
            //   56                   | push                esi
            //   e8????????           |                     
            //   59                   | pop                 ecx
            //   56                   | push                esi

    condition:
        7 of them and filesize < 456704
}
[TLP:WHITE] win_cosmicduke_w0   (20230118 | detect cosmicduke)
rule win_cosmicduke_w0 {
	meta:
	    description = "detect cosmicduke"
	    author = "@malgamy12"
        date = "2022-11-6"
	    license = "DRL 1.1"
	    hash_sample1 = "93054d3abc36019ccfe88f87363363e6ca9b77f4"
        hash_sample2 = "0eadbd6ef9f5930257530ac5a3b8abb49c9755d1"
        hash_sample3 = "69c2d292179dc615bfe4d7f880b5f9928604558e"
        hash_sample4 = "616306489de4029da7271eadbdf090cee22ae1af"
        hash_sample5 = "ecb8edfddd812a125b515dc42a2e93569c1caed9"
        hash_sample6 = "a86f3faf1eedb7325023616adf37a62c9129c24e"
        hash_sample7 = "4d22b2d85b75ccf651f0ba85808482660a440bff"
        hash_sample8 = "3463df6b33b26c1249207f6e004c0bbc31b31152"
        hash_sample9 = "ca4c53eb86d5b920b321de573e212e31405707d5"
        hash_sample10 = "a48e4dd017618ae2d46a753345594a5f57fbe869"
        malpedia_reference = "https://malpedia.caad.fkie.fraunhofer.de/details/win.cosmicduke"
        malpedia_rule_date = "20230118"
        malpedia_hash = ""
        malpedia_version = "20230118"
        malpedia_license = "DRL 1.1"
        malpedia_sharing = "TLP:WHITE"
    strings:
        $pdb = "5\\bin\\bot.pdb" ascii

        $s1 = "pipe\\40DC244D-F62E-093E-8A91-736FF2FA2AA2" wide
        $s2 = "LoginName" ascii	
        $s3 = "select id, hostname, usernamefield, passwordfield, encryptedusern" wide
        $s4 = "*temporary;*Cookies;*games;*system32;*program files;*\\windows\\;*\\System Volume Information" wide
        $s5 = "msicheck.cmd" ascii
        $s6 = "AppData\\Roaming\\Miranda"  wide 
        $s7 = "Local Settings\\Application Data" wide
	
	/*
	imul    ebx, esi
        imul    esi, 0BC8Fh
        mov     eax, edx
        and     eax, 3
        lea     eax, [ebp+eax*4+var_3C]
        xor     [eax], ebx
        inc     edx
        dec     [ebp+var_8]
	*/

        $chunk_1 = {0F AF DE 69 F6 ?? ?? ?? ?? 8B C2 83 E0 ?? 8D 44 85 ?? 31 18 42 FF 4D ??}   

    condition:
        uint16(0) == 0x5A4D and filesize > 70KB and ($pdb  or  (4 of ($s*) and $chunk_1 ))
}
Download all Yara Rules