/*
   Odin by Brandefense - Monograph 72 YARA Suite
   4 filesize-bounded structural rules covering ARTEX/AntiFox console bundles,
   Discord OTP lure modal templates, OAuth flowToken/OTC probe scripts, and Autosecure configs.
*/

rule ODIN_R72_ARTEX_AntiFox_Console_Bundle
{
    meta:
        author = "Odin by Brandefense"
        monograph = "72"
        description = "Detects exposed ARTEX or AntiFox-fork console bundles and task API routes"
        date = "2026-11-27"
    strings:
        $a1 = "ARTEX - Autonomous Red-Team Expert" ascii
        $a2 = "/api/v1/tasks" ascii
        $a3 = "AntiFox" ascii nocase
    condition:
        filesize < 5MB and ($a1 or $a3) and $a2
}

rule ODIN_R72_Discord_OTP_Modal_Phishing_Bot
{
    meta:
        author = "Odin by Brandefense"
        monograph = "72"
        description = "Detects Python Discord interactive OTP lure modal templates staged in Autosecure trees"
        date = "2026-11-27"
    strings:
        $d1 = "discord.ui.Modal" ascii
        $d2 = "views/otp.py" ascii
        $d3 = "modal_one" ascii
        $d4 = "Minecraft-Simple-Autosecure" ascii nocase
    condition:
        filesize < 256KB and $d1 and ($d2 or $d3 or $d4)
}

rule ODIN_R72_OAuth_FlowToken_and_OTC_Probe_Script
{
    meta:
        author = "Odin by Brandefense"
        monograph = "72"
        description = "Detects Python scripts automating OAuth flowToken extraction and one-time-code submission"
        date = "2026-11-27"
    strings:
        $p1 = "sFT" ascii
        $p2 = "flowToken" ascii nocase
        $p3 = "login.live.com" ascii nocase
        $p4 = "otc" ascii nocase
    condition:
        filesize < 128KB and ($p1 or $p2) and $p3 and $p4
}

rule ODIN_R72_Autosecure_Config_and_Card_Renderer
{
    meta:
        author = "Odin by Brandefense"
        monograph = "72"
        description = "Detects Autosecure deployment manifests referencing SQL schemas, card renderers, and Playwright profiles"
        date = "2026-11-27"
    strings:
        $c1 = "autosecure-app" ascii
        $c2 = "autosecure-db.sql" ascii
        $c3 = "render_cards" ascii
        $c4 = "playwright_chromiumdev_profile-" ascii
    condition:
        filesize < 1MB and 2 of ($c1, $c2, $c3, $c4)
}
