rule win_supernova_auto {

    meta:
        author = "Felix Bilstein - yara-signator at cocacoding dot com"
        date = "2026-09-17"
        version = "1"
        description = "Detects win.supernova."
        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.supernova"
        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 = { 1107 17 91 1f50 3339 1107 }
            // n = 6, score = 100
            //   1107                 | add                 dword ptr [eax], eax
            //   17                   | jo                  0x42b
            //   91                   | sub                 dword ptr [eax], eax
            //   1f50                 | add                 byte ptr [edx], cl
            //   3339                 | and                 eax, 0x286f
            //   1107                 | or                  dh, byte ptr [edx - 0x1f]

        $sequence_1 = { 1308 03 6f0b00000a 6f1c00000a 1107 16 }
            // n = 6, score = 100
            //   1308                 | add                 dword ptr [0x22772], esp
            //   03                   | jo                  0x520
            //   6f0b00000a           | xor                 al, 0
            //   6f1c00000a           | add                 byte ptr [edx], cl
            //   1107                 | push                es
            //   16                   | outsd               dx, dword ptr [esi]

        $sequence_2 = { 26 25 6f2800000a 72b1010070 }
            // n = 4, score = 100
            //   26                   | adc                 dword ptr [edi], eax
            //   25                   | pop                 ss
            //   6f2800000a           | and                 eax, 0x9d0a1f16
            //   72b1010070           | and                 eax, 0x2a6f16

        $sequence_3 = { 19 91 1f47 3329 }
            // n = 4, score = 100
            //   19                   | push                ss
            //   91                   | xchg                eax, ecx
            //   1f47                 | and                 bh, bh
            //   3329                 | add                 byte ptr [eax], al

        $sequence_4 = { 3341 1107 17 91 1f50 3339 }
            // n = 6, score = 100
            //   3341                 | adc                 ecx, dword ptr [ecx]
            //   1107                 | jle                 0xb5
            //   17                   | add                 byte ptr [eax], al
            //   91                   | add                 al, 0x72
            //   1f50                 | adc                 dword ptr [ecx], eax
            //   3339                 | add                 byte ptr [eax + 0x11], dh

        $sequence_5 = { 1f0a 9d 6f0a00000a 1304 03 6f0b00000a }
            // n = 6, score = 100
            //   1f0a                 | or                  eax, dword ptr [eax]
            //   9d                   | add                 byte ptr [edx], cl
            //   6f0a00000a           | add                 ebp, dword ptr [edi + 0xb]
            //   1304                 | add                 byte ptr [eax], al
            //   03                   | or                  ah, byte ptr [eax]
            //   6f0b00000a           | enter               0, 0

        $sequence_6 = { de00 03 6f0800000a 6f0e00000a }
            // n = 4, score = 100
            //   de00                 | add                 byte ptr [eax], al
            //   03                   | or                  ch, byte ptr [edx]
            //   6f0800000a           | push                es
            //   6f0e00000a           | outsd               dx, dword ptr [esi]

        $sequence_7 = { 3309 72e3000070 1308 2b5a 1107 }
            // n = 5, score = 100
            //   3309                 | pop                 ss
            //   72e3000070           | outsd               dx, dword ptr [esi]
            //   1308                 | pop                 ds
            //   2b5a                 | add                 byte ptr [eax], al
            //   1107                 | or                  al, byte ptr [ebx]

        $sequence_8 = { 16 91 2089000000 3341 }
            // n = 4, score = 100
            //   16                   | sub                 byte ptr [0x130a0000], dl
            //   91                   | push                es
            //   2089000000           | adc                 eax, dword ptr [edi]
            //   3341                 | adc                 dword ptr [edi], eax

        $sequence_9 = { 7e01000004 7211010070 1109 6f2200000a de00 03 6f0b00000a }
            // n = 7, score = 100
            //   7e01000004           | add                 ebp, dword ptr [edi + 0xb]
            //   7211010070           | add                 byte ptr [eax], al
            //   1109                 | or                  ch, byte ptr [edi + 0x1f]
            //   6f2200000a           | add                 byte ptr [eax], al
            //   de00                 | or                  al, byte ptr [ebx]
            //   03                   | outsd               dx, dword ptr [esi]
            //   6f0b00000a           | or                  eax, dword ptr [eax]

    condition:
        7 of them and filesize < 50176
}