rule win_xpertrat_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.xpertrat."
        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.xpertrat"
        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 = { 007168 ff0468 ff0a 250004003c }
            // n = 4, score = 200
            //   007168               | add                 byte ptr [ecx + 0x68], dh
            //   ff0468               | inc                 dword ptr [eax + ebp*2]
            //   ff0a                 | dec                 dword ptr [edx]
            //   250004003c           | and                 eax, 0x3c000400

        $sequence_1 = { 00a1cc004400 0bc0 7402 ffe0 68???????? }
            // n = 5, score = 200
            //   00a1cc004400         | add                 byte ptr [ecx + 0x4400cc], ah
            //   0bc0                 | or                  eax, eax
            //   7402                 | je                  4
            //   ffe0                 | jmp                 eax
            //   68????????           |                     

        $sequence_2 = { 0d80000700 0474 ff0478 ff05???????? }
            // n = 4, score = 200
            //   0d80000700           | or                  eax, 0x70080
            //   0474                 | add                 al, 0x74
            //   ff0478               | inc                 dword ptr [eax + edi*2]
            //   ff05????????         |                     

        $sequence_3 = { 0000 ae 045c ff4d40 ff08 }
            // n = 5, score = 200
            //   0000                 | add                 byte ptr [eax], al
            //   ae                   | scasb               al, byte ptr es:[edi]
            //   045c                 | add                 al, 0x5c
            //   ff4d40               | dec                 dword ptr [ebp + 0x40]
            //   ff08                 | dec                 dword ptr [eax]

        $sequence_4 = { 70ff 0808 008a3800cc1c 5e }
            // n = 4, score = 200
            //   70ff                 | jo                  1
            //   0808                 | or                  byte ptr [eax], cl
            //   008a3800cc1c         | add                 byte ptr [edx + 0x1ccc0038], cl
            //   5e                   | pop                 esi

        $sequence_5 = { 5e 006c70ff 0808 008f38001b26 }
            // n = 4, score = 200
            //   5e                   | pop                 esi
            //   006c70ff             | add                 byte ptr [eax + esi*2 - 1], ch
            //   0808                 | or                  byte ptr [eax], cl
            //   008f38001b26         | add                 byte ptr [edi + 0x261b0038], cl

        $sequence_6 = { ff0478 ff05???????? 000d???????? 0878ff }
            // n = 4, score = 200
            //   ff0478               | inc                 dword ptr [eax + edi*2]
            //   ff05????????         |                     
            //   000d????????         |                     
            //   0878ff               | or                  byte ptr [eax - 1], bh

        $sequence_7 = { 0808 008f38001b26 001b 0d002a2364 ff08 }
            // n = 5, score = 200
            //   0808                 | or                  byte ptr [eax], cl
            //   008f38001b26         | add                 byte ptr [edi + 0x261b0038], cl
            //   001b                 | add                 byte ptr [ebx], bl
            //   0d002a2364           | or                  eax, 0x64232a00
            //   ff08                 | dec                 dword ptr [eax]

        $sequence_8 = { ff15???????? 83c40c 0fbf8d60ffffff 85c9 0f84c8010000 }
            // n = 5, score = 100
            //   ff15????????         |                     
            //   83c40c               | add                 esp, 0xc
            //   0fbf8d60ffffff       | movsx               ecx, word ptr [ebp - 0xa0]
            //   85c9                 | test                ecx, ecx
            //   0f84c8010000         | je                  0x1ce

        $sequence_9 = { ff15???????? 83c40c 0fbf851cffffff 85c0 }
            // n = 4, score = 100
            //   ff15????????         |                     
            //   83c40c               | add                 esp, 0xc
            //   0fbf851cffffff       | movsx               eax, word ptr [ebp - 0xe4]
            //   85c0                 | test                eax, eax

        $sequence_10 = { ff15???????? 83c378 8b4508 83c07c }
            // n = 4, score = 100
            //   ff15????????         |                     
            //   83c378               | add                 ebx, 0x78
            //   8b4508               | mov                 eax, dword ptr [ebp + 8]
            //   83c07c               | add                 eax, 0x7c

        $sequence_11 = { ff15???????? 83c40c 0fbf85c4feffff 85c0 }
            // n = 4, score = 100
            //   ff15????????         |                     
            //   83c40c               | add                 esp, 0xc
            //   0fbf85c4feffff       | movsx               eax, word ptr [ebp - 0x13c]
            //   85c0                 | test                eax, eax

        $sequence_12 = { ff15???????? 83c404 b903000000 8bdc }
            // n = 4, score = 100
            //   ff15????????         |                     
            //   83c404               | add                 esp, 4
            //   b903000000           | mov                 ecx, 3
            //   8bdc                 | mov                 ebx, esp

        $sequence_13 = { ff15???????? 83c40c 0fbf8558ffffff 85c0 }
            // n = 4, score = 100
            //   ff15????????         |                     
            //   83c40c               | add                 esp, 0xc
            //   0fbf8558ffffff       | movsx               eax, word ptr [ebp - 0xa8]
            //   85c0                 | test                eax, eax

        $sequence_14 = { ff15???????? 83c40c 0fbf4d9c 85c9 }
            // n = 4, score = 100
            //   ff15????????         |                     
            //   83c40c               | add                 esp, 0xc
            //   0fbf4d9c             | movsx               ecx, word ptr [ebp - 0x64]
            //   85c9                 | test                ecx, ecx

        $sequence_15 = { ff15???????? 83c40c 0fbf85d8feffff 85c0 }
            // n = 4, score = 100
            //   ff15????????         |                     
            //   83c40c               | add                 esp, 0xc
            //   0fbf85d8feffff       | movsx               eax, word ptr [ebp - 0x128]
            //   85c0                 | test                eax, eax

    condition:
        7 of them and filesize < 8560640
}