rule win_nitol_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.nitol."
        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.nitol"
        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 = { 83bdf0feffff01 7560 8b4df4 8b45f8 }
            // n = 4, score = 200
            //   83bdf0feffff01       | cmp                 dword ptr [ebp - 0x110], 1
            //   7560                 | jne                 0x62
            //   8b4df4               | mov                 ecx, dword ptr [ebp - 0xc]
            //   8b45f8               | mov                 eax, dword ptr [ebp - 8]

        $sequence_1 = { 83c418 8d45a4 6a10 50 53 8d8540ffffff 6a28 }
            // n = 7, score = 200
            //   83c418               | add                 esp, 0x18
            //   8d45a4               | lea                 eax, [ebp - 0x5c]
            //   6a10                 | push                0x10
            //   50                   | push                eax
            //   53                   | push                ebx
            //   8d8540ffffff         | lea                 eax, [ebp - 0xc0]
            //   6a28                 | push                0x28

        $sequence_2 = { ffd6 8d85e8feffff 50 8d8568feffff 50 }
            // n = 5, score = 200
            //   ffd6                 | call                esi
            //   8d85e8feffff         | lea                 eax, [ebp - 0x118]
            //   50                   | push                eax
            //   8d8568feffff         | lea                 eax, [ebp - 0x198]
            //   50                   | push                eax

        $sequence_3 = { ff742428 ffd7 8d442430 55 50 53 }
            // n = 6, score = 200
            //   ff742428             | push                dword ptr [esp + 0x28]
            //   ffd7                 | call                edi
            //   8d442430             | lea                 eax, [esp + 0x30]
            //   55                   | push                ebp
            //   50                   | push                eax
            //   53                   | push                ebx

        $sequence_4 = { 6a02 66ab ff15???????? 83f8ff 8945c8 7509 5f }
            // n = 7, score = 200
            //   6a02                 | push                2
            //   66ab                 | stosw               word ptr es:[edi], ax
            //   ff15????????         |                     
            //   83f8ff               | cmp                 eax, -1
            //   8945c8               | mov                 dword ptr [ebp - 0x38], eax
            //   7509                 | jne                 0xb
            //   5f                   | pop                 edi

        $sequence_5 = { 668945ee 8d45bc 50 c645ec80 c645ed11 ff15???????? 8945f0 }
            // n = 7, score = 200
            //   668945ee             | mov                 word ptr [ebp - 0x12], ax
            //   8d45bc               | lea                 eax, [ebp - 0x44]
            //   50                   | push                eax
            //   c645ec80             | mov                 byte ptr [ebp - 0x14], 0x80
            //   c645ed11             | mov                 byte ptr [ebp - 0x13], 0x11
            //   ff15????????         |                     
            //   8945f0               | mov                 dword ptr [ebp - 0x10], eax

        $sequence_6 = { 0f86d5030000 6a4b 50 e8???????? 8d8588f4ffff 50 e8???????? }
            // n = 7, score = 200
            //   0f86d5030000         | jbe                 0x3db
            //   6a4b                 | push                0x4b
            //   50                   | push                eax
            //   e8????????           |                     
            //   8d8588f4ffff         | lea                 eax, [ebp - 0xb78]
            //   50                   | push                eax
            //   e8????????           |                     

        $sequence_7 = { 57 ffd3 8b8688000000 45 83c014 3be8 7ce6 }
            // n = 7, score = 200
            //   57                   | push                edi
            //   ffd3                 | call                ebx
            //   8b8688000000         | mov                 eax, dword ptr [esi + 0x88]
            //   45                   | inc                 ebp
            //   83c014               | add                 eax, 0x14
            //   3be8                 | cmp                 ebp, eax
            //   7ce6                 | jl                  0xffffffe8

        $sequence_8 = { 8d85b0feffff 50 e8???????? 8945fc c7042460ea0000 e8???????? 59 }
            // n = 7, score = 200
            //   8d85b0feffff         | lea                 eax, [ebp - 0x150]
            //   50                   | push                eax
            //   e8????????           |                     
            //   8945fc               | mov                 dword ptr [ebp - 4], eax
            //   c7042460ea0000       | mov                 dword ptr [esp], 0xea60
            //   e8????????           |                     
            //   59                   | pop                 ecx

        $sequence_9 = { ff15???????? 4e 75e4 6a0a ff15???????? ebce 53 }
            // n = 7, score = 200
            //   ff15????????         |                     
            //   4e                   | dec                 esi
            //   75e4                 | jne                 0xffffffe6
            //   6a0a                 | push                0xa
            //   ff15????????         |                     
            //   ebce                 | jmp                 0xffffffd0
            //   53                   | push                ebx

    condition:
        7 of them and filesize < 139264
}