/*
   Odin by Brandefense - Monograph 43 / 46 Bounded YARA Detection Suite
   Covers: AsyncRAT/DcRAT/VenomRAT .NET SslStream & ServerCertificate stubs,
           QuasarRAT Server CA configuration artifacts, and Remcos native
           SETTINGS markers.
   Classification: TLP:CLEAR
*/

rule ODIN_AsyncRAT_DcRAT_VenomRAT_DotNet_Config_Strings {
    meta:
        author = "Odin by Brandefense"
        monograph = "43 / 46"
        date = "2026-11-20"
        action = "hunt_and_contain"
        description = "Matches .NET commodity RAT configuration and SslStream certificate-pinning markers shared by AsyncRAT, DcRAT, and VenomRAT"
    strings:
        $fam1 = "AsyncRAT Server" ascii wide
        $fam2 = "DcRat" ascii wide
        $fam3 = "VenomRAT" ascii wide
        $tls1 = "ServerCertificate" ascii wide
        $tls2 = "SslStream" ascii wide
        $tls3 = "X509Certificate2" ascii wide
        $cfg1 = "Pastebin" ascii wide
        $cfg2 = "Aes256" ascii wide
        $cfg3 = "Anti_Analysis" ascii wide
    condition:
        filesize < 2MB and 1 of ($fam*) and 1 of ($tls*) and 1 of ($cfg*)
}

rule ODIN_QuasarRAT_Client_Certificate_And_Config_Artifact {
    meta:
        author = "Odin by Brandefense"
        monograph = "43 / 46"
        date = "2026-11-20"
        action = "hunt_and_contain"
        description = "Matches QuasarRAT embedded Quasar Server CA certificate subject alongside client serialization or SslStream markers"
    strings:
        $ca = "Quasar Server CA" ascii wide
        $q1 = "Quasar.Common" ascii wide
        $q2 = "Quasar.Client" ascii wide
        $q3 = "VerifyHash" ascii wide
        $q4 = "SslStream" ascii wide
    condition:
        filesize < 2MB and $ca and 2 of ($q*)
}

rule ODIN_Remcos_Native_Settings_And_Mutex_Artifact {
    meta:
        author = "Odin by Brandefense"
        monograph = "43 / 46"
        date = "2026-11-20"
        action = "hunt_and_contain"
        description = "Matches Remcos native client configuration resource, mutex, and BreakingSecurity builder strings"
    strings:
        $r1 = "BreakingSecurity" ascii wide
        $r2 = "Remcos_Mutex_" ascii wide
        $r3 = "remcos.exe" ascii wide nocase
        $s1 = "SETTINGS" ascii wide
        $s2 = "Watchdog" ascii wide
        $s3 = ":2404" ascii wide
    condition:
        filesize < 2MB and 1 of ($r*) and 2 of ($s*)
}
