rule win_asprox_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.asprox."
        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.asprox"
        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 = { 0bd0 8b450c 0345fc 8810 e9???????? 8a45fb }
            // n = 6, score = 1200
            //   0bd0                 | or                  edx, eax
            //   8b450c               | mov                 eax, dword ptr [ebp + 0xc]
            //   0345fc               | add                 eax, dword ptr [ebp - 4]
            //   8810                 | mov                 byte ptr [eax], dl
            //   e9????????           |                     
            //   8a45fb               | mov                 al, byte ptr [ebp - 5]

        $sequence_1 = { 75ee 8b55ec 2b55e8 8955e0 }
            // n = 4, score = 1200
            //   75ee                 | jne                 0xfffffff0
            //   8b55ec               | mov                 edx, dword ptr [ebp - 0x14]
            //   2b55e8               | sub                 edx, dword ptr [ebp - 0x18]
            //   8955e0               | mov                 dword ptr [ebp - 0x20], edx

        $sequence_2 = { 8d4584 50 8b8d08ffffff 51 }
            // n = 4, score = 1200
            //   8d4584               | lea                 eax, [ebp - 0x7c]
            //   50                   | push                eax
            //   8b8d08ffffff         | mov                 ecx, dword ptr [ebp - 0xf8]
            //   51                   | push                ecx

        $sequence_3 = { 83c404 83c001 50 8b45f8 50 8b4de8 51 }
            // n = 7, score = 1200
            //   83c404               | add                 esp, 4
            //   83c001               | add                 eax, 1
            //   50                   | push                eax
            //   8b45f8               | mov                 eax, dword ptr [ebp - 8]
            //   50                   | push                eax
            //   8b4de8               | mov                 ecx, dword ptr [ebp - 0x18]
            //   51                   | push                ecx

        $sequence_4 = { c7460c03000000 3b4df8 0f8324040000 8d8644040000 50 51 e8???????? }
            // n = 7, score = 1200
            //   c7460c03000000       | mov                 dword ptr [esi + 0xc], 3
            //   3b4df8               | cmp                 ecx, dword ptr [ebp - 8]
            //   0f8324040000         | jae                 0x42a
            //   8d8644040000         | lea                 eax, [esi + 0x444]
            //   50                   | push                eax
            //   51                   | push                ecx
            //   e8????????           |                     

        $sequence_5 = { 3975f4 7e2a 8b934c0c0000 0fb60cb2 8d8c8b44040000 8b39 8d14ba }
            // n = 7, score = 1200
            //   3975f4               | cmp                 dword ptr [ebp - 0xc], esi
            //   7e2a                 | jle                 0x2c
            //   8b934c0c0000         | mov                 edx, dword ptr [ebx + 0xc4c]
            //   0fb60cb2             | movzx               ecx, byte ptr [edx + esi*4]
            //   8d8c8b44040000       | lea                 ecx, [ebx + ecx*4 + 0x444]
            //   8b39                 | mov                 edi, dword ptr [ecx]
            //   8d14ba               | lea                 edx, [edx + edi*4]

        $sequence_6 = { a1???????? 8985e0fdffff 668b0d???????? 66898de4fdffff 8a15???????? 8895e6fdffff c68553feffff01 }
            // n = 7, score = 1200
            //   a1????????           |                     
            //   8985e0fdffff         | mov                 dword ptr [ebp - 0x220], eax
            //   668b0d????????       |                     
            //   66898de4fdffff       | mov                 word ptr [ebp - 0x21c], cx
            //   8a15????????         |                     
            //   8895e6fdffff         | mov                 byte ptr [ebp - 0x21a], dl
            //   c68553feffff01       | mov                 byte ptr [ebp - 0x1ad], 1

        $sequence_7 = { 6a00 8b4d08 51 8b55f8 52 ff15???????? 8945f4 }
            // n = 7, score = 1200
            //   6a00                 | push                0
            //   8b4d08               | mov                 ecx, dword ptr [ebp + 8]
            //   51                   | push                ecx
            //   8b55f8               | mov                 edx, dword ptr [ebp - 8]
            //   52                   | push                edx
            //   ff15????????         |                     
            //   8945f4               | mov                 dword ptr [ebp - 0xc], eax

        $sequence_8 = { 8b4334 85c0 0f884ff0ffff 3b45f4 0f8d46f0ffff 8365fc00 }
            // n = 6, score = 1200
            //   8b4334               | mov                 eax, dword ptr [ebx + 0x34]
            //   85c0                 | test                eax, eax
            //   0f884ff0ffff         | js                  0xfffff055
            //   3b45f4               | cmp                 eax, dword ptr [ebp - 0xc]
            //   0f8d46f0ffff         | jge                 0xfffff04c
            //   8365fc00             | and                 dword ptr [ebp - 4], 0

        $sequence_9 = { 83e937 8b550c 0355fc 880a eb0f 0fbe45fa 83e857 }
            // n = 7, score = 1200
            //   83e937               | sub                 ecx, 0x37
            //   8b550c               | mov                 edx, dword ptr [ebp + 0xc]
            //   0355fc               | add                 edx, dword ptr [ebp - 4]
            //   880a                 | mov                 byte ptr [edx], cl
            //   eb0f                 | jmp                 0x11
            //   0fbe45fa             | movsx               eax, byte ptr [ebp - 6]
            //   83e857               | sub                 eax, 0x57

    condition:
        7 of them and filesize < 155648
}