rule win_acidbox_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.acidbox."
        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.acidbox"
        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 = { 88443104 8b8424a8000000 c1e810 88443106 8b8424a8000000 c1e818 88443108 }
            // n = 7, score = 400
            //   88443104             | dec                 eax
            //   8b8424a8000000       | mov                 dword ptr [esp + 0x38], esi
            //   c1e810               | mov                 ebx, 0x80070106
            //   88443106             | mov                 dword ptr [esp + 0x30], ebx
            //   8b8424a8000000       | dec                 esp
            //   c1e818               | lea                 eax, [esp + 0x110]
            //   88443108             | mov                 edx, 0x20

        $sequence_1 = { 448bc7 ff15???????? 488903 4885c0 750a bf04190480 e9???????? }
            // n = 7, score = 400
            //   448bc7               | dec                 eax
            //   ff15????????         |                     
            //   488903               | sub                 edx, eax
            //   4885c0               | dec                 eax
            //   750a                 | sub                 esi, eax
            //   bf04190480           | inc                 ecx
            //   e9????????           |                     

        $sequence_2 = { 4883ec20 488bd9 4885c9 7508 8d79fe e9???????? 4883612000 }
            // n = 7, score = 400
            //   4883ec20             | add                 ebx, eax
            //   488bd9               | dec                 eax
            //   4885c9               | add                 ebx, esi
            //   7508                 | dec                 eax
            //   8d79fe               | dec                 eax
            //   e9????????           |                     
            //   4883612000           | dec                 eax

        $sequence_3 = { 41b9070a00a0 eb36 488d8e50010000 4c8bca 4c8bc3 }
            // n = 5, score = 400
            //   41b9070a00a0         | test                eax, eax
            //   eb36                 | jne                 0x1423
            //   488d8e50010000       | mov                 edi, eax
            //   4c8bca               | mov                 dword ptr [esp + 0x30], eax
            //   4c8bc3               | test                eax, eax

        $sequence_4 = { 89791c 488b03 488b8898000000 c7413809000000 }
            // n = 4, score = 400
            //   89791c               | mov                 edi, ecx
            //   488b03               | dec                 esp
            //   488b8898000000       | arpl                word ptr [ecx + 0x3c], si
            //   c7413809000000       | inc                 ecx

        $sequence_5 = { 6683790440 756a 0fb6835c010000 83f803 743e 83f804 7426 }
            // n = 7, score = 400
            //   6683790440           | jne                 0x12c8
            //   756a                 | mov                 ebx, eax
            //   0fb6835c010000       | mov                 dword ptr [esp + 0x20], eax
            //   83f803               | test                eax, eax
            //   743e                 | test                eax, eax
            //   83f804               | jne                 0x12d4
            //   7426                 | jmp                 0x1294

        $sequence_6 = { 412a8a14170000 418d40f0 66d3eb 41018214170000 }
            // n = 4, score = 400
            //   412a8a14170000       | lea                 ecx, [esp + 0x31]
            //   418d40f0             | xor                 esi, esi
            //   66d3eb               | xor                 edx, edx
            //   41018214170000       | dec                 eax

        $sequence_7 = { eb14 8b4f18 448bc3 498bd1 e8???????? 4c8b4de0 }
            // n = 6, score = 400
            //   eb14                 | test                eax, eax
            //   8b4f18               | jne                 0x19e0
            //   448bc3               | test                esi, esi
            //   498bd1               | je                  0x19c9
            //   e8????????           |                     
            //   4c8b4de0             | inc                 ebp

        $sequence_8 = { 0fb74114 488d7918 4803f8 448bf3 895c242c 4c8b4e20 }
            // n = 6, score = 400
            //   0fb74114             | mov                 dword ptr [esp + 0x61], eax
            //   488d7918             | mov                 word ptr [esp + 0x65], ax
            //   4803f8               | dec                 ecx
            //   448bf3               | mov                 dword ptr [ebx - 0x38], esi
            //   895c242c             | inc                 ebp
            //   4c8b4e20             | xor                 esi, esi

        $sequence_9 = { 85c0 750a bb06130480 e9???????? 0fbe842430050000 89442420 4c8d8c2490010000 }
            // n = 7, score = 400
            //   85c0                 | lea                 eax, [ebx + 0xbc]
            //   750a                 | test                cl, 1
            //   bb06130480           | je                  0xf37
            //   e9????????           |                     
            //   0fbe842430050000     | inc                 sp
            //   89442420             | cmp                 dword ptr [eax], esi
            //   4c8d8c2490010000     | mov                 ecx, 0x180

    condition:
        7 of them and filesize < 589824
}