rule win_outlook_backdoor_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.outlook_backdoor."
        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.outlook_backdoor"
        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 = { 8b4d0c 832100 57 8d3c06 8975f8 3bf7 }
            // n = 6, score = 600
            //   8b4d0c               | mov                 ecx, dword ptr [ebp + 0xc]
            //   832100               | and                 dword ptr [ecx], 0
            //   57                   | push                edi
            //   8d3c06               | lea                 edi, [esi + eax]
            //   8975f8               | mov                 dword ptr [ebp - 8], esi
            //   3bf7                 | cmp                 esi, edi

        $sequence_1 = { e8???????? 51 51 56 57 33ff 57 }
            // n = 7, score = 600
            //   e8????????           |                     
            //   51                   | push                ecx
            //   51                   | push                ecx
            //   56                   | push                esi
            //   57                   | push                edi
            //   33ff                 | xor                 edi, edi
            //   57                   | push                edi

        $sequence_2 = { 7d04 b12d eb07 8a4e08 eb02 32c9 }
            // n = 6, score = 600
            //   7d04                 | jge                 6
            //   b12d                 | mov                 cl, 0x2d
            //   eb07                 | jmp                 9
            //   8a4e08               | mov                 cl, byte ptr [esi + 8]
            //   eb02                 | jmp                 4
            //   32c9                 | xor                 cl, cl

        $sequence_3 = { e8???????? 8b4308 8bc8 2b4b04 740e 8b5b04 }
            // n = 6, score = 600
            //   e8????????           |                     
            //   8b4308               | mov                 eax, dword ptr [ebx + 8]
            //   8bc8                 | mov                 ecx, eax
            //   2b4b04               | sub                 ecx, dword ptr [ebx + 4]
            //   740e                 | je                  0x10
            //   8b5b04               | mov                 ebx, dword ptr [ebx + 4]

        $sequence_4 = { 8d45fc 50 ff36 ffd3 6a01 6a00 }
            // n = 6, score = 600
            //   8d45fc               | lea                 eax, [ebp - 4]
            //   50                   | push                eax
            //   ff36                 | push                dword ptr [esi]
            //   ffd3                 | call                ebx
            //   6a01                 | push                1
            //   6a00                 | push                0

        $sequence_5 = { ff45fc 807e1000 7422 837dfc4c 7c1c }
            // n = 5, score = 600
            //   ff45fc               | inc                 dword ptr [ebp - 4]
            //   807e1000             | cmp                 byte ptr [esi + 0x10], 0
            //   7422                 | je                  0x24
            //   837dfc4c             | cmp                 dword ptr [ebp - 4], 0x4c
            //   7c1c                 | jl                  0x1e

        $sequence_6 = { 8d45f4 ff30 53 52 e8???????? 83c40c 85c0 }
            // n = 7, score = 600
            //   8d45f4               | lea                 eax, [ebp - 0xc]
            //   ff30                 | push                dword ptr [eax]
            //   53                   | push                ebx
            //   52                   | push                edx
            //   e8????????           |                     
            //   83c40c               | add                 esp, 0xc
            //   85c0                 | test                eax, eax

        $sequence_7 = { 0f84f5000000 837c244410 8b7c2430 7304 8d7c2430 8b5c240c 8b442410 }
            // n = 7, score = 600
            //   0f84f5000000         | je                  0xfb
            //   837c244410           | cmp                 dword ptr [esp + 0x44], 0x10
            //   8b7c2430             | mov                 edi, dword ptr [esp + 0x30]
            //   7304                 | jae                 6
            //   8d7c2430             | lea                 edi, [esp + 0x30]
            //   8b5c240c             | mov                 ebx, dword ptr [esp + 0xc]
            //   8b442410             | mov                 eax, dword ptr [esp + 0x10]

        $sequence_8 = { 0f824cffffff 8bc7 2b45f8 5f 5e c9 c20800 }
            // n = 7, score = 600
            //   0f824cffffff         | jb                  0xffffff52
            //   8bc7                 | mov                 eax, edi
            //   2b45f8               | sub                 eax, dword ptr [ebp - 8]
            //   5f                   | pop                 edi
            //   5e                   | pop                 esi
            //   c9                   | leave               
            //   c20800               | ret                 8

        $sequence_9 = { c645ec32 c645ed26 c645ee09 c645ef0f c645f03a c645f13b c645f230 }
            // n = 7, score = 600
            //   c645ec32             | mov                 byte ptr [ebp - 0x14], 0x32
            //   c645ed26             | mov                 byte ptr [ebp - 0x13], 0x26
            //   c645ee09             | mov                 byte ptr [ebp - 0x12], 9
            //   c645ef0f             | mov                 byte ptr [ebp - 0x11], 0xf
            //   c645f03a             | mov                 byte ptr [ebp - 0x10], 0x3a
            //   c645f13b             | mov                 byte ptr [ebp - 0xf], 0x3b
            //   c645f230             | mov                 byte ptr [ebp - 0xe], 0x30

    condition:
        7 of them and filesize < 2912256
}