rule win_zeus_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.zeus."
        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.zeus"
        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 = { eb58 833f00 7651 8b5f08 }
            // n = 4, score = 700
            //   eb58                 | jmp                 0x5a
            //   833f00               | cmp                 dword ptr [edi], 0
            //   7651                 | jbe                 0x53
            //   8b5f08               | mov                 ebx, dword ptr [edi + 8]

        $sequence_1 = { 8b4804 81e1000000e0 394c240c 740d }
            // n = 4, score = 600
            //   8b4804               | mov                 ecx, dword ptr [eax + 4]
            //   81e1000000e0         | and                 ecx, 0xe0000000
            //   394c240c             | cmp                 dword ptr [esp + 0xc], ecx
            //   740d                 | je                  0xf

        $sequence_2 = { c6451700 8b5d10 3bde 7503 8d5d10 39750c }
            // n = 6, score = 600
            //   c6451700             | mov                 byte ptr [ebp + 0x17], 0
            //   8b5d10               | mov                 ebx, dword ptr [ebp + 0x10]
            //   3bde                 | cmp                 ebx, esi
            //   7503                 | jne                 5
            //   8d5d10               | lea                 ebx, [ebp + 0x10]
            //   39750c               | cmp                 dword ptr [ebp + 0xc], esi

        $sequence_3 = { 8d7708 8975fc e8???????? 8d4720 }
            // n = 4, score = 600
            //   8d7708               | lea                 esi, [edi + 8]
            //   8975fc               | mov                 dword ptr [ebp - 4], esi
            //   e8????????           |                     
            //   8d4720               | lea                 eax, [edi + 0x20]

        $sequence_4 = { eb21 ff7514 8bc6 57 }
            // n = 4, score = 600
            //   eb21                 | jmp                 0x23
            //   ff7514               | push                dword ptr [ebp + 0x14]
            //   8bc6                 | mov                 eax, esi
            //   57                   | push                edi

        $sequence_5 = { 84c0 7467 8b5d10 83e301 33ff 3bdf }
            // n = 6, score = 600
            //   84c0                 | test                al, al
            //   7467                 | je                  0x69
            //   8b5d10               | mov                 ebx, dword ptr [ebp + 0x10]
            //   83e301               | and                 ebx, 1
            //   33ff                 | xor                 edi, edi
            //   3bdf                 | cmp                 ebx, edi

        $sequence_6 = { 8d7708 83c720 57 8d45f4 50 8d45f8 50 }
            // n = 7, score = 600
            //   8d7708               | lea                 esi, [edi + 8]
            //   83c720               | add                 edi, 0x20
            //   57                   | push                edi
            //   8d45f4               | lea                 eax, [ebp - 0xc]
            //   50                   | push                eax
            //   8d45f8               | lea                 eax, [ebp - 8]
            //   50                   | push                eax

        $sequence_7 = { e8???????? 8b4808 8b32 8d4c3110 81f90000a000 7715 8918 }
            // n = 7, score = 600
            //   e8????????           |                     
            //   8b4808               | mov                 ecx, dword ptr [eax + 8]
            //   8b32                 | mov                 esi, dword ptr [edx]
            //   8d4c3110             | lea                 ecx, [ecx + esi + 0x10]
            //   81f90000a000         | cmp                 ecx, 0xa00000
            //   7715                 | ja                  0x17
            //   8918                 | mov                 dword ptr [eax], ebx

        $sequence_8 = { 891d???????? 891d???????? ffd6 68???????? }
            // n = 4, score = 500
            //   891d????????         |                     
            //   891d????????         |                     
            //   ffd6                 | call                esi
            //   68????????           |                     

        $sequence_9 = { e8???????? 84c0 7442 6a10 }
            // n = 4, score = 500
            //   e8????????           |                     
            //   84c0                 | test                al, al
            //   7442                 | je                  0x44
            //   6a10                 | push                0x10

        $sequence_10 = { 8bf3 6810270000 ff35???????? ff15???????? }
            // n = 4, score = 500
            //   8bf3                 | mov                 esi, ebx
            //   6810270000           | push                0x2710
            //   ff35????????         |                     
            //   ff15????????         |                     

        $sequence_11 = { 8d8db0fdffff e8???????? 8ad8 84db }
            // n = 4, score = 400
            //   8d8db0fdffff         | lea                 ecx, [ebp - 0x250]
            //   e8????????           |                     
            //   8ad8                 | mov                 bl, al
            //   84db                 | test                bl, bl

        $sequence_12 = { c20400 55 8bec f6451802 }
            // n = 4, score = 300
            //   c20400               | ret                 4
            //   55                   | push                ebp
            //   8bec                 | mov                 ebp, esp
            //   f6451802             | test                byte ptr [ebp + 0x18], 2

        $sequence_13 = { 56 ff15???????? 5e 8ac3 5b c20800 55 }
            // n = 7, score = 300
            //   56                   | push                esi
            //   ff15????????         |                     
            //   5e                   | pop                 esi
            //   8ac3                 | mov                 al, bl
            //   5b                   | pop                 ebx
            //   c20800               | ret                 8
            //   55                   | push                ebp

        $sequence_14 = { 8d75a8 b8d5000000 e8???????? 68e6010000 68???????? 6809080002 }
            // n = 6, score = 200
            //   8d75a8               | lea                 esi, [ebp - 0x58]
            //   b8d5000000           | mov                 eax, 0xd5
            //   e8????????           |                     
            //   68e6010000           | push                0x1e6
            //   68????????           |                     
            //   6809080002           | push                0x2000809

        $sequence_15 = { b9???????? 56 57 33f6 56 50 68???????? }
            // n = 7, score = 200
            //   b9????????           |                     
            //   56                   | push                esi
            //   57                   | push                edi
            //   33f6                 | xor                 esi, esi
            //   56                   | push                esi
            //   50                   | push                eax
            //   68????????           |                     

        $sequence_16 = { 6809080002 8bc6 50 8d45fc 50 e8???????? }
            // n = 6, score = 200
            //   6809080002           | push                0x2000809
            //   8bc6                 | mov                 eax, esi
            //   50                   | push                eax
            //   8d45fc               | lea                 eax, [ebp - 4]
            //   50                   | push                eax
            //   e8????????           |                     

        $sequence_17 = { eb18 81fb5a5c4156 740c 81fb45415356 }
            // n = 4, score = 200
            //   eb18                 | jmp                 0x1a
            //   81fb5a5c4156         | cmp                 ebx, 0x56415c5a
            //   740c                 | je                  0xe
            //   81fb45415356         | cmp                 ebx, 0x56534145

        $sequence_18 = { 894736 8d470c 50 c707000e0000 c7470809080002 e8???????? 83674200 }
            // n = 7, score = 200
            //   894736               | mov                 dword ptr [edi + 0x36], eax
            //   8d470c               | lea                 eax, [edi + 0xc]
            //   50                   | push                eax
            //   c707000e0000         | mov                 dword ptr [edi], 0xe00
            //   c7470809080002       | mov                 dword ptr [edi + 8], 0x2000809
            //   e8????????           |                     
            //   83674200             | and                 dword ptr [edi + 0x42], 0

        $sequence_19 = { 3d59495351 0f85ca000000 807b0420 0f85c0000000 33c0 83c6fb }
            // n = 6, score = 200
            //   3d59495351           | cmp                 eax, 0x51534959
            //   0f85ca000000         | jne                 0xd0
            //   807b0420             | cmp                 byte ptr [ebx + 4], 0x20
            //   0f85c0000000         | jne                 0xc6
            //   33c0                 | xor                 eax, eax
            //   83c6fb               | add                 esi, -5

        $sequence_20 = { 83fe06 0f86e3000000 8b03 3509080002 3d5c5b4550 }
            // n = 5, score = 200
            //   83fe06               | cmp                 esi, 6
            //   0f86e3000000         | jbe                 0xe9
            //   8b03                 | mov                 eax, dword ptr [ebx]
            //   3509080002           | xor                 eax, 0x2000809
            //   3d5c5b4550           | cmp                 eax, 0x50455b5c

        $sequence_21 = { 84c0 0f84ac000000 b809080002 3945f4 7713 807d0801 }
            // n = 6, score = 200
            //   84c0                 | test                al, al
            //   0f84ac000000         | je                  0xb2
            //   b809080002           | mov                 eax, 0x2000809
            //   3945f4               | cmp                 dword ptr [ebp - 0xc], eax
            //   7713                 | ja                  0x15
            //   807d0801             | cmp                 byte ptr [ebp + 8], 1

        $sequence_22 = { 83fe04 0f82ec000000 8b1b 81f309080002 }
            // n = 4, score = 200
            //   83fe04               | cmp                 esi, 4
            //   0f82ec000000         | jb                  0xf2
            //   8b1b                 | mov                 ebx, dword ptr [ebx]
            //   81f309080002         | xor                 ebx, 0x2000809

    condition:
        7 of them and filesize < 319488
}