rule win_neddnloader_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.neddnloader."
        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.neddnloader"
        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 = { 41 8bc1 2b45fc 5f }
            // n = 4, score = 400
            //   41                   | inc                 ecx
            //   8bc1                 | mov                 eax, ecx
            //   2b45fc               | sub                 eax, dword ptr [ebp - 4]
            //   5f                   | pop                 edi

        $sequence_1 = { 7311 0fb702 0fb731 663bc6 7506 83c102 83c202 }
            // n = 7, score = 400
            //   7311                 | jae                 0x13
            //   0fb702               | movzx               eax, word ptr [edx]
            //   0fb731               | movzx               esi, word ptr [ecx]
            //   663bc6               | cmp                 ax, si
            //   7506                 | jne                 8
            //   83c102               | add                 ecx, 2
            //   83c202               | add                 edx, 2

        $sequence_2 = { 8b5508 69c0b179379e c1e813 03c9 }
            // n = 4, score = 400
            //   8b5508               | mov                 edx, dword ptr [ebp + 8]
            //   69c0b179379e         | imul                eax, eax, 0x9e3779b1
            //   c1e813               | shr                 eax, 0x13
            //   03c9                 | add                 ecx, ecx

        $sequence_3 = { 55 8bec 83e4f8 81ec10060000 a1???????? 33c4 8984240c060000 }
            // n = 7, score = 400
            //   55                   | push                ebp
            //   8bec                 | mov                 ebp, esp
            //   83e4f8               | and                 esp, 0xfffffff8
            //   81ec10060000         | sub                 esp, 0x610
            //   a1????????           |                     
            //   33c4                 | xor                 eax, esp
            //   8984240c060000       | mov                 dword ptr [esp + 0x60c], eax

        $sequence_4 = { 47 57 e8???????? 2b5d10 83c40c 03df }
            // n = 6, score = 400
            //   47                   | inc                 edi
            //   57                   | push                edi
            //   e8????????           |                     
            //   2b5d10               | sub                 ebx, dword ptr [ebp + 0x10]
            //   83c40c               | add                 esp, 0xc
            //   03df                 | add                 ebx, edi

        $sequence_5 = { 83c204 3bcf 72f0 8d43ff }
            // n = 4, score = 400
            //   83c204               | add                 edx, 4
            //   3bcf                 | cmp                 ecx, edi
            //   72f0                 | jb                  0xfffffff2
            //   8d43ff               | lea                 eax, [ebx - 1]

        $sequence_6 = { ff15???????? 8b4df8 56 3bc8 }
            // n = 4, score = 400
            //   ff15????????         |                     
            //   8b4df8               | mov                 ecx, dword ptr [ebp - 8]
            //   56                   | push                esi
            //   3bc8                 | cmp                 ecx, eax

        $sequence_7 = { 72f0 8d43ff 3bc8 7311 0fb702 0fb731 }
            // n = 6, score = 400
            //   72f0                 | jb                  0xfffffff2
            //   8d43ff               | lea                 eax, [ebx - 1]
            //   3bc8                 | cmp                 ecx, eax
            //   7311                 | jae                 0x13
            //   0fb702               | movzx               eax, word ptr [edx]
            //   0fb731               | movzx               esi, word ptr [ecx]

        $sequence_8 = { 741e 488bce 488bc6 488d1500370100 83e11f 48c1f805 }
            // n = 6, score = 100
            //   741e                 | inc                 eax
            //   488bce               | movzx               eax, bh
            //   488bc6               | inc                 edx
            //   488d1500370100       | movzx               eax, byte ptr [eax + 0x13b80]
            //   83e11f               | inc                 ecx
            //   48c1f805             | xor                 edi, dword ptr [esp + ecx*4 + 0x14d80]

        $sequence_9 = { 4133bc8c804d0100 4133bc8480590100 418bc0 41337d40 }
            // n = 4, score = 100
            //   4133bc8c804d0100     | test                eax, ecx
            //   4133bc8480590100     | inc                 ecx
            //   418bc0               | shl                 eax, 8
            //   41337d40             | movzx               ecx, al

        $sequence_10 = { 8bcf 8bc7 0f97c1 4d3be5 0f97c0 85c8 }
            // n = 6, score = 100
            //   8bcf                 | lea                 edx, [0xfab1]
            //   8bc7                 | dec                 eax
            //   0f97c1               | mov                 dword ptr [esp + 0x20], ecx
            //   4d3be5               | dec                 eax
            //   0f97c0               | test                ecx, ecx
            //   85c8                 | je                  0x1e

        $sequence_11 = { 7403 f0ff00 488d4158 41b806000000 488d1560f50000 483950f0 740b }
            // n = 7, score = 100
            //   7403                 | inc                 ecx
            //   f0ff00               | xor                 edi, dword ptr [esp + eax*4 + 0x15980]
            //   488d4158             | inc                 ecx
            //   41b806000000         | mov                 eax, eax
            //   488d1560f50000       | inc                 ecx
            //   483950f0             | xor                 edi, dword ptr [ebp + 0x40]
            //   740b                 | dec                 eax

        $sequence_12 = { 488d4c2470 488d82fef7ff7f 4885c0 7416 }
            // n = 4, score = 100
            //   488d4c2470           | inc                 edx
            //   488d82fef7ff7f       | movzx               eax, byte ptr [ecx + 0x13b80]
            //   4885c0               | inc                 esp
            //   7416                 | xor                 eax, eax

        $sequence_13 = { 41c1e008 0fb6c8 420fb68421803b0100 4433c0 400fb6c7 420fb68420803b0100 }
            // n = 6, score = 100
            //   41c1e008             | mov                 ecx, edi
            //   0fb6c8               | mov                 eax, edi
            //   420fb68421803b0100     | seta    cl
            //   4433c0               | dec                 ebp
            //   400fb6c7             | cmp                 esp, ebp
            //   420fb68420803b0100     | seta    al

        $sequence_14 = { 488d15b1fa0000 48894c2420 4885c9 7419 }
            // n = 4, score = 100
            //   488d15b1fa0000       | mov                 ebx, dword ptr [esp + 0x80]
            //   48894c2420           | dec                 ebp
            //   4885c9               | lea                 esp, [esi + 1]
            //   7419                 | dec                 eax

        $sequence_15 = { 83fb0d 0f8c46020000 418b06 488b9c2480000000 4d8d6601 }
            // n = 5, score = 100
            //   83fb0d               | cmp                 ebx, 0xd
            //   0f8c46020000         | jl                  0x24c
            //   418b06               | inc                 ecx
            //   488b9c2480000000     | mov                 eax, dword ptr [esi]
            //   4d8d6601             | dec                 eax

    condition:
        7 of them and filesize < 3438592
}