rule win_nettraveler_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.nettraveler."
        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.nettraveler"
        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 = { 0fb6443df0 50 68???????? 56 ff15???????? 83c40c }
            // n = 6, score = 100
            //   0fb6443df0           | movzx               eax, byte ptr [ebp + edi - 0x10]
            //   50                   | push                eax
            //   68????????           |                     
            //   56                   | push                esi
            //   ff15????????         |                     
            //   83c40c               | add                 esp, 0xc

        $sequence_1 = { 0f95c0 88440d8c 41 83f938 7cd7 83650800 c745fc1e000000 }
            // n = 7, score = 100
            //   0f95c0               | setne               al
            //   88440d8c             | mov                 byte ptr [ebp + ecx - 0x74], al
            //   41                   | inc                 ecx
            //   83f938               | cmp                 ecx, 0x38
            //   7cd7                 | jl                  0xffffffd9
            //   83650800             | and                 dword ptr [ebp + 8], 0
            //   c745fc1e000000       | mov                 dword ptr [ebp - 4], 0x1e

        $sequence_2 = { 68???????? 50 ff15???????? 8d858cfbffff }
            // n = 4, score = 100
            //   68????????           |                     
            //   50                   | push                eax
            //   ff15????????         |                     
            //   8d858cfbffff         | lea                 eax, [ebp - 0x474]

        $sequence_3 = { 56 e8???????? 83c410 8d8580f1ffff 68???????? 50 ffd7 }
            // n = 7, score = 100
            //   56                   | push                esi
            //   e8????????           |                     
            //   83c410               | add                 esp, 0x10
            //   8d8580f1ffff         | lea                 eax, [ebp - 0xe80]
            //   68????????           |                     
            //   50                   | push                eax
            //   ffd7                 | call                edi

        $sequence_4 = { 57 e8???????? 50 8b45fc 57 8b0406 ff7008 }
            // n = 7, score = 100
            //   57                   | push                edi
            //   e8????????           |                     
            //   50                   | push                eax
            //   8b45fc               | mov                 eax, dword ptr [ebp - 4]
            //   57                   | push                edi
            //   8b0406               | mov                 eax, dword ptr [esi + eax]
            //   ff7008               | push                dword ptr [eax + 8]

        $sequence_5 = { 750b ff45fc 837dfc03 7d34 ebd5 8b45f0 2b4508 }
            // n = 7, score = 100
            //   750b                 | jne                 0xd
            //   ff45fc               | inc                 dword ptr [ebp - 4]
            //   837dfc03             | cmp                 dword ptr [ebp - 4], 3
            //   7d34                 | jge                 0x36
            //   ebd5                 | jmp                 0xffffffd7
            //   8b45f0               | mov                 eax, dword ptr [ebp - 0x10]
            //   2b4508               | sub                 eax, dword ptr [ebp + 8]

        $sequence_6 = { e8???????? ff7514 8d45f4 50 8d45dc 50 ff7508 }
            // n = 7, score = 100
            //   e8????????           |                     
            //   ff7514               | push                dword ptr [ebp + 0x14]
            //   8d45f4               | lea                 eax, [ebp - 0xc]
            //   50                   | push                eax
            //   8d45dc               | lea                 eax, [ebp - 0x24]
            //   50                   | push                eax
            //   ff7508               | push                dword ptr [ebp + 8]

        $sequence_7 = { 8b5d10 8b45fc 2bde 894518 6a01 8d45e4 ff7514 }
            // n = 7, score = 100
            //   8b5d10               | mov                 ebx, dword ptr [ebp + 0x10]
            //   8b45fc               | mov                 eax, dword ptr [ebp - 4]
            //   2bde                 | sub                 ebx, esi
            //   894518               | mov                 dword ptr [ebp + 0x18], eax
            //   6a01                 | push                1
            //   8d45e4               | lea                 eax, [ebp - 0x1c]
            //   ff7514               | push                dword ptr [ebp + 0x14]

        $sequence_8 = { ba???????? 0fb69f4c910010 8d8764910010 807c1dc400 }
            // n = 4, score = 100
            //   ba????????           |                     
            //   0fb69f4c910010       | movzx               ebx, byte ptr [edi + 0x1000914c]
            //   8d8764910010         | lea                 eax, [edi + 0x10009164]
            //   807c1dc400           | cmp                 byte ptr [ebp + ebx - 0x3c], 0

        $sequence_9 = { 0106 33df 035de0 8d8c1935f23abd 8bd9 c1eb16 }
            // n = 6, score = 100
            //   0106                 | add                 dword ptr [esi], eax
            //   33df                 | xor                 ebx, edi
            //   035de0               | add                 ebx, dword ptr [ebp - 0x20]
            //   8d8c1935f23abd       | lea                 ecx, [ecx + ebx - 0x42c50dcb]
            //   8bd9                 | mov                 ebx, ecx
            //   c1eb16               | shr                 ebx, 0x16

    condition:
        7 of them and filesize < 106496
}