rule win_nettraveler_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-05-04"
        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 = "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 = { 3bc3 7420 0145f8 8b450c }
            // n = 4, score = 100
            //   3bc3                 | cmp                 eax, ebx
            //   7420                 | je                  0x22
            //   0145f8               | add                 dword ptr [ebp - 8], eax
            //   8b450c               | mov                 eax, dword ptr [ebp + 0xc]

        $sequence_1 = { ffd3 59 59 8d85c0feffff }
            // n = 4, score = 100
            //   ffd3                 | call                ebx
            //   59                   | pop                 ecx
            //   59                   | pop                 ecx
            //   8d85c0feffff         | lea                 eax, [ebp - 0x140]

        $sequence_2 = { 0bd1 0355b4 8dbc17aac7b6e9 8bd0 8bcf }
            // n = 5, score = 100
            //   0bd1                 | or                  edx, ecx
            //   0355b4               | add                 edx, dword ptr [ebp - 0x4c]
            //   8dbc17aac7b6e9       | lea                 edi, [edi + edx - 0x16493856]
            //   8bd0                 | mov                 edx, eax
            //   8bcf                 | mov                 ecx, edi

        $sequence_3 = { 68???????? 68???????? ff15???????? 8bf0 83c43c 3bf3 7504 }
            // n = 7, score = 100
            //   68????????           |                     
            //   68????????           |                     
            //   ff15????????         |                     
            //   8bf0                 | mov                 esi, eax
            //   83c43c               | add                 esp, 0x3c
            //   3bf3                 | cmp                 esi, ebx
            //   7504                 | jne                 6

        $sequence_4 = { 8d8588f3ffff 68???????? 50 ffd7 59 8d85a4feffff 59 }
            // n = 7, score = 100
            //   8d8588f3ffff         | lea                 eax, [ebp - 0xc78]
            //   68????????           |                     
            //   50                   | push                eax
            //   ffd7                 | call                edi
            //   59                   | pop                 ecx
            //   8d85a4feffff         | lea                 eax, [ebp - 0x15c]
            //   59                   | pop                 ecx

        $sequence_5 = { 7522 e8???????? 393d???????? 7410 e8???????? 85c0 7507 }
            // n = 7, score = 100
            //   7522                 | jne                 0x24
            //   e8????????           |                     
            //   393d????????         |                     
            //   7410                 | je                  0x12
            //   e8????????           |                     
            //   85c0                 | test                eax, eax
            //   7507                 | jne                 9

        $sequence_6 = { ab 8d45b8 6a10 50 68???????? e8???????? }
            // n = 6, score = 100
            //   ab                   | stosd               dword ptr es:[edi], eax
            //   8d45b8               | lea                 eax, [ebp - 0x48]
            //   6a10                 | push                0x10
            //   50                   | push                eax
            //   68????????           |                     
            //   e8????????           |                     

        $sequence_7 = { ff15???????? 8d45ec 50 6a28 ff15???????? }
            // n = 5, score = 100
            //   ff15????????         |                     
            //   8d45ec               | lea                 eax, [ebp - 0x14]
            //   50                   | push                eax
            //   6a28                 | push                0x28
            //   ff15????????         |                     

        $sequence_8 = { 8bf0 8bd0 c1e61c c1ea04 }
            // n = 4, score = 100
            //   8bf0                 | mov                 esi, eax
            //   8bd0                 | mov                 edx, eax
            //   c1e61c               | shl                 esi, 0x1c
            //   c1ea04               | shr                 edx, 4

        $sequence_9 = { ff75fc ff15???????? 85c0 7417 8d85f4fdffff 56 }
            // n = 6, score = 100
            //   ff75fc               | push                dword ptr [ebp - 4]
            //   ff15????????         |                     
            //   85c0                 | test                eax, eax
            //   7417                 | je                  0x19
            //   8d85f4fdffff         | lea                 eax, [ebp - 0x20c]
            //   56                   | push                esi

    condition:
        7 of them and filesize < 106496
}