rule win_netwire_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.netwire."
        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.netwire"
        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 = { 740c c7042400000000 e8???????? c70424???????? e8???????? }
            // n = 5, score = 1200
            //   740c                 | je                  0xe
            //   c7042400000000       | mov                 dword ptr [esp], 0
            //   e8????????           |                     
            //   c70424????????       |                     
            //   e8????????           |                     

        $sequence_1 = { 750c c7042400000000 e8???????? e8???????? }
            // n = 4, score = 1200
            //   750c                 | jne                 0xe
            //   c7042400000000       | mov                 dword ptr [esp], 0
            //   e8????????           |                     
            //   e8????????           |                     

        $sequence_2 = { 890424 e8???????? 83ec10 83f805 }
            // n = 4, score = 1200
            //   890424               | mov                 dword ptr [esp], eax
            //   e8????????           |                     
            //   83ec10               | sub                 esp, 0x10
            //   83f805               | cmp                 eax, 5

        $sequence_3 = { 83ec0c c7442408???????? c7442404???????? c70424???????? e8???????? c7442408???????? }
            // n = 6, score = 1200
            //   83ec0c               | sub                 esp, 0xc
            //   c7442408????????     |                     
            //   c7442404????????     |                     
            //   c70424????????       |                     
            //   e8????????           |                     
            //   c7442408????????     |                     

        $sequence_4 = { 0504020000 890424 e8???????? e9???????? }
            // n = 4, score = 1200
            //   0504020000           | add                 eax, 0x204
            //   890424               | mov                 dword ptr [esp], eax
            //   e8????????           |                     
            //   e9????????           |                     

        $sequence_5 = { 83ec0c 85c0 750f c705????????05000000 e9???????? c705????????00000000 e9???????? }
            // n = 7, score = 1200
            //   83ec0c               | sub                 esp, 0xc
            //   85c0                 | test                eax, eax
            //   750f                 | jne                 0x11
            //   c705????????05000000     |     
            //   e9????????           |                     
            //   c705????????00000000     |     
            //   e9????????           |                     

        $sequence_6 = { 890424 e8???????? 83ec20 3d03010000 }
            // n = 4, score = 1200
            //   890424               | mov                 dword ptr [esp], eax
            //   e8????????           |                     
            //   83ec20               | sub                 esp, 0x20
            //   3d03010000           | cmp                 eax, 0x103

        $sequence_7 = { 890424 e8???????? 83ec18 85c0 0f94c0 }
            // n = 5, score = 1200
            //   890424               | mov                 dword ptr [esp], eax
            //   e8????????           |                     
            //   83ec18               | sub                 esp, 0x18
            //   85c0                 | test                eax, eax
            //   0f94c0               | sete                al

    condition:
        7 of them and filesize < 416768
}