rule win_bumblebee_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.bumblebee."
        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.bumblebee"
        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 = { 57 4156 488dac24e0fcffff 4881ec20040000 488b05???????? }
            // n = 5, score = 3500
            //   57                   | dec                 ecx
            //   4156                 | mov                 eax, dword ptr [esi]
            //   488dac24e0fcffff     | dec                 eax
            //   4881ec20040000       | arpl                word ptr [eax + 4], cx
            //   488b05????????       |                     

        $sequence_1 = { 488bec 4881ec80000000 33db 4d8bf0 4c8bea 48895d48 8bf1 }
            // n = 7, score = 3500
            //   488bec               | sub                 esp, 0x30
            //   4881ec80000000       | dec                 eax
            //   33db                 | mov                 dword ptr [esp + 0x20], 0xfffffffe
            //   4d8bf0               | dec                 eax
            //   4c8bea               | mov                 dword ptr [esp + 0x50], ebx
            //   48895d48             | dec                 eax
            //   8bf1                 | mov                 ebx, ecx

        $sequence_2 = { 488b09 89ca 89d2 89d1 }
            // n = 4, score = 3500
            //   488b09               | cmp                 dword ptr [eax + 0x18], ebp
            //   89ca                 | jne                 0x14c9
            //   89d2                 | dec                 eax
            //   89d1                 | test                eax, eax

        $sequence_3 = { 8bd8 85c0 752c 448b45c0 }
            // n = 4, score = 3500
            //   8bd8                 | dec                 eax
            //   85c0                 | mov                 edx, dword ptr [esp + 0x98]
            //   752c                 | dec                 esp
            //   448b45c0             | mov                 dword ptr [eax + ecx*8 + 0x10], ecx

        $sequence_4 = { 4833c4 48898518030000 4c8bf1 33ff b900100000 e8???????? 488bd8 }
            // n = 7, score = 3500
            //   4833c4               | lea                 ecx, [0x221810]
            //   48898518030000       | dec                 eax
            //   4c8bf1               | lea                 edx, [ebp + 0x160]
            //   33ff                 | dec                 eax
            //   b900100000           | cmp                 dword ptr [ebp + 0x178], 0x10
            //   e8????????           |                     
            //   488bd8               | xor                 ecx, ecx

        $sequence_5 = { 0f84b5000000 488d4c2430 41b900100000 48894c2420 4c8bc3 }
            // n = 5, score = 3500
            //   0f84b5000000         | cmp                 byte ptr [esi + 0x57], 4
            //   488d4c2430           | jne                 0xc80
            //   41b900100000         | dec                 eax
            //   48894c2420           | mov                 dword ptr [ebp + 0x28], edx
            //   4c8bc3               | dec                 eax

        $sequence_6 = { 41b900100000 48894c2420 4c8bc3 498bce ffd0 85c0 7808 }
            // n = 7, score = 3500
            //   41b900100000         | add                 eax, 0x5d98c00
            //   48894c2420           | add                 byte ptr [ecx + ebx*8 - 0x2673fffb], cl
            //   4c8bc3               | add                 eax, 0x5d98c00
            //   498bce               | add                 byte ptr [ebp + 0x520005d8], al
            //   ffd0                 | add                 byte ptr [ecx + ebx*8 - 0x2673fffb], cl
            //   85c0                 | add                 eax, 0x5d98c00
            //   7808                 | add                 byte ptr [ebp + 0x520005d8], al

        $sequence_7 = { 498bce 488bd6 ffd0 85c0 }
            // n = 4, score = 3500
            //   498bce               | mov                 dword ptr [ecx + 8], 8
            //   488bd6               | dec                 eax
            //   ffd0                 | lea                 eax, [0x186c66]
            //   85c0                 | dec                 eax

        $sequence_8 = { 4881ec20040000 488b05???????? 4833c4 48898518030000 }
            // n = 4, score = 3500
            //   4881ec20040000       | mov                 eax, 0x401
            //   488b05????????       |                     
            //   4833c4               | inc                 esp
            //   48898518030000       | mov                 ecx, dword ptr [esi + eax*4 + 0xe0]

        $sequence_9 = { ff15???????? 488d4c2438 33d2 48894c2420 448d4f30 498bce 4c8d442440 }
            // n = 7, score = 3500
            //   ff15????????         |                     
            //   488d4c2438           | dec                 eax
            //   33d2                 | lea                 eax, [0x332ee]
            //   48894c2420           | dec                 eax
            //   448d4f30             | mov                 dword ptr [esp + 0x20], eax
            //   498bce               | dec                 eax
            //   4c8d442440           | lea                 edx, [0x98b6a]

    condition:
        7 of them and filesize < 4825088
}