rule win_danabot_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.danabot."
        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.danabot"
        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 = { a3???????? 8b45fc e8???????? 8bf0 56 ff15???????? }
            // n = 6, score = 400
            //   a3????????           |                     
            //   8b45fc               | mov                 eax, dword ptr [ebp - 4]
            //   e8????????           |                     
            //   8bf0                 | mov                 esi, eax
            //   56                   | push                esi
            //   ff15????????         |                     

        $sequence_1 = { 7431 8d45f0 50 6a04 8d45f4 50 }
            // n = 6, score = 400
            //   7431                 | je                  0x33
            //   8d45f0               | lea                 eax, [ebp - 0x10]
            //   50                   | push                eax
            //   6a04                 | push                4
            //   8d45f4               | lea                 eax, [ebp - 0xc]
            //   50                   | push                eax

        $sequence_2 = { e8???????? 8bc3 b958000000 33d2 e8???????? a1???????? }
            // n = 6, score = 400
            //   e8????????           |                     
            //   8bc3                 | mov                 eax, ebx
            //   b958000000           | mov                 ecx, 0x58
            //   33d2                 | xor                 edx, edx
            //   e8????????           |                     
            //   a1????????           |                     

        $sequence_3 = { e8???????? 8b03 50 8b442444 }
            // n = 4, score = 400
            //   e8????????           |                     
            //   8b03                 | mov                 eax, dword ptr [ebx]
            //   50                   | push                eax
            //   8b442444             | mov                 eax, dword ptr [esp + 0x44]

        $sequence_4 = { e8???????? 8b45fc 8b00 85c0 7405 83e804 8b00 }
            // n = 7, score = 400
            //   e8????????           |                     
            //   8b45fc               | mov                 eax, dword ptr [ebp - 4]
            //   8b00                 | mov                 eax, dword ptr [eax]
            //   85c0                 | test                eax, eax
            //   7405                 | je                  7
            //   83e804               | sub                 eax, 4
            //   8b00                 | mov                 eax, dword ptr [eax]

        $sequence_5 = { 68f87ca21f 8bc7 8b0b 8b5500 e8???????? 8b03 }
            // n = 6, score = 400
            //   68f87ca21f           | push                0x1fa27cf8
            //   8bc7                 | mov                 eax, edi
            //   8b0b                 | mov                 ecx, dword ptr [ebx]
            //   8b5500               | mov                 edx, dword ptr [ebp]
            //   e8????????           |                     
            //   8b03                 | mov                 eax, dword ptr [ebx]

        $sequence_6 = { 6a0c 68937198fd 8bc5 8b0e }
            // n = 4, score = 400
            //   6a0c                 | push                0xc
            //   68937198fd           | push                0xfd987193
            //   8bc5                 | mov                 eax, ebp
            //   8b0e                 | mov                 ecx, dword ptr [esi]

        $sequence_7 = { 8bd8 895dec 8b45f0 c1e020 03c3 8906 }
            // n = 6, score = 400
            //   8bd8                 | mov                 ebx, eax
            //   895dec               | mov                 dword ptr [ebp - 0x14], ebx
            //   8b45f0               | mov                 eax, dword ptr [ebp - 0x10]
            //   c1e020               | shl                 eax, 0x20
            //   03c3                 | add                 eax, ebx
            //   8906                 | mov                 dword ptr [esi], eax

        $sequence_8 = { 83e804 8b00 d1e8 e8???????? 8945e8 8b45fc 85c0 }
            // n = 7, score = 400
            //   83e804               | sub                 eax, 4
            //   8b00                 | mov                 eax, dword ptr [eax]
            //   d1e8                 | shr                 eax, 1
            //   e8????????           |                     
            //   8945e8               | mov                 dword ptr [ebp - 0x18], eax
            //   8b45fc               | mov                 eax, dword ptr [ebp - 4]
            //   85c0                 | test                eax, eax

        $sequence_9 = { 8bd6 b900000000 e8???????? 68???????? }
            // n = 4, score = 400
            //   8bd6                 | mov                 edx, esi
            //   b900000000           | mov                 ecx, 0
            //   e8????????           |                     
            //   68????????           |                     

    condition:
        7 of them and filesize < 237568
}