rule win_zlob_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.zlob."
        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.zlob"
        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 = { c744241424020000 ffd3 ffd3 ffd6 ffd7 ffd3 ffd5 }
            // n = 7, score = 200
            //   c744241424020000     | mov                 dword ptr [esp + 0x14], 0x224
            //   ffd3                 | call                ebx
            //   ffd3                 | call                ebx
            //   ffd6                 | call                esi
            //   ffd7                 | call                edi
            //   ffd3                 | call                ebx
            //   ffd5                 | call                ebp

        $sequence_1 = { ffd6 ffd6 ffd5 6a10 8d442420 6a00 50 }
            // n = 7, score = 200
            //   ffd6                 | call                esi
            //   ffd6                 | call                esi
            //   ffd5                 | call                ebp
            //   6a10                 | push                0x10
            //   8d442420             | lea                 eax, [esp + 0x20]
            //   6a00                 | push                0
            //   50                   | push                eax

        $sequence_2 = { e8???????? ff442428 8b442428 3b442430 }
            // n = 4, score = 200
            //   e8????????           |                     
            //   ff442428             | inc                 dword ptr [esp + 0x28]
            //   8b442428             | mov                 eax, dword ptr [esp + 0x28]
            //   3b442430             | cmp                 eax, dword ptr [esp + 0x30]

        $sequence_3 = { 6a00 ff33 c644242300 ff15???????? 8b2d???????? 89442414 }
            // n = 6, score = 200
            //   6a00                 | push                0
            //   ff33                 | push                dword ptr [ebx]
            //   c644242300           | mov                 byte ptr [esp + 0x23], 0
            //   ff15????????         |                     
            //   8b2d????????         |                     
            //   89442414             | mov                 dword ptr [esp + 0x14], eax

        $sequence_4 = { 50 ff15???????? ffb42418010000 ff15???????? 83f8ff 75d0 }
            // n = 6, score = 200
            //   50                   | push                eax
            //   ff15????????         |                     
            //   ffb42418010000       | push                dword ptr [esp + 0x118]
            //   ff15????????         |                     
            //   83f8ff               | cmp                 eax, -1
            //   75d0                 | jne                 0xffffffd2

        $sequence_5 = { 51 50 50 ffb424a0030000 }
            // n = 4, score = 200
            //   51                   | push                ecx
            //   50                   | push                eax
            //   50                   | push                eax
            //   ffb424a0030000       | push                dword ptr [esp + 0x3a0]

        $sequence_6 = { c68504feffff30 c68505feffff35 c68506feffff36 c68507feffff2d c68508feffff34 }
            // n = 5, score = 200
            //   c68504feffff30       | mov                 byte ptr [ebp - 0x1fc], 0x30
            //   c68505feffff35       | mov                 byte ptr [ebp - 0x1fb], 0x35
            //   c68506feffff36       | mov                 byte ptr [ebp - 0x1fa], 0x36
            //   c68507feffff2d       | mov                 byte ptr [ebp - 0x1f9], 0x2d
            //   c68508feffff34       | mov                 byte ptr [ebp - 0x1f8], 0x34

        $sequence_7 = { 68???????? ff15???????? 6a0c a3???????? e8???????? 59 85c0 }
            // n = 7, score = 200
            //   68????????           |                     
            //   ff15????????         |                     
            //   6a0c                 | push                0xc
            //   a3????????           |                     
            //   e8????????           |                     
            //   59                   | pop                 ecx
            //   85c0                 | test                eax, eax

        $sequence_8 = { 0b0c98 4f 2bc2 33d2 }
            // n = 4, score = 200
            //   0b0c98               | or                  ecx, dword ptr [eax + ebx*4]
            //   4f                   | dec                 edi
            //   2bc2                 | sub                 eax, edx
            //   33d2                 | xor                 edx, edx

        $sequence_9 = { 894804 c644241301 ffd5 ffd5 }
            // n = 4, score = 200
            //   894804               | mov                 dword ptr [eax + 4], ecx
            //   c644241301           | mov                 byte ptr [esp + 0x13], 1
            //   ffd5                 | call                ebp
            //   ffd5                 | call                ebp

    condition:
        7 of them and filesize < 98304
}