rule win_turian_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.turian."
        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.turian"
        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 = { eb04 8d74241c 68???????? 56 ffd7 }
            // n = 5, score = 400
            //   eb04                 | jmp                 6
            //   8d74241c             | lea                 esi, [esp + 0x1c]
            //   68????????           |                     
            //   56                   | push                esi
            //   ffd7                 | call                edi

        $sequence_1 = { 8b2d???????? 33c0 8d5c2414 83c404 89442410 c1eb04 8d740704 }
            // n = 7, score = 400
            //   8b2d????????         |                     
            //   33c0                 | xor                 eax, eax
            //   8d5c2414             | lea                 ebx, [esp + 0x14]
            //   83c404               | add                 esp, 4
            //   89442410             | mov                 dword ptr [esp + 0x10], eax
            //   c1eb04               | shr                 ebx, 4
            //   8d740704             | lea                 esi, [edi + eax + 4]

        $sequence_2 = { 85c0 752f ffd5 0305???????? }
            // n = 4, score = 400
            //   85c0                 | test                eax, eax
            //   752f                 | jne                 0x31
            //   ffd5                 | call                ebp
            //   0305????????         |                     

        $sequence_3 = { ff15???????? 8bd6 33c9 8bbc2488000000 89442410 890a }
            // n = 6, score = 400
            //   ff15????????         |                     
            //   8bd6                 | mov                 edx, esi
            //   33c9                 | xor                 ecx, ecx
            //   8bbc2488000000       | mov                 edi, dword ptr [esp + 0x88]
            //   89442410             | mov                 dword ptr [esp + 0x10], eax
            //   890a                 | mov                 dword ptr [edx], ecx

        $sequence_4 = { 5b 81c420040000 c3 8d4c2410 6a10 51 }
            // n = 6, score = 400
            //   5b                   | pop                 ebx
            //   81c420040000         | add                 esp, 0x420
            //   c3                   | ret                 
            //   8d4c2410             | lea                 ecx, [esp + 0x10]
            //   6a10                 | push                0x10
            //   51                   | push                ecx

        $sequence_5 = { 33c0 83e103 8d542456 f3a4 }
            // n = 4, score = 400
            //   33c0                 | xor                 eax, eax
            //   83e103               | and                 ecx, 3
            //   8d542456             | lea                 edx, [esp + 0x56]
            //   f3a4                 | rep movsb           byte ptr es:[edi], byte ptr [esi]

        $sequence_6 = { ff15???????? 33c0 c3 8bc8 }
            // n = 4, score = 400
            //   ff15????????         |                     
            //   33c0                 | xor                 eax, eax
            //   c3                   | ret                 
            //   8bc8                 | mov                 ecx, eax

        $sequence_7 = { 754a 6809380000 56 8d4c2418 e8???????? 83f810 }
            // n = 6, score = 400
            //   754a                 | jne                 0x4c
            //   6809380000           | push                0x3809
            //   56                   | push                esi
            //   8d4c2418             | lea                 ecx, [esp + 0x18]
            //   e8????????           |                     
            //   83f810               | cmp                 eax, 0x10

        $sequence_8 = { c1e105 03c8 68???????? 8d1448 b921000000 }
            // n = 5, score = 400
            //   c1e105               | shl                 ecx, 5
            //   03c8                 | add                 ecx, eax
            //   68????????           |                     
            //   8d1448               | lea                 edx, [eax + ecx*2]
            //   b921000000           | mov                 ecx, 0x21

        $sequence_9 = { 5d 5b 83c474 c3 68fc1b0000 ffd3 }
            // n = 6, score = 400
            //   5d                   | pop                 ebp
            //   5b                   | pop                 ebx
            //   83c474               | add                 esp, 0x74
            //   c3                   | ret                 
            //   68fc1b0000           | push                0x1bfc
            //   ffd3                 | call                ebx

    condition:
        7 of them and filesize < 645120
}