rule win_nitrogen_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.nitrogen."
        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.nitrogen"
        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 = { 8905???????? 488b05???????? 48ffc0 488905???????? }
            // n = 4, score = 400
            //   8905????????         |                     
            //   488b05????????       |                     
            //   48ffc0               | dec                 eax
            //   488905????????       |                     

        $sequence_1 = { 4898 488905???????? 8b05???????? 488905???????? }
            // n = 4, score = 400
            //   4898                 | inc                 eax
            //   488905????????       |                     
            //   8b05????????         |                     
            //   488905????????       |                     

        $sequence_2 = { 488b05???????? 89442454 8b05???????? 89442458 }
            // n = 4, score = 300
            //   488b05????????       |                     
            //   89442454             | je                  0x2b
            //   8b05????????         |                     
            //   89442458             | inc                 eax

        $sequence_3 = { e8???????? 4898 488905???????? 488b05???????? }
            // n = 4, score = 300
            //   e8????????           |                     
            //   4898                 | jmp                 0x37
            //   488905????????       |                     
            //   488b05????????       |                     

        $sequence_4 = { eb35 488b05???????? 4885c0 7429 }
            // n = 4, score = 300
            //   eb35                 | cwde                
            //   488b05????????       |                     
            //   4885c0               | dec                 eax
            //   7429                 | dec                 eax

        $sequence_5 = { 668905???????? 488b05???????? 48ffc8 488905???????? }
            // n = 4, score = 300
            //   668905????????       |                     
            //   488b05????????       |                     
            //   48ffc8               | dec                 eax
            //   488905????????       |                     

        $sequence_6 = { 668905???????? 8b05???????? 668905???????? 8b05???????? }
            // n = 4, score = 300
            //   668905????????       |                     
            //   8b05????????         |                     
            //   668905????????       |                     
            //   8b05????????         |                     

        $sequence_7 = { 8905???????? 488b05???????? 480faf05???????? 488905???????? }
            // n = 4, score = 300
            //   8905????????         |                     
            //   488b05????????       |                     
            //   480faf05????????     |                     
            //   488905????????       |                     

        $sequence_8 = { 0fbe05???????? c1e002 4898 488905???????? }
            // n = 4, score = 300
            //   0fbe05????????       |                     
            //   c1e002               | dec                 eax
            //   4898                 | test                eax, eax
            //   488905????????       |                     

        $sequence_9 = { 8b05???????? ffc0 8905???????? 0fb705???????? }
            // n = 4, score = 300
            //   8b05????????         |                     
            //   ffc0                 | jmp                 0x37
            //   8905????????         |                     
            //   0fb705????????       |                     

        $sequence_10 = { 480fbec0 488905???????? 488b05???????? 4885c0 }
            // n = 4, score = 300
            //   480fbec0             | shl                 eax, 2
            //   488905????????       |                     
            //   488b05????????       |                     
            //   4885c0               | dec                 eax

        $sequence_11 = { e8???????? 98 8905???????? 8b05???????? 85c0 }
            // n = 5, score = 300
            //   e8????????           |                     
            //   98                   | mov                 dword ptr [esp + 0x54], eax
            //   8905????????         |                     
            //   8b05????????         |                     
            //   85c0                 | mov                 dword ptr [esp + 0x58], eax

    condition:
        7 of them and filesize < 135349248
}