rule win_aurora_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.aurora."
        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.aurora"
        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 = { 8d8dacf0ffff c785c0f0ffff0f000000 c785bcf0ffff00000000 c685acf0ffff00 }
            // n = 4, score = 300
            //   8d8dacf0ffff         | lea                 ecx, [ebp - 0xf54]
            //   c785c0f0ffff0f000000     | mov    dword ptr [ebp - 0xf40], 0xf
            //   c785bcf0ffff00000000     | mov    dword ptr [ebp - 0xf44], 0
            //   c685acf0ffff00       | mov                 byte ptr [ebp - 0xf54], 0

        $sequence_1 = { 8b45d0 0f434dc0 0f435dc0 c7458c0f000000 c7458800000000 8d3441 }
            // n = 6, score = 300
            //   8b45d0               | mov                 eax, dword ptr [ebp - 0x30]
            //   0f434dc0             | cmovae              ecx, dword ptr [ebp - 0x40]
            //   0f435dc0             | cmovae              ebx, dword ptr [ebp - 0x40]
            //   c7458c0f000000       | mov                 dword ptr [ebp - 0x74], 0xf
            //   c7458800000000       | mov                 dword ptr [ebp - 0x78], 0
            //   8d3441               | lea                 esi, [ecx + eax*2]

        $sequence_2 = { 8b4004 f6840504ffffff06 7414 8d8d70ffffff e8???????? c645fc02 e9???????? }
            // n = 7, score = 300
            //   8b4004               | mov                 eax, dword ptr [eax + 4]
            //   f6840504ffffff06     | test                byte ptr [ebp + eax - 0xfc], 6
            //   7414                 | je                  0x16
            //   8d8d70ffffff         | lea                 ecx, [ebp - 0x90]
            //   e8????????           |                     
            //   c645fc02             | mov                 byte ptr [ebp - 4], 2
            //   e9????????           |                     

        $sequence_3 = { 7332 51 57 8bce }
            // n = 4, score = 300
            //   7332                 | jae                 0x34
            //   51                   | push                ecx
            //   57                   | push                edi
            //   8bce                 | mov                 ecx, esi

        $sequence_4 = { 8bc6 6a0c 68???????? 8bce c60000 e8???????? }
            // n = 6, score = 300
            //   8bc6                 | mov                 eax, esi
            //   6a0c                 | push                0xc
            //   68????????           |                     
            //   8bce                 | mov                 ecx, esi
            //   c60000               | mov                 byte ptr [eax], 0
            //   e8????????           |                     

        $sequence_5 = { 83c601 7443 8d8decfbffff 8d5102 668b01 83c102 6685c0 }
            // n = 7, score = 300
            //   83c601               | add                 esi, 1
            //   7443                 | je                  0x45
            //   8d8decfbffff         | lea                 ecx, [ebp - 0x414]
            //   8d5102               | lea                 edx, [ecx + 2]
            //   668b01               | mov                 ax, word ptr [ecx]
            //   83c102               | add                 ecx, 2
            //   6685c0               | test                ax, ax

        $sequence_6 = { 56 8b7508 ba00010000 0f1f00 }
            // n = 4, score = 300
            //   56                   | push                esi
            //   8b7508               | mov                 esi, dword ptr [ebp + 8]
            //   ba00010000           | mov                 edx, 0x100
            //   0f1f00               | nop                 dword ptr [eax]

        $sequence_7 = { c785c8f1ffff0f000000 c785c4f1ffff00000000 c685b4f1ffff00 e8???????? 8d8dccf1ffff }
            // n = 5, score = 300
            //   c785c8f1ffff0f000000     | mov    dword ptr [ebp - 0xe38], 0xf
            //   c785c4f1ffff00000000     | mov    dword ptr [ebp - 0xe3c], 0
            //   c685b4f1ffff00       | mov                 byte ptr [ebp - 0xe4c], 0
            //   e8????????           |                     
            //   8d8dccf1ffff         | lea                 ecx, [ebp - 0xe34]

        $sequence_8 = { e8???????? 68???????? c645fc01 e8???????? 8bd0 c745ec07000000 33c0 }
            // n = 7, score = 300
            //   e8????????           |                     
            //   68????????           |                     
            //   c645fc01             | mov                 byte ptr [ebp - 4], 1
            //   e8????????           |                     
            //   8bd0                 | mov                 edx, eax
            //   c745ec07000000       | mov                 dword ptr [ebp - 0x14], 7
            //   33c0                 | xor                 eax, eax

        $sequence_9 = { 8d4dd4 e8???????? 8b35???????? 8bd8 8b3d???????? c745f003000000 3bf7 }
            // n = 7, score = 300
            //   8d4dd4               | lea                 ecx, [ebp - 0x2c]
            //   e8????????           |                     
            //   8b35????????         |                     
            //   8bd8                 | mov                 ebx, eax
            //   8b3d????????         |                     
            //   c745f003000000       | mov                 dword ptr [ebp - 0x10], 3
            //   3bf7                 | cmp                 esi, edi

    condition:
        7 of them and filesize < 827392
}