rule win_netwire_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-05-04"
        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 = "20260422"
        malpedia_hash = "a182e35da64e6d71cb55f125c4d4225196523f14"
        malpedia_version = "20260504"
        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 = { c744242c00000000 c744242800000000 c744242400000000 c7442420fdffffff c744241c00000000 }
            // n = 5, score = 1200
            //   c744242c00000000     | mov                 dword ptr [esp + 0x2c], 0
            //   c744242800000000     | mov                 dword ptr [esp + 0x28], 0
            //   c744242400000000     | mov                 dword ptr [esp + 0x24], 0
            //   c7442420fdffffff     | mov                 dword ptr [esp + 0x20], 0xfffffffd
            //   c744241c00000000     | mov                 dword ptr [esp + 0x1c], 0

        $sequence_1 = { e8???????? c7042400000000 e8???????? c7042402000000 }
            // n = 4, score = 1200
            //   e8????????           |                     
            //   c7042400000000       | mov                 dword ptr [esp], 0
            //   e8????????           |                     
            //   c7042402000000       | mov                 dword ptr [esp], 2

        $sequence_2 = { e8???????? c704244a000000 e8???????? c7042446000000 e8???????? c7042449000000 e8???????? }
            // n = 7, score = 1200
            //   e8????????           |                     
            //   c704244a000000       | mov                 dword ptr [esp], 0x4a
            //   e8????????           |                     
            //   c7042446000000       | mov                 dword ptr [esp], 0x46
            //   e8????????           |                     
            //   c7042449000000       | mov                 dword ptr [esp], 0x49
            //   e8????????           |                     

        $sequence_3 = { c7042400000000 e8???????? c70424???????? e8???????? }
            // n = 4, score = 1200
            //   c7042400000000       | mov                 dword ptr [esp], 0
            //   e8????????           |                     
            //   c70424????????       |                     
            //   e8????????           |                     

        $sequence_4 = { e8???????? c7042446000000 e8???????? c7042449000000 e8???????? c7042446000000 e8???????? }
            // n = 7, score = 1200
            //   e8????????           |                     
            //   c7042446000000       | mov                 dword ptr [esp], 0x46
            //   e8????????           |                     
            //   c7042449000000       | mov                 dword ptr [esp], 0x49
            //   e8????????           |                     
            //   c7042446000000       | mov                 dword ptr [esp], 0x46
            //   e8????????           |                     

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

        $sequence_6 = { e8???????? c7042408000000 e8???????? 84c0 }
            // n = 4, score = 1200
            //   e8????????           |                     
            //   c7042408000000       | mov                 dword ptr [esp], 8
            //   e8????????           |                     
            //   84c0                 | test                al, al

        $sequence_7 = { c7042402000080 e8???????? c7042404000000 e8???????? 84c0 }
            // n = 5, score = 1200
            //   c7042402000080       | mov                 dword ptr [esp], 0x80000002
            //   e8????????           |                     
            //   c7042404000000       | mov                 dword ptr [esp], 4
            //   e8????????           |                     
            //   84c0                 | test                al, al

        $sequence_8 = { 890424 e8???????? e9???????? c704240c000000 }
            // n = 4, score = 1200
            //   890424               | mov                 dword ptr [esp], eax
            //   e8????????           |                     
            //   e9????????           |                     
            //   c704240c000000       | mov                 dword ptr [esp], 0xc

        $sequence_9 = { c7042402000000 e8???????? 84c0 7405 e8???????? }
            // n = 5, score = 1200
            //   c7042402000000       | mov                 dword ptr [esp], 2
            //   e8????????           |                     
            //   84c0                 | test                al, al
            //   7405                 | je                  7
            //   e8????????           |                     

    condition:
        7 of them and filesize < 416768
}