rule win_zeus_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-05-04"
        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 = "20260422"
        malpedia_hash = "a182e35da64e6d71cb55f125c4d4225196523f14"
        malpedia_version = "20260504"
        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 = { 885dff 53 53 6a03 }
            // n = 4, score = 600
            //   885dff               | mov                 byte ptr [ebp - 1], bl
            //   53                   | push                ebx
            //   53                   | push                ebx
            //   6a03                 | push                3

        $sequence_2 = { 83e900 741e 49 740c }
            // n = 4, score = 600
            //   83e900               | sub                 ecx, 0
            //   741e                 | je                  0x20
            //   49                   | dec                 ecx
            //   740c                 | je                  0xe

        $sequence_3 = { 8b0d???????? 03c8 830904 8b0d???????? }
            // n = 4, score = 600
            //   8b0d????????         |                     
            //   03c8                 | add                 ecx, eax
            //   830904               | or                  dword ptr [ecx], 4
            //   8b0d????????         |                     

        $sequence_4 = { 83e81c 50 8d461c 50 8d45f0 50 e8???????? }
            // n = 7, score = 600
            //   83e81c               | sub                 eax, 0x1c
            //   50                   | push                eax
            //   8d461c               | lea                 eax, [esi + 0x1c]
            //   50                   | push                eax
            //   8d45f0               | lea                 eax, [ebp - 0x10]
            //   50                   | push                eax
            //   e8????????           |                     

        $sequence_5 = { 8d4301 8d75fc e8???????? 8b75fc }
            // n = 4, score = 600
            //   8d4301               | lea                 eax, [ebx + 1]
            //   8d75fc               | lea                 esi, [ebp - 4]
            //   e8????????           |                     
            //   8b75fc               | mov                 esi, dword ptr [ebp - 4]

        $sequence_6 = { ebd7 8b4514 85c0 7409 8338ff }
            // n = 5, score = 600
            //   ebd7                 | jmp                 0xffffffd9
            //   8b4514               | mov                 eax, dword ptr [ebp + 0x14]
            //   85c0                 | test                eax, eax
            //   7409                 | je                  0xb
            //   8338ff               | cmp                 dword ptr [eax], -1

        $sequence_7 = { 885dff 395d0c 7415 ff750c 53 683a040000 ff15???????? }
            // n = 7, score = 600
            //   885dff               | mov                 byte ptr [ebp - 1], bl
            //   395d0c               | cmp                 dword ptr [ebp + 0xc], ebx
            //   7415                 | je                  0x17
            //   ff750c               | push                dword ptr [ebp + 0xc]
            //   53                   | push                ebx
            //   683a040000           | push                0x43a
            //   ff15????????         |                     

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

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

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

        $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 = { 5e 8ac3 5b c20800 55 8bec 83e4f8 }
            // n = 7, score = 300
            //   5e                   | pop                 esi
            //   8ac3                 | mov                 al, bl
            //   5b                   | pop                 ebx
            //   c20800               | ret                 8
            //   55                   | push                ebp
            //   8bec                 | mov                 ebp, esp
            //   83e4f8               | and                 esp, 0xfffffff8

        $sequence_14 = { 894736 8d470c 50 c707000e0000 c7470809080002 e8???????? }
            // n = 6, 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????????           |                     

        $sequence_15 = { b001 5b 8be5 5d c3 66833d????????00 56 }
            // n = 7, score = 200
            //   b001                 | mov                 al, 1
            //   5b                   | pop                 ebx
            //   8be5                 | mov                 esp, ebp
            //   5d                   | pop                 ebp
            //   c3                   | ret                 
            //   66833d????????00     |                     
            //   56                   | push                esi

        $sequence_16 = { 0f84ac000000 b809080002 3945f4 7713 }
            // n = 4, score = 200
            //   0f84ac000000         | je                  0xb2
            //   b809080002           | mov                 eax, 0x2000809
            //   3945f4               | cmp                 dword ptr [ebp - 0xc], eax
            //   7713                 | ja                  0x15

        $sequence_17 = { 5b 8bc6 c745f809080002 e8???????? 8ad8 f6450c04 7473 }
            // n = 7, score = 200
            //   5b                   | pop                 ebx
            //   8bc6                 | mov                 eax, esi
            //   c745f809080002       | mov                 dword ptr [ebp - 8], 0x2000809
            //   e8????????           |                     
            //   8ad8                 | mov                 bl, al
            //   f6450c04             | test                byte ptr [ebp + 0xc], 4
            //   7473                 | je                  0x75

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

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

        $sequence_20 = { 740c 81fb45415356 0f85b2000000 b365 6a15 }
            // n = 5, score = 200
            //   740c                 | je                  0xe
            //   81fb45415356         | cmp                 ebx, 0x56534145
            //   0f85b2000000         | jne                 0xb8
            //   b365                 | mov                 bl, 0x65
            //   6a15                 | push                0x15

        $sequence_21 = { 2501000080 7905 48 83c8fe 40 ff75f4 f7d8 }
            // n = 7, score = 200
            //   2501000080           | and                 eax, 0x80000001
            //   7905                 | jns                 7
            //   48                   | dec                 eax
            //   83c8fe               | or                  eax, 0xfffffffe
            //   40                   | inc                 eax
            //   ff75f4               | push                dword ptr [ebp - 0xc]
            //   f7d8                 | neg                 eax

        $sequence_22 = { 81fb5d515047 7410 81fb4f4d4156 7408 81fb59495354 7506 }
            // n = 6, score = 200
            //   81fb5d515047         | cmp                 ebx, 0x4750515d
            //   7410                 | je                  0x12
            //   81fb4f4d4156         | cmp                 ebx, 0x56414d4f
            //   7408                 | je                  0xa
            //   81fb59495354         | cmp                 ebx, 0x54534959
            //   7506                 | jne                 8

    condition:
        7 of them and filesize < 319488
}