/*
   Odin by Brandefense - Monograph 51 / 52 Bounded YARA Detection Suite
   Covers: RedLine Stealer .NET WCF IRemoteEndpoint client stubs, LokiBot PHP panel
           and Charon HTTP submission stagers, and Raccoon Stealer HTTP /config
           check-in payloads.
   Classification: TLP:CLEAR
*/

rule ODIN_RedLine_Stealer_WCF_SOAP_Client_Config {
    meta:
        author = "Odin by Brandefense"
        monograph = "51 / 52"
        date = "2026-11-21"
        action = "hunt_and_contain"
        description = "Matches RedLine Stealer .NET Windows Communication Foundation IRemoteEndpoint SOAP contract and tasking strings"
    strings:
        $contract = "IRemoteEndpoint" ascii wide
        $ns1 = "http://tempuri.org/" ascii wide
        $ns2 = "BasicHttpBinding" ascii wide
        $op1 = "CheckConnect" ascii wide
        $op2 = "EnvironmentSettings" ascii wide
        $op3 = "ScanResult" ascii wide
        $op4 = "GetArguments" ascii wide
    condition:
        filesize < 2MB and $contract and 1 of ($ns*) and 2 of ($op*)
}

rule ODIN_LokiBot_PHP_Panel_And_Charon_Gate_Strings {
    meta:
        author = "Odin by Brandefense"
        monograph = "51 / 52"
        date = "2026-11-21"
        action = "hunt_and_contain"
        description = "Matches LokiBot binary credential stealer Charon User-Agent and fre.php or admin panel gate artifacts"
    strings:
        $uri1 = "/fre.php" ascii wide
        $uri2 = "PvqDq929BSx_A_D_M_I_N_a.php" ascii wide
        $ua1 = "Charon; Inferno" ascii wide
        $ua2 = "Mozilla/4.08 [en]" ascii wide
        $db1 = "sqlite3_open" ascii
        $hdr1 = "application/octet-stream" ascii wide
        $hdr2 = "HTTP/1.0" ascii wide
    condition:
        filesize < 2MB and 1 of ($uri*) and 1 of ($ua*) and 1 of ($db1, $hdr1, $hdr2)
}

rule ODIN_Raccoon_Stealer_V2_HTTP_Config_Checkin {
    meta:
        author = "Odin by Brandefense"
        monograph = "51 / 52"
        date = "2026-11-21"
        action = "hunt_and_contain"
        description = "Matches Raccoon Stealer C/C++ HTTP POST /config check-in parameters alongside browser credential store targets"
    strings:
        $cfg1 = "/config" ascii wide
        $cfg2 = "bot_id" ascii wide
        $cfg3 = "config_id" ascii wide
        $brw1 = "Login Data" ascii wide
        $brw2 = "Web Data" ascii wide
        $brw3 = "sqlite3_column_blob" ascii
    condition:
        filesize < 2MB and all of ($cfg*) and 1 of ($brw*)
}
