rule win_nitrogen_ransomware_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.nitrogen_ransomware."
        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_ransomware"
        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 = { 8b8424a01a0000 4431c8 66898424a41a0000 440fb78c24a61a0000 8b8424a01a0000 4431c8 66898424a61a0000 }
            // n = 7, score = 100
            //   8b8424a01a0000       | mov                 eax, dword ptr [esp + 0x560]
            //   4431c8               | add                 eax, 0x5c
            //   66898424a41a0000     | mov                 eax, dword ptr [esp + 0x560]
            //   440fb78c24a61a0000     | add    eax, 0x5c
            //   8b8424a01a0000       | mov                 word ptr [esp + 0x7c], ax
            //   4431c8               | mov                 eax, dword ptr [esp + 0x560]
            //   66898424a61a0000     | add                 eax, 0x5d

        $sequence_1 = { 836c243801 f30f6fa424b0000000 4c8b4c2428 f30f6f8c24f0000000 f7d8 f30f6f9c2430010000 f30f6fb424d0000000 }
            // n = 7, score = 100
            //   836c243801           | jle                 0x26c
            //   f30f6fa424b0000000     | cmp    dword ptr [ebp - 0xc], 0
            //   4c8b4c2428           | jne                 0x21f
            //   f30f6f8c24f0000000     | mov    dword ptr [ebp - 0xc], 1
            //   f7d8                 | jmp                 0x22c
            //   f30f6f9c2430010000     | jg    0x1d7
            //   f30f6fb424d0000000     | dec    eax

        $sequence_2 = { 660f6ec8 0fb705???????? 660f62c3 660fc40d????????01 660f6ed0 660fc415????????01 48b82c00270036002e00 }
            // n = 7, score = 100
            //   660f6ec8             | sub                 esp, 0x20
            //   0fb705????????       |                     
            //   660f62c3             | dec                 eax
            //   660fc40d????????01     |     
            //   660f6ed0             | lea                 eax, [0x609c4]
            //   660fc415????????01     |     
            //   48b82c00270036002e00     | dec    eax

        $sequence_3 = { 83c608 83c309 663335???????? 66331d???????? 4183c30a 4183c20b 6644331d???????? }
            // n = 7, score = 100
            //   83c608               | inc                 ecx
            //   83c309               | add                 eax, 4
            //   663335????????       |                     
            //   66331d????????       |                     
            //   4183c30a             | inc                 cx
            //   4183c20b             | movd                mm2, ecx
            //   6644331d????????     |                     

        $sequence_4 = { 83c005 83c205 664489b4247e560000 448d4905 0fb70d???????? 6689442438 0f11842450560000 }
            // n = 7, score = 100
            //   83c005               | inc                 esp
            //   83c205               | xor                 eax, ecx
            //   664489b4247e560000     | mov    word ptr [esp + 0x1c6c], ax
            //   448d4905             | inc                 esp
            //   0fb70d????????       |                     
            //   6689442438           | movzx               ecx, word ptr [esp + 0x1c6e]
            //   0f11842450560000     | mov                 eax, dword ptr [esp + 0x1c60]

        $sequence_5 = { 01ca 8850ff c1ea08 4939c7 75ec 31c0 31d2 }
            // n = 7, score = 100
            //   01ca                 | mov                 esi, ecx
            //   8850ff               | inc                 esp
            //   c1ea08               | mov                 ecx, eax
            //   4939c7               | movdqu              xmm4, xmmword ptr [edx]
            //   75ec                 | movdqu              xmm5, xmmword ptr [edx + 0x10]
            //   31c0                 | dec                 eax
            //   31d2                 | lea                 eax, [esp + 0x60]

        $sequence_6 = { 83c231 663315???????? 6689542450 8b942470780000 83c232 663315???????? 6689942464780000 }
            // n = 7, score = 100
            //   83c231               | pinsrw              mm4, edi, 1
            //   663315????????       |                     
            //   6689542450           | inc                 ecx
            //   8b942470780000       | add                 ecx, 8
            //   83c232               | add                 edx, 4
            //   663315????????       |                     
            //   6689942464780000     | dec                 eax

        $sequence_7 = { 8b8424c01a0000 4431c8 66898424c81a0000 440fb78c24ca1a0000 8b8424c01a0000 4431c8 66898424ca1a0000 }
            // n = 7, score = 100
            //   8b8424c01a0000       | movzx               edx, word ptr [esp + 0x1394]
            //   4431c8               | mov                 eax, dword ptr [esp + 0x1380]
            //   66898424c81a0000     | add                 eax, 8
            //   440fb78c24ca1a0000     | mov    eax, dword ptr [esp + 0x1380]
            //   8b8424c01a0000       | add                 eax, 8
            //   4431c8               | xor                 eax, edx
            //   66898424ca1a0000     | mov                 word ptr [esp + 0x1394], ax

        $sequence_8 = { 66899c249c5f0000 6644899c249e5f0000 f30f6fa424905f0000 6644899424a05f0000 6644898c24a25f0000 6644898424a45f0000 66898c24a65f0000 }
            // n = 7, score = 100
            //   66899c249c5f0000     | mov                 word ptr [esp + 0x458], bx
            //   6644899c249e5f0000     | mov    word ptr [esp + 0x4154], bx
            //   f30f6fa424905f0000     | inc    sp
            //   6644899424a05f0000     | mov    dword ptr [esp + 0x4156], ebx
            //   6644898c24a25f0000     | xor    eax, 0x63
            //   6644898424a45f0000     | mov    word ptr [esp + 0x413a], ax
            //   66898c24a65f0000     | movzx               eax, word ptr [esp + 0x20]

        $sequence_9 = { c705????????01000000 4883c010 488905???????? e8???????? 488b05???????? 488b15???????? 4c8d05292d0400 }
            // n = 7, score = 100
            //   c705????????01000000     |     
            //   4883c010             | add                 ebp, 7
            //   488905????????       |                     
            //   e8????????           |                     
            //   488b05????????       |                     
            //   488b15????????       |                     
            //   4c8d05292d0400       | mov                 edi, dword ptr [esp + 0x1d40]

    condition:
        7 of them and filesize < 2590720
}