rule win_shifu_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.shifu."
        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.shifu"
        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 = { 740a c74618d4d53602 894d18 ff7508 ff7628 ff5624 8b4518 }
            // n = 7, score = 100
            //   740a                 | je                  0xc
            //   c74618d4d53602       | mov                 dword ptr [esi + 0x18], 0x236d5d4
            //   894d18               | mov                 dword ptr [ebp + 0x18], ecx
            //   ff7508               | push                dword ptr [ebp + 8]
            //   ff7628               | push                dword ptr [esi + 0x28]
            //   ff5624               | call                dword ptr [esi + 0x24]
            //   8b4518               | mov                 eax, dword ptr [ebp + 0x18]

        $sequence_1 = { 55 8bec 83ec10 8b423c 53 03c2 56 }
            // n = 7, score = 100
            //   55                   | push                ebp
            //   8bec                 | mov                 ebp, esp
            //   83ec10               | sub                 esp, 0x10
            //   8b423c               | mov                 eax, dword ptr [edx + 0x3c]
            //   53                   | push                ebx
            //   03c2                 | add                 eax, edx
            //   56                   | push                esi

        $sequence_2 = { e8???????? 6a02 68???????? 6a01 53 }
            // n = 5, score = 100
            //   e8????????           |                     
            //   6a02                 | push                2
            //   68????????           |                     
            //   6a01                 | push                1
            //   53                   | push                ebx

        $sequence_3 = { bf00800000 57 53 ff35???????? ffd6 57 53 }
            // n = 7, score = 100
            //   bf00800000           | mov                 edi, 0x8000
            //   57                   | push                edi
            //   53                   | push                ebx
            //   ff35????????         |                     
            //   ffd6                 | call                esi
            //   57                   | push                edi
            //   53                   | push                ebx

        $sequence_4 = { 7437 6a0c 58 e8???????? 8bc4 85c0 7411 }
            // n = 7, score = 100
            //   7437                 | je                  0x39
            //   6a0c                 | push                0xc
            //   58                   | pop                 eax
            //   e8????????           |                     
            //   8bc4                 | mov                 eax, esp
            //   85c0                 | test                eax, eax
            //   7411                 | je                  0x13

        $sequence_5 = { e8???????? 894508 3bc3 740b 57 e8???????? 8b4508 }
            // n = 7, score = 100
            //   e8????????           |                     
            //   894508               | mov                 dword ptr [ebp + 8], eax
            //   3bc3                 | cmp                 eax, ebx
            //   740b                 | je                  0xd
            //   57                   | push                edi
            //   e8????????           |                     
            //   8b4508               | mov                 eax, dword ptr [ebp + 8]

        $sequence_6 = { 57 40 50 6800000080 ff7508 8d4df8 8945e8 }
            // n = 7, score = 100
            //   57                   | push                edi
            //   40                   | inc                 eax
            //   50                   | push                eax
            //   6800000080           | push                0x80000000
            //   ff7508               | push                dword ptr [ebp + 8]
            //   8d4df8               | lea                 ecx, [ebp - 8]
            //   8945e8               | mov                 dword ptr [ebp - 0x18], eax

        $sequence_7 = { c645ff01 eb4a 807dff00 740f 8bf3 e8???????? 85c0 }
            // n = 7, score = 100
            //   c645ff01             | mov                 byte ptr [ebp - 1], 1
            //   eb4a                 | jmp                 0x4c
            //   807dff00             | cmp                 byte ptr [ebp - 1], 0
            //   740f                 | je                  0x11
            //   8bf3                 | mov                 esi, ebx
            //   e8????????           |                     
            //   85c0                 | test                eax, eax

        $sequence_8 = { 8d85f8feffff 57 50 ffd3 83c410 8d85f8feffff 50 }
            // n = 7, score = 100
            //   8d85f8feffff         | lea                 eax, [ebp - 0x108]
            //   57                   | push                edi
            //   50                   | push                eax
            //   ffd3                 | call                ebx
            //   83c410               | add                 esp, 0x10
            //   8d85f8feffff         | lea                 eax, [ebp - 0x108]
            //   50                   | push                eax

        $sequence_9 = { 8d85e4feffff 50 ff15???????? 85c0 7465 6a00 }
            // n = 6, score = 100
            //   8d85e4feffff         | lea                 eax, [ebp - 0x11c]
            //   50                   | push                eax
            //   ff15????????         |                     
            //   85c0                 | test                eax, eax
            //   7465                 | je                  0x67
            //   6a00                 | push                0

    condition:
        7 of them and filesize < 344064
}