rule win_zohomurk_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.zohomurk."
        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.zohomurk"
        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 = { 83ec0c 8b4508 53 56 57 8bf9 8b0f }
            // n = 7, score = 100
            //   83ec0c               | sub                 esp, 0xc
            //   8b4508               | mov                 eax, dword ptr [ebp + 8]
            //   53                   | push                ebx
            //   56                   | push                esi
            //   57                   | push                edi
            //   8bf9                 | mov                 edi, ecx
            //   8b0f                 | mov                 ecx, dword ptr [edi]

        $sequence_1 = { 50 e8???????? 8b4de0 83c404 8bf0 894d10 8bc3 }
            // n = 7, score = 100
            //   50                   | push                eax
            //   e8????????           |                     
            //   8b4de0               | mov                 ecx, dword ptr [ebp - 0x20]
            //   83c404               | add                 esp, 4
            //   8bf0                 | mov                 esi, eax
            //   894d10               | mov                 dword ptr [ebp + 0x10], ecx
            //   8bc3                 | mov                 eax, ebx

        $sequence_2 = { a0???????? 88461c c6461d00 8b45c8 8b4dc4 894dc0 }
            // n = 6, score = 100
            //   a0????????           |                     
            //   88461c               | mov                 byte ptr [esi + 0x1c], al
            //   c6461d00             | mov                 byte ptr [esi + 0x1d], 0
            //   8b45c8               | mov                 eax, dword ptr [ebp - 0x38]
            //   8b4dc4               | mov                 ecx, dword ptr [ebp - 0x3c]
            //   894dc0               | mov                 dword ptr [ebp - 0x40], ecx

        $sequence_3 = { 0f9fc1 8d044dffffffff 85c0 0f8582fdffff 0fb6cb 0fb6c2 2bc1 }
            // n = 7, score = 100
            //   0f9fc1               | setg                cl
            //   8d044dffffffff       | lea                 eax, [ecx*2 - 1]
            //   85c0                 | test                eax, eax
            //   0f8582fdffff         | jne                 0xfffffd88
            //   0fb6cb               | movzx               ecx, bl
            //   0fb6c2               | movzx               eax, dl
            //   2bc1                 | sub                 eax, ecx

        $sequence_4 = { 895704 8b5314 8b420c 8b400c 894764 8b4324 ff7218 }
            // n = 7, score = 100
            //   895704               | mov                 dword ptr [edi + 4], edx
            //   8b5314               | mov                 edx, dword ptr [ebx + 0x14]
            //   8b420c               | mov                 eax, dword ptr [edx + 0xc]
            //   8b400c               | mov                 eax, dword ptr [eax + 0xc]
            //   894764               | mov                 dword ptr [edi + 0x64], eax
            //   8b4324               | mov                 eax, dword ptr [ebx + 0x24]
            //   ff7218               | push                dword ptr [edx + 0x18]

        $sequence_5 = { 68???????? 885e4d e8???????? 83c408 85c0 0f8461010000 0fb6c3 }
            // n = 7, score = 100
            //   68????????           |                     
            //   885e4d               | mov                 byte ptr [esi + 0x4d], bl
            //   e8????????           |                     
            //   83c408               | add                 esp, 8
            //   85c0                 | test                eax, eax
            //   0f8461010000         | je                  0x167
            //   0fb6c3               | movzx               eax, bl

        $sequence_6 = { 8975d8 85f6 7460 ff75dc 56 53 ff75e4 }
            // n = 7, score = 100
            //   8975d8               | mov                 dword ptr [ebp - 0x28], esi
            //   85f6                 | test                esi, esi
            //   7460                 | je                  0x62
            //   ff75dc               | push                dword ptr [ebp - 0x24]
            //   56                   | push                esi
            //   53                   | push                ebx
            //   ff75e4               | push                dword ptr [ebp - 0x1c]

        $sequence_7 = { 47 48 2102 8b5508 3bfa 0f8372060000 8b4318 }
            // n = 7, score = 100
            //   47                   | inc                 edi
            //   48                   | dec                 eax
            //   2102                 | and                 dword ptr [edx], eax
            //   8b5508               | mov                 edx, dword ptr [ebp + 8]
            //   3bfa                 | cmp                 edi, edx
            //   0f8372060000         | jae                 0x678
            //   8b4318               | mov                 eax, dword ptr [ebx + 0x18]

        $sequence_8 = { c1e805 c1e002 2bc8 83e904 eb0a 03d6 8bc2 }
            // n = 7, score = 100
            //   c1e805               | shr                 eax, 5
            //   c1e002               | shl                 eax, 2
            //   2bc8                 | sub                 ecx, eax
            //   83e904               | sub                 ecx, 4
            //   eb0a                 | jmp                 0xc
            //   03d6                 | add                 edx, esi
            //   8bc2                 | mov                 eax, edx

        $sequence_9 = { 8be5 5d c20c00 b905000000 cd29 2bcb 894d10 }
            // n = 7, score = 100
            //   8be5                 | mov                 esp, ebp
            //   5d                   | pop                 ebp
            //   c20c00               | ret                 0xc
            //   b905000000           | mov                 ecx, 5
            //   cd29                 | int                 0x29
            //   2bcb                 | sub                 ecx, ebx
            //   894d10               | mov                 dword ptr [ebp + 0x10], ecx

    condition:
        7 of them and filesize < 675840
}