SYMBOLCOMMON_NAMEaka. SYNONYMS
win.cosmicduke (Back to overview)

CosmicDuke

Actor(s): APT29

VTCollection    

There is no description at this point.

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

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-05-04"
        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 = "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 = { 50 68905b0100 8d8554a4feff 50 ff75f4 ff15???????? 8bd8 }
            // n = 7, score = 100
            //   50                   | push                eax
            //   68905b0100           | push                0x15b90
            //   8d8554a4feff         | lea                 eax, [ebp - 0x15bac]
            //   50                   | push                eax
            //   ff75f4               | push                dword ptr [ebp - 0xc]
            //   ff15????????         |                     
            //   8bd8                 | mov                 ebx, eax

        $sequence_1 = { ff5108 ebaa 837c242028 8b442414 8b08 7d33 }
            // n = 6, score = 100
            //   ff5108               | call                dword ptr [ecx + 8]
            //   ebaa                 | jmp                 0xffffffac
            //   837c242028           | cmp                 dword ptr [esp + 0x20], 0x28
            //   8b442414             | mov                 eax, dword ptr [esp + 0x14]
            //   8b08                 | mov                 ecx, dword ptr [eax]
            //   7d33                 | jge                 0x35

        $sequence_2 = { 7f4b 3bf3 7508 c744241001000000 017c2410 391d???????? 7509 }
            // n = 7, score = 100
            //   7f4b                 | jg                  0x4d
            //   3bf3                 | cmp                 esi, ebx
            //   7508                 | jne                 0xa
            //   c744241001000000     | mov                 dword ptr [esp + 0x10], 1
            //   017c2410             | add                 dword ptr [esp + 0x10], edi
            //   391d????????         |                     
            //   7509                 | jne                 0xb

        $sequence_3 = { 8365f400 53 56 57 8bf0 8d45f8 50 }
            // n = 7, score = 100
            //   8365f400             | and                 dword ptr [ebp - 0xc], 0
            //   53                   | push                ebx
            //   56                   | push                esi
            //   57                   | push                edi
            //   8bf0                 | mov                 esi, eax
            //   8d45f8               | lea                 eax, [ebp - 8]
            //   50                   | push                eax

        $sequence_4 = { e8???????? 68???????? e8???????? 59 834dfcff 8b4df4 b8???????? }
            // n = 7, score = 100
            //   e8????????           |                     
            //   68????????           |                     
            //   e8????????           |                     
            //   59                   | pop                 ecx
            //   834dfcff             | or                  dword ptr [ebp - 4], 0xffffffff
            //   8b4df4               | mov                 ecx, dword ptr [ebp - 0xc]
            //   b8????????           |                     

        $sequence_5 = { 57 e8???????? 83c40c 84c0 0f84f3020000 8b742428 d1ee }
            // n = 7, score = 100
            //   57                   | push                edi
            //   e8????????           |                     
            //   83c40c               | add                 esp, 0xc
            //   84c0                 | test                al, al
            //   0f84f3020000         | je                  0x2f9
            //   8b742428             | mov                 esi, dword ptr [esp + 0x28]
            //   d1ee                 | shr                 esi, 1

        $sequence_6 = { 8b0437 ebf2 85ff 743a 837c240400 7433 8b8680080000 }
            // n = 7, score = 100
            //   8b0437               | mov                 eax, dword ptr [edi + esi]
            //   ebf2                 | jmp                 0xfffffff4
            //   85ff                 | test                edi, edi
            //   743a                 | je                  0x3c
            //   837c240400           | cmp                 dword ptr [esp + 4], 0
            //   7433                 | je                  0x35
            //   8b8680080000         | mov                 eax, dword ptr [esi + 0x880]

        $sequence_7 = { e9???????? 8d8568efffff 50 e8???????? c3 8db558efffff }
            // n = 6, score = 100
            //   e9????????           |                     
            //   8d8568efffff         | lea                 eax, [ebp - 0x1098]
            //   50                   | push                eax
            //   e8????????           |                     
            //   c3                   | ret                 
            //   8db558efffff         | lea                 esi, [ebp - 0x10a8]

        $sequence_8 = { 53 53 6a1c 53 ffd6 85c0 750b }
            // n = 7, score = 100
            //   53                   | push                ebx
            //   53                   | push                ebx
            //   6a1c                 | push                0x1c
            //   53                   | push                ebx
            //   ffd6                 | call                esi
            //   85c0                 | test                eax, eax
            //   750b                 | jne                 0xd

        $sequence_9 = { eb8a 8b45e4 8b08 8d55e0 52 68???????? 50 }
            // n = 7, score = 100
            //   eb8a                 | jmp                 0xffffff8c
            //   8b45e4               | mov                 eax, dword ptr [ebp - 0x1c]
            //   8b08                 | mov                 ecx, dword ptr [eax]
            //   8d55e0               | lea                 edx, [ebp - 0x20]
            //   52                   | push                edx
            //   68????????           |                     
            //   50                   | push                eax

    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