/*
   Odin by Brandefense - Monograph 24 / 30 YARA Artifact Suite
   Scope: OpenClaw Playwright session-cloning configs, Playwright cookie-capture scripts,
          AuroraStealer/StealC exfiltration manifests, and LaplasClipper regex configs.
   Classification: TLP:CLEAR
*/

rule ODIN_OpenClaw_Playwright_Session_Cloner_Config
{
    meta:
        author = "Odin by Brandefense"
        monograph = "24 / 30"
        classification = "TLP:CLEAR"
        usage = "hunt"
        description = "Matches OpenClaw headless Playwright existing-browser-session state and trajectory configs"
    strings:
        $oc1 = ".openclaw/browser-existing-session" ascii
        $oc2 = "openclaw.sqlite" ascii
        $pw1 = "chromium_headless_shell-" ascii
        $pw2 = "component_crx_cache" ascii
        $tr1 = ".trajectory.jsonl" ascii
    condition:
        filesize < 512KB and ($oc1 or $oc2) and ($pw1 or $pw2 or $tr1)
}

rule ODIN_Playwright_Cookie_Capture_Script
{
    meta:
        author = "Odin by Brandefense"
        monograph = "24 / 30"
        classification = "TLP:CLEAR"
        usage = "hunt"
        description = "Matches Playwright scripts or logs that write an authenticated cookie jar from a headless Chrome session"
    strings:
        $ck1 = "playwright_cookies.json" ascii
        $ua1 = "HeadlessChrome/" ascii
        $pa1 = "context.cookies(" ascii
        $pa2 = "storageState" ascii
    condition:
        filesize < 512KB and $ck1 and ($ua1 or $pa1 or $pa2)
}

rule ODIN_Aurora_StealC_Browser_Vault_Manifest
{
    meta:
        author = "Odin by Brandefense"
        monograph = "24 / 30"
        classification = "TLP:CLEAR"
        usage = "hunt"
        description = "Matches AuroraStealer Go JSON gate configs and StealC browser cookie/vault multipart manifests"
    strings:
        $au1 = "/aurora/gate" ascii
        $au2 = "BrowserCookies" ascii
        $au3 = "CryptoWallets" ascii
        $st1 = "cookies_list" ascii
        $st2 = "Default\\Network\\Cookies" ascii
    condition:
        filesize < 512KB and (($au1 and $au2 and $au3) or ($st1 and $st2))
}

rule ODIN_LaplasClipper_Regex_Wallet_Swap_Config
{
    meta:
        author = "Odin by Brandefense"
        monograph = "24 / 30"
        classification = "TLP:CLEAR"
        usage = "hunt"
        description = "Matches LaplasClipper HTTP regex polling headers and multi-chain wallet substitution manifests"
    strings:
        $lp1 = "X-Laplas-Key" ascii
        $lp2 = "/bot/regex" ascii
        $rx1 = "btc_bech32_regex" ascii nocase
        $rx2 = "eth_erc20_regex" ascii nocase
        $rx3 = "trx_trc20_regex" ascii nocase
    condition:
        filesize < 512KB and ($lp1 or $lp2) and ($rx1 or $rx2 or $rx3)
}
