rule win_globeimposter_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.globeimposter."
        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.globeimposter"
        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 = { c1e810 8bca c1e908 23c7 23cf }
            // n = 5, score = 700
            //   c1e810               | shr                 eax, 0x10
            //   8bca                 | mov                 ecx, edx
            //   c1e908               | shr                 ecx, 8
            //   23c7                 | and                 eax, edi
            //   23cf                 | and                 ecx, edi

        $sequence_1 = { 1bdb 45 83c104 f7db 75d7 }
            // n = 5, score = 700
            //   1bdb                 | sbb                 ebx, ebx
            //   45                   | inc                 ebp
            //   83c104               | add                 ecx, 4
            //   f7db                 | neg                 ebx
            //   75d7                 | jne                 0xffffffd9

        $sequence_2 = { 6af2 58 eb03 33c0 }
            // n = 4, score = 700
            //   6af2                 | push                -0xe
            //   58                   | pop                 eax
            //   eb03                 | jmp                 5
            //   33c0                 | xor                 eax, eax

        $sequence_3 = { 0f6e670c 0fd4fc 0f7e0f 0f6e5610 0ff4d0 }
            // n = 5, score = 700
            //   0f6e670c             | movd                mm4, dword ptr [edi + 0xc]
            //   0fd4fc               | paddq               mm7, mm4
            //   0f7e0f               | movd                dword ptr [edi], mm1
            //   0f6e5610             | movd                mm2, dword ptr [esi + 0x10]
            //   0ff4d0               | pmuludq             mm2, mm0

        $sequence_4 = { ff7514 85c0 750b ff15???????? 6ac4 58 }
            // n = 6, score = 700
            //   ff7514               | push                dword ptr [ebp + 0x14]
            //   85c0                 | test                eax, eax
            //   750b                 | jne                 0xd
            //   ff15????????         |                     
            //   6ac4                 | push                -0x3c
            //   58                   | pop                 eax

        $sequence_5 = { ff15???????? 85c0 7405 3975fc 7405 6afe 58 }
            // n = 7, score = 700
            //   ff15????????         |                     
            //   85c0                 | test                eax, eax
            //   7405                 | je                  7
            //   3975fc               | cmp                 dword ptr [ebp - 4], esi
            //   7405                 | je                  7
            //   6afe                 | push                -2
            //   58                   | pop                 eax

        $sequence_6 = { 7426 8bc5 c1e002 50 ff7608 53 }
            // n = 6, score = 700
            //   7426                 | je                  0x28
            //   8bc5                 | mov                 eax, ebp
            //   c1e002               | shl                 eax, 2
            //   50                   | push                eax
            //   ff7608               | push                dword ptr [esi + 8]
            //   53                   | push                ebx

        $sequence_7 = { 50 ffb63c010000 ff9638010000 85c0 }
            // n = 4, score = 700
            //   50                   | push                eax
            //   ffb63c010000         | push                dword ptr [esi + 0x13c]
            //   ff9638010000         | call                dword ptr [esi + 0x138]
            //   85c0                 | test                eax, eax

        $sequence_8 = { 8d4e7c 8b41fc 3b01 8d4914 1bc0 f7d0 23d8 }
            // n = 7, score = 700
            //   8d4e7c               | lea                 ecx, [esi + 0x7c]
            //   8b41fc               | mov                 eax, dword ptr [ecx - 4]
            //   3b01                 | cmp                 eax, dword ptr [ecx]
            //   8d4914               | lea                 ecx, [ecx + 0x14]
            //   1bc0                 | sbb                 eax, eax
            //   f7d0                 | not                 eax
            //   23d8                 | and                 ebx, eax

        $sequence_9 = { c745f401000000 2bc2 8945fc 33c0 }
            // n = 4, score = 700
            //   c745f401000000       | mov                 dword ptr [ebp - 0xc], 1
            //   2bc2                 | sub                 eax, edx
            //   8945fc               | mov                 dword ptr [ebp - 4], eax
            //   33c0                 | xor                 eax, eax

    condition:
        7 of them and filesize < 327680
}