rule win_glupteba_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.glupteba."
        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.glupteba"
        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 = { 3c33 0f8583000000 0fb745fb 50 e8???????? 8bd8 }
            // n = 6, score = 400
            //   3c33                 | cmp                 al, 0x33
            //   0f8583000000         | jne                 0x89
            //   0fb745fb             | movzx               eax, word ptr [ebp - 5]
            //   50                   | push                eax
            //   e8????????           |                     
            //   8bd8                 | mov                 ebx, eax

        $sequence_1 = { 8ad8 59 3a5dff 73d8 84db }
            // n = 5, score = 400
            //   8ad8                 | mov                 bl, al
            //   59                   | pop                 ecx
            //   3a5dff               | cmp                 bl, byte ptr [ebp - 1]
            //   73d8                 | jae                 0xffffffda
            //   84db                 | test                bl, bl

        $sequence_2 = { c9 c3 56 57 6a00 be???????? }
            // n = 6, score = 400
            //   c9                   | leave               
            //   c3                   | ret                 
            //   56                   | push                esi
            //   57                   | push                edi
            //   6a00                 | push                0
            //   be????????           |                     

        $sequence_3 = { e8???????? 6a10 8d45e0 68???????? 50 e8???????? }
            // n = 6, score = 400
            //   e8????????           |                     
            //   6a10                 | push                0x10
            //   8d45e0               | lea                 eax, [ebp - 0x20]
            //   68????????           |                     
            //   50                   | push                eax
            //   e8????????           |                     

        $sequence_4 = { 84db 0f85bd000000 6aff ff35???????? }
            // n = 4, score = 400
            //   84db                 | test                bl, bl
            //   0f85bd000000         | jne                 0xc3
            //   6aff                 | push                -1
            //   ff35????????         |                     

        $sequence_5 = { 83c40c 395d0c 7e19 ff7510 ff750c }
            // n = 5, score = 400
            //   83c40c               | add                 esp, 0xc
            //   395d0c               | cmp                 dword ptr [ebp + 0xc], ebx
            //   7e19                 | jle                 0x1b
            //   ff7510               | push                dword ptr [ebp + 0x10]
            //   ff750c               | push                dword ptr [ebp + 0xc]

        $sequence_6 = { 83c40c 85c0 0f8418010000 8b35???????? 8065de00 57 }
            // n = 6, score = 400
            //   83c40c               | add                 esp, 0xc
            //   85c0                 | test                eax, eax
            //   0f8418010000         | je                  0x11e
            //   8b35????????         |                     
            //   8065de00             | and                 byte ptr [ebp - 0x22], 0
            //   57                   | push                edi

        $sequence_7 = { 56 57 8b7d08 68b4000000 57 }
            // n = 5, score = 400
            //   56                   | push                esi
            //   57                   | push                edi
            //   8b7d08               | mov                 edi, dword ptr [ebp + 8]
            //   68b4000000           | push                0xb4
            //   57                   | push                edi

        $sequence_8 = { 00cd 3e46 005e3e 46 }
            // n = 4, score = 100
            //   00cd                 | add                 ch, cl
            //   3e46                 | inc                 esi
            //   005e3e               | add                 byte ptr [esi + 0x3e], bl
            //   46                   | inc                 esi

        $sequence_9 = { 0106 830702 392e 75a0 }
            // n = 4, score = 100
            //   0106                 | add                 dword ptr [esi], eax
            //   830702               | add                 dword ptr [edi], 2
            //   392e                 | cmp                 dword ptr [esi], ebp
            //   75a0                 | jne                 0xffffffa2

        $sequence_10 = { 0012 3f 46 008bff558bec }
            // n = 4, score = 100
            //   0012                 | add                 byte ptr [edx], dl
            //   3f                   | aas                 
            //   46                   | inc                 esi
            //   008bff558bec         | add                 byte ptr [ebx - 0x1374aa01], cl

        $sequence_11 = { 0107 eb4d 8b02 89442418 }
            // n = 4, score = 100
            //   0107                 | add                 dword ptr [edi], eax
            //   eb4d                 | jmp                 0x4f
            //   8b02                 | mov                 eax, dword ptr [edx]
            //   89442418             | mov                 dword ptr [esp + 0x18], eax

        $sequence_12 = { 005e3e 46 00ff 3e46 }
            // n = 4, score = 100
            //   005e3e               | add                 byte ptr [esi + 0x3e], bl
            //   46                   | inc                 esi
            //   00ff                 | add                 bh, bh
            //   3e46                 | inc                 esi

        $sequence_13 = { 00ff 3e46 0012 3f }
            // n = 4, score = 100
            //   00ff                 | add                 bh, bh
            //   3e46                 | inc                 esi
            //   0012                 | add                 byte ptr [edx], dl
            //   3f                   | aas                 

        $sequence_14 = { 0101 03d3 8b4620 8bcb }
            // n = 4, score = 100
            //   0101                 | add                 dword ptr [ecx], eax
            //   03d3                 | add                 edx, ebx
            //   8b4620               | mov                 eax, dword ptr [esi + 0x20]
            //   8bcb                 | mov                 ecx, ebx

        $sequence_15 = { 00f1 3d46005e3e 46 00cd }
            // n = 4, score = 100
            //   00f1                 | add                 cl, dh
            //   3d46005e3e           | cmp                 eax, 0x3e5e0046
            //   46                   | inc                 esi
            //   00cd                 | add                 ch, cl

    condition:
        7 of them and filesize < 1417216
}