rule win_wipbot_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.wipbot."
        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.wipbot"
        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 = { 48 89cb 48 89d6 b98855514f ba4656f1f6 e8???????? }
            // n = 7, score = 100
            //   48                   | dec                 eax
            //   89cb                 | mov                 ebx, ecx
            //   48                   | dec                 eax
            //   89d6                 | mov                 esi, edx
            //   b98855514f           | mov                 ecx, 0x4f515588
            //   ba4656f1f6           | mov                 edx, 0xf6f15646
            //   e8????????           |                     

        $sequence_1 = { 0f852effffff ff45c0 83c202 8b75ec 3975c0 7598 89d1 }
            // n = 7, score = 100
            //   0f852effffff         | jne                 0xffffff34
            //   ff45c0               | inc                 dword ptr [ebp - 0x40]
            //   83c202               | add                 edx, 2
            //   8b75ec               | mov                 esi, dword ptr [ebp - 0x14]
            //   3975c0               | cmp                 dword ptr [ebp - 0x40], esi
            //   7598                 | jne                 0xffffff9a
            //   89d1                 | mov                 ecx, edx

        $sequence_2 = { 48 89c6 750f e8???????? 0d00002100 e9???????? }
            // n = 6, score = 100
            //   48                   | dec                 eax
            //   89c6                 | mov                 esi, eax
            //   750f                 | jne                 0x11
            //   e8????????           |                     
            //   0d00002100           | or                  eax, 0x210000
            //   e9????????           |                     

        $sequence_3 = { b801000000 0f8485000000 e8???????? 85c0 89c7 }
            // n = 5, score = 100
            //   b801000000           | mov                 eax, 1
            //   0f8485000000         | je                  0x8b
            //   e8????????           |                     
            //   85c0                 | test                eax, eax
            //   89c7                 | mov                 edi, eax

        $sequence_4 = { 8d55f4 8954240c 8d55f0 c744241440000000 c744241000300000 c744240800000000 }
            // n = 6, score = 100
            //   8d55f4               | lea                 edx, [ebp - 0xc]
            //   8954240c             | mov                 dword ptr [esp + 0xc], edx
            //   8d55f0               | lea                 edx, [ebp - 0x10]
            //   c744241440000000     | mov                 dword ptr [esp + 0x14], 0x40
            //   c744241000300000     | mov                 dword ptr [esp + 0x10], 0x3000
            //   c744240800000000     | mov                 dword ptr [esp + 8], 0

        $sequence_5 = { 55 89e5 83ec10 e8???????? 85c0 7504 }
            // n = 6, score = 100
            //   55                   | push                ebp
            //   89e5                 | mov                 ebp, esp
            //   83ec10               | sub                 esp, 0x10
            //   e8????????           |                     
            //   85c0                 | test                eax, eax
            //   7504                 | jne                 6

        $sequence_6 = { e8???????? 48 85c0 48 89c3 7504 31c0 }
            // n = 7, score = 100
            //   e8????????           |                     
            //   48                   | dec                 eax
            //   85c0                 | test                eax, eax
            //   48                   | dec                 eax
            //   89c3                 | mov                 ebx, eax
            //   7504                 | jne                 6
            //   31c0                 | xor                 eax, eax

        $sequence_7 = { eb8e 8b45f4 e8???????? 31d2 b8feffffff e8???????? 8d65f8 }
            // n = 7, score = 100
            //   eb8e                 | jmp                 0xffffff90
            //   8b45f4               | mov                 eax, dword ptr [ebp - 0xc]
            //   e8????????           |                     
            //   31d2                 | xor                 edx, edx
            //   b8feffffff           | mov                 eax, 0xfffffffe
            //   e8????????           |                     
            //   8d65f8               | lea                 esp, [ebp - 8]

        $sequence_8 = { c1fa1f c1f91f 89542420 8d5594 894c2428 89d1 8954240c }
            // n = 7, score = 100
            //   c1fa1f               | sar                 edx, 0x1f
            //   c1f91f               | sar                 ecx, 0x1f
            //   89542420             | mov                 dword ptr [esp + 0x20], edx
            //   8d5594               | lea                 edx, [ebp - 0x6c]
            //   894c2428             | mov                 dword ptr [esp + 0x28], ecx
            //   89d1                 | mov                 ecx, edx
            //   8954240c             | mov                 dword ptr [esp + 0xc], edx

        $sequence_9 = { c644246f00 48 8d4b20 896c2430 89742428 44 895c2420 }
            // n = 7, score = 100
            //   c644246f00           | mov                 byte ptr [esp + 0x6f], 0
            //   48                   | dec                 eax
            //   8d4b20               | lea                 ecx, [ebx + 0x20]
            //   896c2430             | mov                 dword ptr [esp + 0x30], ebp
            //   89742428             | mov                 dword ptr [esp + 0x28], esi
            //   44                   | inc                 esp
            //   895c2420             | mov                 dword ptr [esp + 0x20], ebx

    condition:
        7 of them and filesize < 253952
}