rule win_outlook_backdoor_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-05-04"
        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 = "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 = { 0f8412fdffff ff442410 ff4c2418 837c241800 7fdb e9???????? 56 }
            // n = 7, score = 600
            //   0f8412fdffff         | je                  0xfffffd18
            //   ff442410             | inc                 dword ptr [esp + 0x10]
            //   ff4c2418             | dec                 dword ptr [esp + 0x18]
            //   837c241800           | cmp                 dword ptr [esp + 0x18], 0
            //   7fdb                 | jg                  0xffffffdd
            //   e9????????           |                     
            //   56                   | push                esi

        $sequence_1 = { 6a11 53 ff7004 ff30 53 51 ff5214 }
            // n = 7, score = 600
            //   6a11                 | push                0x11
            //   53                   | push                ebx
            //   ff7004               | push                dword ptr [eax + 4]
            //   ff30                 | push                dword ptr [eax]
            //   53                   | push                ebx
            //   51                   | push                ecx
            //   ff5214               | call                dword ptr [edx + 0x14]

        $sequence_2 = { 5f 8d45e4 50 56 897de4 e8???????? eb23 }
            // n = 7, score = 600
            //   5f                   | pop                 edi
            //   8d45e4               | lea                 eax, [ebp - 0x1c]
            //   50                   | push                eax
            //   56                   | push                esi
            //   897de4               | mov                 dword ptr [ebp - 0x1c], edi
            //   e8????????           |                     
            //   eb23                 | jmp                 0x25

        $sequence_3 = { 40 83f80c 72f5 8b4d08 8d45ec 50 e8???????? }
            // n = 7, score = 600
            //   40                   | inc                 eax
            //   83f80c               | cmp                 eax, 0xc
            //   72f5                 | jb                  0xfffffff7
            //   8b4d08               | mov                 ecx, dword ptr [ebp + 8]
            //   8d45ec               | lea                 eax, [ebp - 0x14]
            //   50                   | push                eax
            //   e8????????           |                     

        $sequence_4 = { 8bf0 c645fc06 e8???????? 6a00 6a01 8d4dcc 894308 }
            // n = 7, score = 600
            //   8bf0                 | mov                 esi, eax
            //   c645fc06             | mov                 byte ptr [ebp - 4], 6
            //   e8????????           |                     
            //   6a00                 | push                0
            //   6a01                 | push                1
            //   8d4dcc               | lea                 ecx, [ebp - 0x34]
            //   894308               | mov                 dword ptr [ebx + 8], eax

        $sequence_5 = { eb3a 8ad0 80ea21 80fa5d 77f0 3c3d }
            // n = 6, score = 600
            //   eb3a                 | jmp                 0x3c
            //   8ad0                 | mov                 dl, al
            //   80ea21               | sub                 dl, 0x21
            //   80fa5d               | cmp                 dl, 0x5d
            //   77f0                 | ja                  0xfffffff2
            //   3c3d                 | cmp                 al, 0x3d

        $sequence_6 = { 83c618 3bc3 7419 57 8b4808 3b4d08 7509 }
            // n = 7, score = 600
            //   83c618               | add                 esi, 0x18
            //   3bc3                 | cmp                 eax, ebx
            //   7419                 | je                  0x1b
            //   57                   | push                edi
            //   8b4808               | mov                 ecx, dword ptr [eax + 8]
            //   3b4d08               | cmp                 ecx, dword ptr [ebp + 8]
            //   7509                 | jne                 0xb

        $sequence_7 = { 8bce e8???????? 8d45c4 50 ff7664 8d45a8 8d4e48 }
            // n = 7, score = 600
            //   8bce                 | mov                 ecx, esi
            //   e8????????           |                     
            //   8d45c4               | lea                 eax, [ebp - 0x3c]
            //   50                   | push                eax
            //   ff7664               | push                dword ptr [esi + 0x64]
            //   8d45a8               | lea                 eax, [ebp - 0x58]
            //   8d4e48               | lea                 ecx, [esi + 0x48]

        $sequence_8 = { 83ec10 56 57 8d442408 e8???????? 8b30 8b7804 }
            // n = 7, score = 600
            //   83ec10               | sub                 esp, 0x10
            //   56                   | push                esi
            //   57                   | push                edi
            //   8d442408             | lea                 eax, [esp + 8]
            //   e8????????           |                     
            //   8b30                 | mov                 esi, dword ptr [eax]
            //   8b7804               | mov                 edi, dword ptr [eax + 4]

        $sequence_9 = { e8???????? 81ec88000000 8365ec00 56 8d856cffffff 50 }
            // n = 6, score = 600
            //   e8????????           |                     
            //   81ec88000000         | sub                 esp, 0x88
            //   8365ec00             | and                 dword ptr [ebp - 0x14], 0
            //   56                   | push                esi
            //   8d856cffffff         | lea                 eax, [ebp - 0x94]
            //   50                   | push                eax

    condition:
        7 of them and filesize < 2912256
}