rule win_rombertik_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.rombertik."
        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.rombertik"
        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 = { 57 ff15???????? 8bf0 85f6 742c 8b4508 }
            // n = 6, score = 200
            //   57                   | push                edi
            //   ff15????????         |                     
            //   8bf0                 | mov                 esi, eax
            //   85f6                 | test                esi, esi
            //   742c                 | je                  0x2e
            //   8b4508               | mov                 eax, dword ptr [ebp + 8]

        $sequence_1 = { 75f8 8b15???????? 8910 668b0d???????? 66894804 b8???????? }
            // n = 6, score = 200
            //   75f8                 | jne                 0xfffffffa
            //   8b15????????         |                     
            //   8910                 | mov                 dword ptr [eax], edx
            //   668b0d????????       |                     
            //   66894804             | mov                 word ptr [eax + 4], cx
            //   b8????????           |                     

        $sequence_2 = { 57 50 8b4514 51 8b4d10 52 8b5508 }
            // n = 7, score = 200
            //   57                   | push                edi
            //   50                   | push                eax
            //   8b4514               | mov                 eax, dword ptr [ebp + 0x14]
            //   51                   | push                ecx
            //   8b4d10               | mov                 ecx, dword ptr [ebp + 0x10]
            //   52                   | push                edx
            //   8b5508               | mov                 edx, dword ptr [ebp + 8]

        $sequence_3 = { ff15???????? 8d8ddcfdffff 8bf0 51 56 }
            // n = 5, score = 200
            //   ff15????????         |                     
            //   8d8ddcfdffff         | lea                 ecx, [ebp - 0x224]
            //   8bf0                 | mov                 esi, eax
            //   51                   | push                ecx
            //   56                   | push                esi

        $sequence_4 = { 56 ff15???????? 33db 8bcf e8???????? 50 8d8dfcfeffff }
            // n = 7, score = 200
            //   56                   | push                esi
            //   ff15????????         |                     
            //   33db                 | xor                 ebx, ebx
            //   8bcf                 | mov                 ecx, edi
            //   e8????????           |                     
            //   50                   | push                eax
            //   8d8dfcfeffff         | lea                 ecx, [ebp - 0x104]

        $sequence_5 = { 57 ffd6 85c0 0f843f010000 68???????? 57 ffd6 }
            // n = 7, score = 200
            //   57                   | push                edi
            //   ffd6                 | call                esi
            //   85c0                 | test                eax, eax
            //   0f843f010000         | je                  0x145
            //   68????????           |                     
            //   57                   | push                edi
            //   ffd6                 | call                esi

        $sequence_6 = { ff15???????? 8bf0 85f6 742c 8b4508 8d5001 8da42400000000 }
            // n = 7, score = 200
            //   ff15????????         |                     
            //   8bf0                 | mov                 esi, eax
            //   85f6                 | test                esi, esi
            //   742c                 | je                  0x2e
            //   8b4508               | mov                 eax, dword ptr [ebp + 8]
            //   8d5001               | lea                 edx, [eax + 1]
            //   8da42400000000       | lea                 esp, [esp]

        $sequence_7 = { 50 51 e8???????? 83c414 8bc7 }
            // n = 5, score = 200
            //   50                   | push                eax
            //   51                   | push                ecx
            //   e8????????           |                     
            //   83c414               | add                 esp, 0x14
            //   8bc7                 | mov                 eax, edi

        $sequence_8 = { 55 8bec 83ec08 56 8b35???????? 6a00 6a01 }
            // n = 7, score = 200
            //   55                   | push                ebp
            //   8bec                 | mov                 ebp, esp
            //   83ec08               | sub                 esp, 8
            //   56                   | push                esi
            //   8b35????????         |                     
            //   6a00                 | push                0
            //   6a01                 | push                1

        $sequence_9 = { 8b75fc 56 6a00 ff15???????? 50 ff15???????? 5e }
            // n = 7, score = 200
            //   8b75fc               | mov                 esi, dword ptr [ebp - 4]
            //   56                   | push                esi
            //   6a00                 | push                0
            //   ff15????????         |                     
            //   50                   | push                eax
            //   ff15????????         |                     
            //   5e                   | pop                 esi

    condition:
        7 of them and filesize < 73728
}