rule win_nemty_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.nemty."
        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.nemty"
        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 = { 8db50cfcffff e8???????? 53 8db5d4fbffff }
            // n = 4, score = 300
            //   8db50cfcffff         | lea                 esi, [ebp - 0x3f4]
            //   e8????????           |                     
            //   53                   | push                ebx
            //   8db5d4fbffff         | lea                 esi, [ebp - 0x42c]

        $sequence_1 = { 8db5d4fbffff e8???????? 53 8db59cfbffff e8???????? 53 }
            // n = 6, score = 300
            //   8db5d4fbffff         | lea                 esi, [ebp - 0x42c]
            //   e8????????           |                     
            //   53                   | push                ebx
            //   8db59cfbffff         | lea                 esi, [ebp - 0x464]
            //   e8????????           |                     
            //   53                   | push                ebx

        $sequence_2 = { 8d85f4fbffff 50 56 6a01 ffb5f8fbffff }
            // n = 5, score = 300
            //   8d85f4fbffff         | lea                 eax, [ebp - 0x40c]
            //   50                   | push                eax
            //   56                   | push                esi
            //   6a01                 | push                1
            //   ffb5f8fbffff         | push                dword ptr [ebp - 0x408]

        $sequence_3 = { 8945e8 8365fc00 8b4304 8b0b ff7508 ff75e8 }
            // n = 6, score = 300
            //   8945e8               | mov                 dword ptr [ebp - 0x18], eax
            //   8365fc00             | and                 dword ptr [ebp - 4], 0
            //   8b4304               | mov                 eax, dword ptr [ebx + 4]
            //   8b0b                 | mov                 ecx, dword ptr [ebx]
            //   ff7508               | push                dword ptr [ebp + 8]
            //   ff75e8               | push                dword ptr [ebp - 0x18]

        $sequence_4 = { 7724 2bc2 6a1c 99 5e }
            // n = 5, score = 300
            //   7724                 | ja                  0x26
            //   2bc2                 | sub                 eax, edx
            //   6a1c                 | push                0x1c
            //   99                   | cdq                 
            //   5e                   | pop                 esi

        $sequence_5 = { 8945fc 837d2010 8b4508 8b4d0c 8985ecfbffff 8b451c 8985e8fbffff }
            // n = 7, score = 300
            //   8945fc               | mov                 dword ptr [ebp - 4], eax
            //   837d2010             | cmp                 dword ptr [ebp + 0x20], 0x10
            //   8b4508               | mov                 eax, dword ptr [ebp + 8]
            //   8b4d0c               | mov                 ecx, dword ptr [ebp + 0xc]
            //   8985ecfbffff         | mov                 dword ptr [ebp - 0x414], eax
            //   8b451c               | mov                 eax, dword ptr [ebp + 0x1c]
            //   8985e8fbffff         | mov                 dword ptr [ebp - 0x418], eax

        $sequence_6 = { 8bc6 33db 53 6880000000 }
            // n = 4, score = 300
            //   8bc6                 | mov                 eax, esi
            //   33db                 | xor                 ebx, ebx
            //   53                   | push                ebx
            //   6880000000           | push                0x80

        $sequence_7 = { 8d8c24c0000000 51 50 ff15???????? 89442414 }
            // n = 5, score = 300
            //   8d8c24c0000000       | lea                 ecx, [esp + 0xc0]
            //   51                   | push                ecx
            //   50                   | push                eax
            //   ff15????????         |                     
            //   89442414             | mov                 dword ptr [esp + 0x14], eax

        $sequence_8 = { 53 8d459c 50 ff35???????? ff75a4 }
            // n = 5, score = 300
            //   53                   | push                ebx
            //   8d459c               | lea                 eax, [ebp - 0x64]
            //   50                   | push                eax
            //   ff35????????         |                     
            //   ff75a4               | push                dword ptr [ebp - 0x5c]

        $sequence_9 = { 8bec 51 56 57 ff7534 e8???????? 837d3810 }
            // n = 7, score = 300
            //   8bec                 | mov                 ebp, esp
            //   51                   | push                ecx
            //   56                   | push                esi
            //   57                   | push                edi
            //   ff7534               | push                dword ptr [ebp + 0x34]
            //   e8????????           |                     
            //   837d3810             | cmp                 dword ptr [ebp + 0x38], 0x10

    condition:
        7 of them and filesize < 204800
}