rule win_lightneuron_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.lightneuron."
        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.lightneuron"
        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 = { 4c896c2468 85c9 7e2f 488d442420 4c8bd5 488d542420 4c8d4304 }
            // n = 7, score = 100
            //   4c896c2468           | movzx               edx, byte ptr [edi]
            //   85c9                 | cmp                 dl, 0x20
            //   7e2f                 | je                  0xd2
            //   488d442420           | mov                 ecx, dword ptr [ebx + 0x3f54]
            //   4c8bd5               | test                ecx, ecx
            //   488d542420           | dec                 esp
            //   4c8d4304             | mov                 esp, dword ptr [esp + 0x70]

        $sequence_1 = { 8d940200000100 eb06 41b9ff030000 33c9 413908 0f8488000000 498bc0 }
            // n = 7, score = 100
            //   8d940200000100       | mov                 dword ptr [esp + 4], eax
            //   eb06                 | cmp                 dword ptr [esp + 4], 0
            //   41b9ff030000         | je                  0x304
            //   33c9                 | mov                 eax, dword ptr [esp + 4]
            //   413908               | mov                 eax, edx
            //   0f8488000000         | inc                 ecx
            //   498bc0               | mov                 byte ptr [ebp + 0xf], dl

        $sequence_2 = { 746c 3bc1 7324 83c8ff 488bac2440020000 488bbc2448020000 }
            // n = 6, score = 100
            //   746c                 | dec                 eax
            //   3bc1                 | mov                 edx, ebp
            //   7324                 | dec                 eax
            //   83c8ff               | mov                 ecx, ebx
            //   488bac2440020000     | jmp                 0x1d08
            //   488bbc2448020000     | cmp                 byte ptr [ebx + esi - 1], 0x22

        $sequence_3 = { 8bd8 85c0 757b 4c8d87b8000000 488d542430 488d4c2448 e8???????? }
            // n = 7, score = 100
            //   8bd8                 | arpl                word ptr [esp + 0x24], ax
            //   85c0                 | mov                 ecx, dword ptr [esp + 0x28]
            //   757b                 | mov                 eax, dword ptr [esp + 0x20]
            //   4c8d87b8000000       | sub                 eax, ecx
            //   488d542430           | cmp                 dword ptr [esp + 0x24], eax
            //   488d4c2448           | jg                  0x8f0
            //   e8????????           |                     

        $sequence_4 = { 480f45d0 e8???????? 488b05???????? 488b15???????? 488b8ba8000000 4885c0 4c8d0598cbffff }
            // n = 7, score = 100
            //   480f45d0             | inc                 esp
            //   e8????????           |                     
            //   488b05????????       |                     
            //   488b15????????       |                     
            //   488b8ba8000000       | mov                 eax, eax
            //   4885c0               | dec                 eax
            //   4c8d0598cbffff       | mov                 dword ptr [esp + 0x38], esi

        $sequence_5 = { 4889442470 eb11 8b4c2424 c1e104 488b842480000000 8808 48634c2424 }
            // n = 7, score = 100
            //   4889442470           | dec                 eax
            //   eb11                 | mov                 ebp, dword ptr [esp + 0x40]
            //   8b4c2424             | dec                 eax
            //   c1e104               | add                 esp, 0x20
            //   488b842480000000     | pop                 esi
            //   8808                 | ret                 
            //   48634c2424           | dec                 eax

        $sequence_6 = { 48894c2428 b900001000 4533c9 bad0000000 c744242009000000 e8???????? 83fb04 }
            // n = 7, score = 100
            //   48894c2428           | dec                 eax
            //   b900001000           | mov                 ebp, dword ptr [esp + 0xf8]
            //   4533c9               | dec                 eax
            //   bad0000000           | mov                 esi, dword ptr [esp + 0x30]
            //   c744242009000000     | dec                 esp
            //   e8????????           |                     
            //   83fb04               | mov                 esp, dword ptr [esp + 0x20]

        $sequence_7 = { 33d2 4889440b08 488b4630 48f70403feffffff 763c 4c8d042f 666666666666660f1f840000000000 }
            // n = 7, score = 100
            //   33d2                 | xor                 esp, esp
            //   4889440b08           | test                ecx, ecx
            //   488b4630             | inc                 ecx
            //   48f70403feffffff     | mov                 edi, esp
            //   763c                 | dec                 esp
            //   4c8d042f             | mov                 dword ptr [esp + 0x28], esp
            //   666666666666660f1f840000000000     | cmovg    edi, ecx

        $sequence_8 = { 4883c002 4889442438 488b842418010000 4839442430 730d c78424e800000001000000 }
            // n = 6, score = 100
            //   4883c002             | dec                 eax
            //   4889442438           | mov                 edx, dword ptr [esi + 0x10]
            //   488b842418010000     | dec                 ebp
            //   4839442430           | mov                 eax, ebx
            //   730d                 | inc                 ecx
            //   c78424e800000001000000     | movzx    ecx, bl

        $sequence_9 = { 48c744242800000000 488b4c2440 ff15???????? 83c001 89442420 8b4c2420 e8???????? }
            // n = 7, score = 100
            //   48c744242800000000     | mov    ecx, ebp
            //   488b4c2440           | dec                 esp
            //   ff15????????         |                     
            //   83c001               | mov                 esp, esi
            //   89442420             | dec                 eax
            //   8b4c2420             | sub                 ecx, ebx
            //   e8????????           |                     

    condition:
        7 of them and filesize < 573440
}