rule win_deathransom_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.deathransom."
        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.deathransom"
        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 = { 894508 8b450c 56 8b4808 33c0 894df4 8bd1 }
            // n = 7, score = 100
            //   894508               | mov                 dword ptr [ebp + 8], eax
            //   8b450c               | mov                 eax, dword ptr [ebp + 0xc]
            //   56                   | push                esi
            //   8b4808               | mov                 ecx, dword ptr [eax + 8]
            //   33c0                 | xor                 eax, eax
            //   894df4               | mov                 dword ptr [ebp - 0xc], ecx
            //   8bd1                 | mov                 edx, ecx

        $sequence_1 = { e8???????? 8b7d14 8d4308 8bf7 83c40c 33d2 2bf3 }
            // n = 7, score = 100
            //   e8????????           |                     
            //   8b7d14               | mov                 edi, dword ptr [ebp + 0x14]
            //   8d4308               | lea                 eax, [ebx + 8]
            //   8bf7                 | mov                 esi, edi
            //   83c40c               | add                 esp, 0xc
            //   33d2                 | xor                 edx, edx
            //   2bf3                 | sub                 esi, ebx

        $sequence_2 = { c1c007 c1c90b 33c8 8955b0 8bc7 8b7df4 c1c806 }
            // n = 7, score = 100
            //   c1c007               | rol                 eax, 7
            //   c1c90b               | ror                 ecx, 0xb
            //   33c8                 | xor                 ecx, eax
            //   8955b0               | mov                 dword ptr [ebp - 0x50], edx
            //   8bc7                 | mov                 eax, edi
            //   8b7df4               | mov                 edi, dword ptr [ebp - 0xc]
            //   c1c806               | ror                 eax, 6

        $sequence_3 = { 897de0 8b7a20 8b4618 8b5224 c1c806 33c8 }
            // n = 6, score = 100
            //   897de0               | mov                 dword ptr [ebp - 0x20], edi
            //   8b7a20               | mov                 edi, dword ptr [edx + 0x20]
            //   8b4618               | mov                 eax, dword ptr [esi + 0x18]
            //   8b5224               | mov                 edx, dword ptr [edx + 0x24]
            //   c1c806               | ror                 eax, 6
            //   33c8                 | xor                 ecx, eax

        $sequence_4 = { 8955a4 8bc7 8b7df0 c1c806 33c8 8bc6 }
            // n = 6, score = 100
            //   8955a4               | mov                 dword ptr [ebp - 0x5c], edx
            //   8bc7                 | mov                 eax, edi
            //   8b7df0               | mov                 edi, dword ptr [ebp - 0x10]
            //   c1c806               | ror                 eax, 6
            //   33c8                 | xor                 ecx, eax
            //   8bc6                 | mov                 eax, esi

        $sequence_5 = { 8b4d10 8b75f4 8b5d08 3bd9 7e28 33ff 8d348e }
            // n = 7, score = 100
            //   8b4d10               | mov                 ecx, dword ptr [ebp + 0x10]
            //   8b75f4               | mov                 esi, dword ptr [ebp - 0xc]
            //   8b5d08               | mov                 ebx, dword ptr [ebp + 8]
            //   3bd9                 | cmp                 ebx, ecx
            //   7e28                 | jle                 0x2a
            //   33ff                 | xor                 edi, edi
            //   8d348e               | lea                 esi, [esi + ecx*4]

        $sequence_6 = { 8be5 5d c3 8b4de0 5f }
            // n = 5, score = 100
            //   8be5                 | mov                 esp, ebp
            //   5d                   | pop                 ebp
            //   c3                   | ret                 
            //   8b4de0               | mov                 ecx, dword ptr [ebp - 0x20]
            //   5f                   | pop                 edi

        $sequence_7 = { 885607 885e02 88460e 886606 c745f404000000 }
            // n = 5, score = 100
            //   885607               | mov                 byte ptr [esi + 7], dl
            //   885e02               | mov                 byte ptr [esi + 2], bl
            //   88460e               | mov                 byte ptr [esi + 0xe], al
            //   886606               | mov                 byte ptr [esi + 6], ah
            //   c745f404000000       | mov                 dword ptr [ebp - 0xc], 4

        $sequence_8 = { 50 8d8518ffffff 50 e8???????? 83c40c 83ee01 }
            // n = 6, score = 100
            //   50                   | push                eax
            //   8d8518ffffff         | lea                 eax, [ebp - 0xe8]
            //   50                   | push                eax
            //   e8????????           |                     
            //   83c40c               | add                 esp, 0xc
            //   83ee01               | sub                 esi, 1

        $sequence_9 = { 6a01 6a00 68???????? ffd6 85c0 0f881b020000 68???????? }
            // n = 7, score = 100
            //   6a01                 | push                1
            //   6a00                 | push                0
            //   68????????           |                     
            //   ffd6                 | call                esi
            //   85c0                 | test                eax, eax
            //   0f881b020000         | js                  0x221
            //   68????????           |                     

    condition:
        7 of them and filesize < 133120
}