rule win_blackcat_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.blackcat."
        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.blackcat"
        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 = { eb16 8d441701 f7d2 8b4df0 0355ec 8901 895104 }
            // n = 7, score = 600
            //   eb16                 | jmp                 0x18
            //   8d441701             | lea                 eax, [edi + edx + 1]
            //   f7d2                 | not                 edx
            //   8b4df0               | mov                 ecx, dword ptr [ebp - 0x10]
            //   0355ec               | add                 edx, dword ptr [ebp - 0x14]
            //   8901                 | mov                 dword ptr [ecx], eax
            //   895104               | mov                 dword ptr [ecx + 4], edx

        $sequence_1 = { 760f 833801 89c7 7508 83c704 e9???????? a1???????? }
            // n = 7, score = 600
            //   760f                 | jbe                 0x11
            //   833801               | cmp                 dword ptr [eax], 1
            //   89c7                 | mov                 edi, eax
            //   7508                 | jne                 0xa
            //   83c704               | add                 edi, 4
            //   e9????????           |                     
            //   a1????????           |                     

        $sequence_2 = { 01f3 01d3 8b45e4 895dd4 31db 83c0fd 8945d0 }
            // n = 7, score = 600
            //   01f3                 | add                 ebx, esi
            //   01d3                 | add                 ebx, edx
            //   8b45e4               | mov                 eax, dword ptr [ebp - 0x1c]
            //   895dd4               | mov                 dword ptr [ebp - 0x2c], ebx
            //   31db                 | xor                 ebx, ebx
            //   83c0fd               | add                 eax, -3
            //   8945d0               | mov                 dword ptr [ebp - 0x30], eax

        $sequence_3 = { 8d8cb99c010000 ff75dc 51 50 e8???????? }
            // n = 5, score = 600
            //   8d8cb99c010000       | lea                 ecx, [ecx + edi*4 + 0x19c]
            //   ff75dc               | push                dword ptr [ebp - 0x24]
            //   51                   | push                ecx
            //   50                   | push                eax
            //   e8????????           |                     

        $sequence_4 = { 8906 895e04 0f84c4000000 8b460c 85ff 7513 }
            // n = 6, score = 600
            //   8906                 | mov                 dword ptr [esi], eax
            //   895e04               | mov                 dword ptr [esi + 4], ebx
            //   0f84c4000000         | je                  0xca
            //   8b460c               | mov                 eax, dword ptr [esi + 0xc]
            //   85ff                 | test                edi, edi
            //   7513                 | jne                 0x15

        $sequence_5 = { 8b39 85ff 74e2 381437 75db }
            // n = 5, score = 600
            //   8b39                 | mov                 edi, dword ptr [ecx]
            //   85ff                 | test                edi, edi
            //   74e2                 | je                  0xffffffe4
            //   381437               | cmp                 byte ptr [edi + esi], dl
            //   75db                 | jne                 0xffffffdd

        $sequence_6 = { 897dec 894df0 7428 8d7de8 }
            // n = 4, score = 600
            //   897dec               | mov                 dword ptr [ebp - 0x14], edi
            //   894df0               | mov                 dword ptr [ebp - 0x10], ecx
            //   7428                 | je                  0x2a
            //   8d7de8               | lea                 edi, [ebp - 0x18]

        $sequence_7 = { 39f0 7225 8b07 01d8 56 51 }
            // n = 6, score = 600
            //   39f0                 | cmp                 eax, esi
            //   7225                 | jb                  0x27
            //   8b07                 | mov                 eax, dword ptr [edi]
            //   01d8                 | add                 eax, ebx
            //   56                   | push                esi
            //   51                   | push                ecx

        $sequence_8 = { 8a5d08 b018 88dc fecc 80fc07 }
            // n = 5, score = 600
            //   8a5d08               | mov                 bl, byte ptr [ebp + 8]
            //   b018                 | mov                 al, 0x18
            //   88dc                 | mov                 ah, bl
            //   fecc                 | dec                 ah
            //   80fc07               | cmp                 ah, 7

        $sequence_9 = { 53 52 50 e8???????? 83c40c 01df b004 }
            // n = 7, score = 600
            //   53                   | push                ebx
            //   52                   | push                edx
            //   50                   | push                eax
            //   e8????????           |                     
            //   83c40c               | add                 esp, 0xc
            //   01df                 | add                 edi, ebx
            //   b004                 | mov                 al, 4

    condition:
        7 of them and filesize < 29981696
}