rule win_kronos_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.kronos."
        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.kronos"
        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 = { 3bc6 723e 8b4d08 53 56 e8???????? 8b0f }
            // n = 7, score = 2800
            //   3bc6                 | cmp                 eax, esi
            //   723e                 | jb                  0x40
            //   8b4d08               | mov                 ecx, dword ptr [ebp + 8]
            //   53                   | push                ebx
            //   56                   | push                esi
            //   e8????????           |                     
            //   8b0f                 | mov                 ecx, dword ptr [edi]

        $sequence_1 = { 03c0 2bf8 8bcf b801000000 d3e0 8b4dfc 48 }
            // n = 7, score = 2800
            //   03c0                 | add                 eax, eax
            //   2bf8                 | sub                 edi, eax
            //   8bcf                 | mov                 ecx, edi
            //   b801000000           | mov                 eax, 1
            //   d3e0                 | shl                 eax, cl
            //   8b4dfc               | mov                 ecx, dword ptr [ebp - 4]
            //   48                   | dec                 eax

        $sequence_2 = { 3bc6 7407 8b0b 894810 }
            // n = 4, score = 2800
            //   3bc6                 | cmp                 eax, esi
            //   7407                 | je                  9
            //   8b0b                 | mov                 ecx, dword ptr [ebx]
            //   894810               | mov                 dword ptr [eax + 0x10], ecx

        $sequence_3 = { 03c0 50 ff7518 ff7514 }
            // n = 4, score = 2800
            //   03c0                 | add                 eax, eax
            //   50                   | push                eax
            //   ff7518               | push                dword ptr [ebp + 0x18]
            //   ff7514               | push                dword ptr [ebp + 0x14]

        $sequence_4 = { 03c0 50 ff7514 ff7510 ff75fc }
            // n = 5, score = 2800
            //   03c0                 | add                 eax, eax
            //   50                   | push                eax
            //   ff7514               | push                dword ptr [ebp + 0x14]
            //   ff7510               | push                dword ptr [ebp + 0x10]
            //   ff75fc               | push                dword ptr [ebp - 4]

        $sequence_5 = { 3bc6 7318 8bcf e8???????? 2bf0 56 8d85c0efffff }
            // n = 7, score = 2800
            //   3bc6                 | cmp                 eax, esi
            //   7318                 | jae                 0x1a
            //   8bcf                 | mov                 ecx, edi
            //   e8????????           |                     
            //   2bf0                 | sub                 esi, eax
            //   56                   | push                esi
            //   8d85c0efffff         | lea                 eax, [ebp - 0x1040]

        $sequence_6 = { 3bc6 740c 6a25 e8???????? 59 }
            // n = 5, score = 2800
            //   3bc6                 | cmp                 eax, esi
            //   740c                 | je                  0xe
            //   6a25                 | push                0x25
            //   e8????????           |                     
            //   59                   | pop                 ecx

        $sequence_7 = { 2375f8 8975c4 3b75d0 0f84fafeffff }
            // n = 4, score = 2800
            //   2375f8               | and                 esi, dword ptr [ebp - 8]
            //   8975c4               | mov                 dword ptr [ebp - 0x3c], esi
            //   3b75d0               | cmp                 esi, dword ptr [ebp - 0x30]
            //   0f84fafeffff         | je                  0xffffff00

    condition:
        7 of them and filesize < 1302528
}