rule win_danabot_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-05-04"
        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 = "20260422"
        malpedia_hash = "a182e35da64e6d71cb55f125c4d4225196523f14"
        malpedia_version = "20260504"
        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 = { 53 81c4f4fdffff 8bd8 a1???????? }
            // n = 4, score = 400
            //   53                   | push                ebx
            //   81c4f4fdffff         | add                 esp, 0xfffffdf4
            //   8bd8                 | mov                 ebx, eax
            //   a1????????           |                     

        $sequence_1 = { e8???????? 8b07 50 8b442438 50 }
            // n = 5, score = 400
            //   e8????????           |                     
            //   8b07                 | mov                 eax, dword ptr [edi]
            //   50                   | push                eax
            //   8b442438             | mov                 eax, dword ptr [esp + 0x38]
            //   50                   | push                eax

        $sequence_2 = { 68c3595b65 8bc3 8b0f 8b16 e8???????? 8b07 }
            // n = 6, score = 400
            //   68c3595b65           | push                0x655b59c3
            //   8bc3                 | mov                 eax, ebx
            //   8b0f                 | mov                 ecx, dword ptr [edi]
            //   8b16                 | mov                 edx, dword ptr [esi]
            //   e8????????           |                     
            //   8b07                 | mov                 eax, dword ptr [edi]

        $sequence_3 = { 55 8bec 8b4510 8b15???????? 8990b8000000 8b15???????? 8990c4000000 }
            // n = 7, score = 400
            //   55                   | push                ebp
            //   8bec                 | mov                 ebp, esp
            //   8b4510               | mov                 eax, dword ptr [ebp + 0x10]
            //   8b15????????         |                     
            //   8990b8000000         | mov                 dword ptr [eax + 0xb8], edx
            //   8b15????????         |                     
            //   8990c4000000         | mov                 dword ptr [eax + 0xc4], edx

        $sequence_4 = { 50 6a0a 6897ff2a43 8bc5 8b0e 8b13 e8???????? }
            // n = 7, score = 400
            //   50                   | push                eax
            //   6a0a                 | push                0xa
            //   6897ff2a43           | push                0x432aff97
            //   8bc5                 | mov                 eax, ebp
            //   8b0e                 | mov                 ecx, dword ptr [esi]
            //   8b13                 | mov                 edx, dword ptr [ebx]
            //   e8????????           |                     

        $sequence_5 = { 8b17 e8???????? 8b0424 8b13 }
            // n = 4, score = 400
            //   8b17                 | mov                 edx, dword ptr [edi]
            //   e8????????           |                     
            //   8b0424               | mov                 eax, dword ptr [esp]
            //   8b13                 | mov                 edx, dword ptr [ebx]

        $sequence_6 = { 8b5dfc 8d4df4 0fb603 b202 e8???????? 8b55f4 8d45f8 }
            // n = 7, score = 400
            //   8b5dfc               | mov                 ebx, dword ptr [ebp - 4]
            //   8d4df4               | lea                 ecx, [ebp - 0xc]
            //   0fb603               | movzx               eax, byte ptr [ebx]
            //   b202                 | mov                 dl, 2
            //   e8????????           |                     
            //   8b55f4               | mov                 edx, dword ptr [ebp - 0xc]
            //   8d45f8               | lea                 eax, [ebp - 8]

        $sequence_7 = { e8???????? 3b05???????? 7e0a c705????????45000000 a1???????? }
            // n = 5, score = 400
            //   e8????????           |                     
            //   3b05????????         |                     
            //   7e0a                 | jle                 0xc
            //   c705????????45000000     |     
            //   a1????????           |                     

        $sequence_8 = { 50 6a15 6891d386eb 8bc6 }
            // n = 4, score = 400
            //   50                   | push                eax
            //   6a15                 | push                0x15
            //   6891d386eb           | push                0xeb86d391
            //   8bc6                 | mov                 eax, esi

        $sequence_9 = { 8bde 85db 7405 83eb04 }
            // n = 4, score = 400
            //   8bde                 | mov                 ebx, esi
            //   85db                 | test                ebx, ebx
            //   7405                 | je                  7
            //   83eb04               | sub                 ebx, 4

    condition:
        7 of them and filesize < 237568
}