rule win_innaput_rat_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.innaput_rat."
        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.innaput_rat"
        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 = { 8b06 894710 ff7604 035e08 ff5708 56 ff5708 }
            // n = 7, score = 500
            //   8b06                 | mov                 eax, dword ptr [esi]
            //   894710               | mov                 dword ptr [edi + 0x10], eax
            //   ff7604               | push                dword ptr [esi + 4]
            //   035e08               | add                 ebx, dword ptr [esi + 8]
            //   ff5708               | call                dword ptr [edi + 8]
            //   56                   | push                esi
            //   ff5708               | call                dword ptr [edi + 8]

        $sequence_1 = { eb02 8930 8b4508 83c004 50 ff15???????? }
            // n = 6, score = 500
            //   eb02                 | jmp                 4
            //   8930                 | mov                 dword ptr [eax], esi
            //   8b4508               | mov                 eax, dword ptr [ebp + 8]
            //   83c004               | add                 eax, 4
            //   50                   | push                eax
            //   ff15????????         |                     

        $sequence_2 = { ff15???????? ffb718060000 ff15???????? 85c0 750c }
            // n = 5, score = 500
            //   ff15????????         |                     
            //   ffb718060000         | push                dword ptr [edi + 0x618]
            //   ff15????????         |                     
            //   85c0                 | test                eax, eax
            //   750c                 | jne                 0xe

        $sequence_3 = { 7514 33db 53 53 }
            // n = 4, score = 500
            //   7514                 | jne                 0x16
            //   33db                 | xor                 ebx, ebx
            //   53                   | push                ebx
            //   53                   | push                ebx

        $sequence_4 = { 50 ffd7 8b4510 898618060000 8b4514 8b00 89861c060000 }
            // n = 7, score = 500
            //   50                   | push                eax
            //   ffd7                 | call                edi
            //   8b4510               | mov                 eax, dword ptr [ebp + 0x10]
            //   898618060000         | mov                 dword ptr [esi + 0x618], eax
            //   8b4514               | mov                 eax, dword ptr [ebp + 0x14]
            //   8b00                 | mov                 eax, dword ptr [eax]
            //   89861c060000         | mov                 dword ptr [esi + 0x61c], eax

        $sequence_5 = { 8bd0 8bce 2bca 8d5134 8a08 }
            // n = 5, score = 500
            //   8bd0                 | mov                 edx, eax
            //   8bce                 | mov                 ecx, esi
            //   2bca                 | sub                 ecx, edx
            //   8d5134               | lea                 edx, [ecx + 0x34]
            //   8a08                 | mov                 cl, byte ptr [eax]

        $sequence_6 = { 57 6800000100 e8???????? 6a02 }
            // n = 4, score = 500
            //   57                   | push                edi
            //   6800000100           | push                0x10000
            //   e8????????           |                     
            //   6a02                 | push                2

        $sequence_7 = { 3910 7418 8b00 eb02 }
            // n = 4, score = 500
            //   3910                 | cmp                 dword ptr [eax], edx
            //   7418                 | je                  0x1a
            //   8b00                 | mov                 eax, dword ptr [eax]
            //   eb02                 | jmp                 4

        $sequence_8 = { ff15???????? 85c0 750c ffb71c060000 ff15???????? 57 e8???????? }
            // n = 7, score = 500
            //   ff15????????         |                     
            //   85c0                 | test                eax, eax
            //   750c                 | jne                 0xe
            //   ffb71c060000         | push                dword ptr [edi + 0x61c]
            //   ff15????????         |                     
            //   57                   | push                edi
            //   e8????????           |                     

        $sequence_9 = { b001 ebd3 55 8bec 51 }
            // n = 5, score = 500
            //   b001                 | mov                 al, 1
            //   ebd3                 | jmp                 0xffffffd5
            //   55                   | push                ebp
            //   8bec                 | mov                 ebp, esp
            //   51                   | push                ecx

    condition:
        7 of them and filesize < 73728
}