/*
   Odin by Brandefense - Monograph 33 / 35 YARA Artifact Suite
   Scope: Bounded structural detection rules for Python GPU spot-marketplace sniper bots,
          AmneziaWG junk-packet/header-obfuscated tunnel profiles, FRP v0.52+ TOML reverse-proxy
          configs, and co-located compute-and-tunnel workbench manifests.
   Classification: TLP:CLEAR
*/

rule ODIN_Clore_GPU_Marketplace_Sniper_Script
{
    meta:
        author = "Odin by Brandefense"
        monograph = "33 / 35"
        classification = "TLP:CLEAR"
        purpose = "hunt"
        description = "Matches Python automated bidding and orderbook polling scripts targeting decentralized GPU spot marketplaces"
    strings:
        $api1 = "api.clore.ai" ascii
        $ord1 = "create_order" ascii
        $ord2 = "spot" ascii
        $ord3 = "marketplace" ascii
        $hdr1 = "auth" ascii
    condition:
        filesize < 128KB and $api1 and 2 of ($ord1, $ord2, $ord3, $hdr1)
}

rule ODIN_AmneziaWG_Obfuscated_Tunnel_Config_or_Installer
{
    meta:
        author = "Odin by Brandefense"
        monograph = "33 / 35"
        classification = "TLP:CLEAR"
        purpose = "hunt"
        description = "Matches AmneziaWG client/server configurations or installers defining junk-packet (Jc/Jmin/Jmax) and header (H1-H4) obfuscation"
    strings:
        $if1 = "[Interface]" ascii
        $awg1 = "amneziawg" ascii nocase
        $jc = "Jc" ascii
        $jmin = "Jmin" ascii
        $jmax = "Jmax" ascii
        $h1 = "H1" ascii
        $s1 = "S1" ascii
    condition:
        filesize < 64KB and ($if1 or $awg1) and $jc and $jmin and $jmax and ($h1 or $s1)
}

rule ODIN_FRP_TOML_Reverse_Proxy_Config_Artifact
{
    meta:
        author = "Odin by Brandefense"
        monograph = "33 / 35"
        classification = "TLP:CLEAR"
        purpose = "hunt"
        description = "Matches modern FRP v0.52+ TOML client and server reverse-proxy configurations"
    strings:
        $s1 = "serverAddr" ascii
        $s2 = "serverPort" ascii
        $b1 = "bindPort" ascii
        $p1 = "[[proxies]]" ascii
        $p2 = "remotePort" ascii
        $a1 = "auth.token" ascii
    condition:
        filesize < 64KB and (($s1 and $s2 and ($p1 or $p2 or $a1)) or ($b1 and $a1))
}

rule ODIN_Compute_Tunnel_Workbench_Manifest_or_Miner_Script
{
    meta:
        author = "Odin by Brandefense"
        monograph = "33 / 35"
        classification = "TLP:CLEAR"
        purpose = "hunt"
        description = "Matches GPU miner launch scripts referencing stratum pools and GPU runtime flags"
    strings:
        $m1 = "stratum+" ascii
        $m2 = "nvidia-smi" ascii
        $m3 = "--algo" ascii
    condition:
        filesize < 256KB and $m1 and ($m2 or $m3)
}
