rule win_navrat_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.navrat."
        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.navrat"
        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 = { 85f6 7407 8b4608 83401804 }
            // n = 4, score = 300
            //   85f6                 | test                esi, esi
            //   7407                 | je                  9
            //   8b4608               | mov                 eax, dword ptr [esi + 8]
            //   83401804             | add                 dword ptr [eax + 0x18], 4

        $sequence_1 = { c745d0536f6674 c745d477617265 c745d85c4d6963 c745dc726f736f c745e066745c57 c745e4696e646f }
            // n = 6, score = 300
            //   c745d0536f6674       | mov                 dword ptr [ebp - 0x30], 0x74666f53
            //   c745d477617265       | mov                 dword ptr [ebp - 0x2c], 0x65726177
            //   c745d85c4d6963       | mov                 dword ptr [ebp - 0x28], 0x63694d5c
            //   c745dc726f736f       | mov                 dword ptr [ebp - 0x24], 0x6f736f72
            //   c745e066745c57       | mov                 dword ptr [ebp - 0x20], 0x575c7466
            //   c745e4696e646f       | mov                 dword ptr [ebp - 0x1c], 0x6f646e69

        $sequence_2 = { 85f6 7407 8b7608 83461c02 5f }
            // n = 5, score = 300
            //   85f6                 | test                esi, esi
            //   7407                 | je                  9
            //   8b7608               | mov                 esi, dword ptr [esi + 8]
            //   83461c02             | add                 dword ptr [esi + 0x1c], 2
            //   5f                   | pop                 edi

        $sequence_3 = { c745d0536f6674 c745d477617265 c745d85c4d6963 c745dc726f736f c745e066745c57 c745e4696e646f c745e877735c43 }
            // n = 7, score = 300
            //   c745d0536f6674       | mov                 dword ptr [ebp - 0x30], 0x74666f53
            //   c745d477617265       | mov                 dword ptr [ebp - 0x2c], 0x65726177
            //   c745d85c4d6963       | mov                 dword ptr [ebp - 0x28], 0x63694d5c
            //   c745dc726f736f       | mov                 dword ptr [ebp - 0x24], 0x6f736f72
            //   c745e066745c57       | mov                 dword ptr [ebp - 0x20], 0x575c7466
            //   c745e4696e646f       | mov                 dword ptr [ebp - 0x1c], 0x6f646e69
            //   c745e877735c43       | mov                 dword ptr [ebp - 0x18], 0x435c7377

        $sequence_4 = { f7de 1bf6 f7de 56 68???????? }
            // n = 5, score = 300
            //   f7de                 | neg                 esi
            //   1bf6                 | sbb                 esi, esi
            //   f7de                 | neg                 esi
            //   56                   | push                esi
            //   68????????           |                     

        $sequence_5 = { 56 68???????? 50 8d85f0feffff 8bf1 50 }
            // n = 6, score = 300
            //   56                   | push                esi
            //   68????????           |                     
            //   50                   | push                eax
            //   8d85f0feffff         | lea                 eax, [ebp - 0x110]
            //   8bf1                 | mov                 esi, ecx
            //   50                   | push                eax

        $sequence_6 = { ff15???????? 8bf0 f7de 1bf6 f7de 56 }
            // n = 6, score = 300
            //   ff15????????         |                     
            //   8bf0                 | mov                 esi, eax
            //   f7de                 | neg                 esi
            //   1bf6                 | sbb                 esi, esi
            //   f7de                 | neg                 esi
            //   56                   | push                esi

        $sequence_7 = { c745e4696e646f c745e877735c43 c745ec75727265 c745f06e745665 c745f47273696f 66c745f86e5c }
            // n = 6, score = 300
            //   c745e4696e646f       | mov                 dword ptr [ebp - 0x1c], 0x6f646e69
            //   c745e877735c43       | mov                 dword ptr [ebp - 0x18], 0x435c7377
            //   c745ec75727265       | mov                 dword ptr [ebp - 0x14], 0x65727275
            //   c745f06e745665       | mov                 dword ptr [ebp - 0x10], 0x6556746e
            //   c745f47273696f       | mov                 dword ptr [ebp - 0xc], 0x6f697372
            //   66c745f86e5c         | mov                 word ptr [ebp - 8], 0x5c6e

        $sequence_8 = { 0f95c0 fec8 2440 fec8 c3 }
            // n = 5, score = 300
            //   0f95c0               | setne               al
            //   fec8                 | dec                 al
            //   2440                 | and                 al, 0x40
            //   fec8                 | dec                 al
            //   c3                   | ret                 

        $sequence_9 = { e8???????? 66a1???????? 83c40c 6683f805 }
            // n = 4, score = 300
            //   e8????????           |                     
            //   66a1????????         |                     
            //   83c40c               | add                 esp, 0xc
            //   6683f805             | cmp                 ax, 5

    condition:
        7 of them and filesize < 352256
}