rule win_telb_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.telb."
        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.telb"
        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 = { 735f 8bc6 8bfe 83e03f c1ff06 6bd838 8b04bd08e34100 }
            // n = 7, score = 200
            //   735f                 | jae                 0x61
            //   8bc6                 | mov                 eax, esi
            //   8bfe                 | mov                 edi, esi
            //   83e03f               | and                 eax, 0x3f
            //   c1ff06               | sar                 edi, 6
            //   6bd838               | imul                ebx, eax, 0x38
            //   8b04bd08e34100       | mov                 eax, dword ptr [edi*4 + 0x41e308]

        $sequence_1 = { 0fb70f 0fb730 663bce 721d 2bf8 663bce 7716 }
            // n = 7, score = 200
            //   0fb70f               | movzx               ecx, word ptr [edi]
            //   0fb730               | movzx               esi, word ptr [eax]
            //   663bce               | cmp                 cx, si
            //   721d                 | jb                  0x1f
            //   2bf8                 | sub                 edi, eax
            //   663bce               | cmp                 cx, si
            //   7716                 | ja                  0x18

        $sequence_2 = { 8d45f4 64a300000000 33ff 8d8dd0efffff 89bd38eeffff }
            // n = 5, score = 200
            //   8d45f4               | lea                 eax, [ebp - 0xc]
            //   64a300000000         | mov                 dword ptr fs:[0], eax
            //   33ff                 | xor                 edi, edi
            //   8d8dd0efffff         | lea                 ecx, [ebp - 0x1030]
            //   89bd38eeffff         | mov                 dword ptr [ebp - 0x11c8], edi

        $sequence_3 = { d1f9 51 52 b9???????? e8???????? e9???????? 6a04 }
            // n = 7, score = 200
            //   d1f9                 | sar                 ecx, 1
            //   51                   | push                ecx
            //   52                   | push                edx
            //   b9????????           |                     
            //   e8????????           |                     
            //   e9????????           |                     
            //   6a04                 | push                4

        $sequence_4 = { 743f 83fbff 743a ff15???????? 8b3d???????? 89442414 896c2418 }
            // n = 7, score = 200
            //   743f                 | je                  0x41
            //   83fbff               | cmp                 ebx, -1
            //   743a                 | je                  0x3c
            //   ff15????????         |                     
            //   8b3d????????         |                     
            //   89442414             | mov                 dword ptr [esp + 0x14], eax
            //   896c2418             | mov                 dword ptr [esp + 0x18], ebp

        $sequence_5 = { eb03 50 6af6 ff15???????? 8b04bd08e34100 834c0318ff }
            // n = 6, score = 200
            //   eb03                 | jmp                 5
            //   50                   | push                eax
            //   6af6                 | push                -0xa
            //   ff15????????         |                     
            //   8b04bd08e34100       | mov                 eax, dword ptr [edi*4 + 0x41e308]
            //   834c0318ff           | or                  dword ptr [ebx + eax + 0x18], 0xffffffff

        $sequence_6 = { 83c408 33c0 c7461000000000 c7461407000000 668906 83ad30eeffff01 }
            // n = 6, score = 200
            //   83c408               | add                 esp, 8
            //   33c0                 | xor                 eax, eax
            //   c7461000000000       | mov                 dword ptr [esi + 0x10], 0
            //   c7461407000000       | mov                 dword ptr [esi + 0x14], 7
            //   668906               | mov                 word ptr [esi], ax
            //   83ad30eeffff01       | sub                 dword ptr [ebp - 0x11d0], 1

        $sequence_7 = { 7214 8b49fc 83c223 2bc1 83c0fc 83f81f 0f8758140000 }
            // n = 7, score = 200
            //   7214                 | jb                  0x16
            //   8b49fc               | mov                 ecx, dword ptr [ecx - 4]
            //   83c223               | add                 edx, 0x23
            //   2bc1                 | sub                 eax, ecx
            //   83c0fc               | add                 eax, -4
            //   83f81f               | cmp                 eax, 0x1f
            //   0f8758140000         | ja                  0x145e

        $sequence_8 = { 8bca 33c0 6689442448 8d7102 668b01 83c102 6685c0 }
            // n = 7, score = 200
            //   8bca                 | mov                 ecx, edx
            //   33c0                 | xor                 eax, eax
            //   6689442448           | mov                 word ptr [esp + 0x48], ax
            //   8d7102               | lea                 esi, [ecx + 2]
            //   668b01               | mov                 ax, word ptr [ecx]
            //   83c102               | add                 ecx, 2
            //   6685c0               | test                ax, ax

        $sequence_9 = { 0f82fa000000 8d0429 8bf8 89442420 83cf07 }
            // n = 5, score = 200
            //   0f82fa000000         | jb                  0x100
            //   8d0429               | lea                 eax, [ecx + ebp]
            //   8bf8                 | mov                 edi, eax
            //   89442420             | mov                 dword ptr [esp + 0x20], eax
            //   83cf07               | or                  edi, 7

    condition:
        7 of them and filesize < 286720
}