rule win_webbytea_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.webbytea."
        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.webbytea"
        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 = { e9???????? c744242000000000 4533c9 4533c0 33d2 33c9 }
            // n = 6, score = 300
            //   e9????????           |                     
            //   c744242000000000     | dec                 eax
            //   4533c9               | lea                 ecx, [0xc62b]
            //   4533c0               | dec                 eax
            //   33d2                 | mov                 eax, dword ptr [esp + 0x28]
            //   33c9                 | mov                 eax, dword ptr [esp + 0x30]

        $sequence_1 = { c68424f100000072 c68424f200000065 c68424f300000061 c68424f400000074 }
            // n = 4, score = 300
            //   c68424f100000072     | dec                 eax
            //   c68424f200000065     | lea                 eax, [0xb5e5]
            //   c68424f300000061     | inc                 ecx
            //   c68424f400000074     | mov                 ecx, 0x1b

        $sequence_2 = { 891481 488b842488020000 8b00 ffc0 488b8c2488020000 8901 }
            // n = 6, score = 300
            //   891481               | mov                 dword ptr [esp + 0x88], 0xffffffff
            //   488b842488020000     | dec                 eax
            //   8b00                 | inc                 dword ptr [esp + 0x88]
            //   ffc0                 | dec                 eax
            //   488b8c2488020000     | mov                 ecx, dword ptr [esp + 0xc8]
            //   8901                 | dec                 eax

        $sequence_3 = { e9???????? c744242000000000 4533c9 4533c0 33d2 33c9 ff15???????? }
            // n = 7, score = 300
            //   e9????????           |                     
            //   c744242000000000     | lea                 ecx, [0xc62b]
            //   4533c9               | dec                 eax
            //   4533c0               | mov                 eax, dword ptr [esp + 0x28]
            //   33d2                 | dec                 eax
            //   33c9                 | lea                 eax, [esp + 0x28]
            //   ff15????????         |                     

        $sequence_4 = { 4803c8 488bc1 48c744243000000000 c744242800000000 4889442420 }
            // n = 5, score = 300
            //   4803c8               | imul                eax, eax, 0
            //   488bc1               | jmp                 0xe7a
            //   48c744243000000000     | dec    eax
            //   c744242800000000     | arpl                word ptr [esp + 0x30], ax
            //   4889442420           | dec                 eax

        $sequence_5 = { 488b842488020000 8b00 ffc0 488b8c2488020000 8901 }
            // n = 5, score = 300
            //   488b842488020000     | dec                 eax
            //   8b00                 | mov                 ecx, dword ptr [esp + 0x28]
            //   ffc0                 | dec                 eax
            //   488b8c2488020000     | sub                 ecx, eax
            //   8901                 | dec                 eax

        $sequence_6 = { ffc0 488b8c2488020000 8901 488d542430 488b4c2420 }
            // n = 5, score = 300
            //   ffc0                 | mov                 eax, 0x72
            //   488b8c2488020000     | mov                 word ptr [esp + 0xce], ax
            //   8901                 | mov                 eax, 0x73
            //   488d542430           | mov                 word ptr [esp + 0xd0], ax
            //   488b4c2420           | mov                 eax, 0x69

        $sequence_7 = { 488b8c2480020000 8b542438 891481 488b842488020000 8b00 ffc0 488b8c2488020000 }
            // n = 7, score = 300
            //   488b8c2480020000     | mov                 dword ptr [esp + 0x90], eax
            //   8b542438             | movzx               eax, byte ptr [eax + 0x28]
            //   891481               | test                eax, eax
            //   488b842488020000     | je                  0x4ba
            //   8b00                 | mov                 eax, dword ptr [esp + 0xe0]
            //   ffc0                 | dec                 eax
            //   488b8c2488020000     | mov                 ecx, dword ptr [esp + 0x190]

        $sequence_8 = { 4883ec18 c7042400000000 eb08 8b0424 ffc0 890424 8b442438 }
            // n = 7, score = 300
            //   4883ec18             | mov                 byte ptr [esp + 0xc9], 0x79
            //   c7042400000000       | mov                 byte ptr [esp + 0xca], 0x45
            //   eb08                 | mov                 byte ptr [esp + 0x1c5], 0x65
            //   8b0424               | mov                 byte ptr [esp + 0x1c6], 0x72
            //   ffc0                 | mov                 byte ptr [esp + 0x1c7], 0x79
            //   890424               | mov                 byte ptr [esp + 0x1c8], 0x56
            //   8b442438             | mov                 byte ptr [esp + 0x1c9], 0x61

        $sequence_9 = { 8b00 ffc0 488b8c2488020000 8901 488d542430 }
            // n = 5, score = 300
            //   8b00                 | mov                 ecx, eax
            //   ffc0                 | rep movsb           byte ptr es:[edi], byte ptr [esi]
            //   488b8c2488020000     | dec                 eax
            //   8901                 | lea                 edx, [esp + 0x1e8]
            //   488d542430           | dec                 eax

    condition:
        7 of them and filesize < 552960
}