rule win_naikon_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.naikon."
        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.naikon"
        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 = { 89480c 894810 894814 c740180c000000 }
            // n = 4, score = 200
            //   89480c               | mov                 dword ptr [eax + 0xc], ecx
            //   894810               | mov                 dword ptr [eax + 0x10], ecx
            //   894814               | mov                 dword ptr [eax + 0x14], ecx
            //   c740180c000000       | mov                 dword ptr [eax + 0x18], 0xc

        $sequence_1 = { e8???????? 57 6a01 ff35???????? }
            // n = 4, score = 200
            //   e8????????           |                     
            //   57                   | push                edi
            //   6a01                 | push                1
            //   ff35????????         |                     

        $sequence_2 = { 5f 8945cc 57 8d45e0 56 50 c745c402000000 }
            // n = 7, score = 200
            //   5f                   | pop                 edi
            //   8945cc               | mov                 dword ptr [ebp - 0x34], eax
            //   57                   | push                edi
            //   8d45e0               | lea                 eax, [ebp - 0x20]
            //   56                   | push                esi
            //   50                   | push                eax
            //   c745c402000000       | mov                 dword ptr [ebp - 0x3c], 2

        $sequence_3 = { 034608 50 57 ff7508 e8???????? 8b06 }
            // n = 6, score = 200
            //   034608               | add                 eax, dword ptr [esi + 8]
            //   50                   | push                eax
            //   57                   | push                edi
            //   ff7508               | push                dword ptr [ebp + 8]
            //   e8????????           |                     
            //   8b06                 | mov                 eax, dword ptr [esi]

        $sequence_4 = { 3d18030980 740b 3d20030900 0f85bd010000 3bfe 7407 }
            // n = 6, score = 200
            //   3d18030980           | cmp                 eax, 0x80090318
            //   740b                 | je                  0xd
            //   3d20030900           | cmp                 eax, 0x90320
            //   0f85bd010000         | jne                 0x1c3
            //   3bfe                 | cmp                 edi, esi
            //   7407                 | je                  9

        $sequence_5 = { 8d8570fdffff 6a00 50 c745f801000000 8975fc e8???????? 83c444 }
            // n = 7, score = 200
            //   8d8570fdffff         | lea                 eax, [ebp - 0x290]
            //   6a00                 | push                0
            //   50                   | push                eax
            //   c745f801000000       | mov                 dword ptr [ebp - 8], 1
            //   8975fc               | mov                 dword ptr [ebp - 4], esi
            //   e8????????           |                     
            //   83c444               | add                 esp, 0x44

        $sequence_6 = { 33c9 838890000000ff c7809400000098f80010 c7809800000050000000 c700???????? c74004bb010000 c74008???????? }
            // n = 7, score = 200
            //   33c9                 | xor                 ecx, ecx
            //   838890000000ff       | or                  dword ptr [eax + 0x90], 0xffffffff
            //   c7809400000098f80010     | mov    dword ptr [eax + 0x94], 0x1000f898
            //   c7809800000050000000     | mov    dword ptr [eax + 0x98], 0x50
            //   c700????????         |                     
            //   c74004bb010000       | mov                 dword ptr [eax + 4], 0x1bb
            //   c74008????????       |                     

        $sequence_7 = { e8???????? 83c40c 8d45dc c745ec64000000 c745e450000000 50 8d45e4 }
            // n = 7, score = 200
            //   e8????????           |                     
            //   83c40c               | add                 esp, 0xc
            //   8d45dc               | lea                 eax, [ebp - 0x24]
            //   c745ec64000000       | mov                 dword ptr [ebp - 0x14], 0x64
            //   c745e450000000       | mov                 dword ptr [ebp - 0x1c], 0x50
            //   50                   | push                eax
            //   8d45e4               | lea                 eax, [ebp - 0x1c]

        $sequence_8 = { e8???????? 68???????? e9???????? 68???????? e8???????? d1e0 50 }
            // n = 7, score = 200
            //   e8????????           |                     
            //   68????????           |                     
            //   e9????????           |                     
            //   68????????           |                     
            //   e8????????           |                     
            //   d1e0                 | shl                 eax, 1
            //   50                   | push                eax

        $sequence_9 = { e8???????? 83c42c 5f 5e c3 55 8bec }
            // n = 7, score = 200
            //   e8????????           |                     
            //   83c42c               | add                 esp, 0x2c
            //   5f                   | pop                 edi
            //   5e                   | pop                 esi
            //   c3                   | ret                 
            //   55                   | push                ebp
            //   8bec                 | mov                 ebp, esp

    condition:
        7 of them and filesize < 188416
}