/*
   Odin by Brandefense - Monograph 70 (Seeyon OA Spraying: JNDI Listeners and SSRF Polling) YARA Suite
   4 filesize-bounded structural rules covering Seeyon OA DES password-spray scripts,
   multi-port JNDI/LDAP callback responders, web-root archive harvesters, and
   HTTP request-smuggling / SSRF polling scripts (zero victim, organization, or raw exploit strings).
*/

rule ODIN_R70_Seeyon_OA_DES_Password_Spray_Script
{
    meta:
        author = "Odin by Brandefense"
        monograph = "70"
        description = "Detects Python password-spraying scripts targeting Seeyon OA /seeyon/main.do with verifyCode checks and DES routines"
        date = "2026-11-26"
    strings:
        $u1 = "/seeyon/main.do" ascii
        $v1 = "verifyCode" ascii
        $m1 = "puredes" ascii nocase
        $m2 = "requests" ascii
        $m3 = ".jsonl" ascii
    condition:
        filesize < 128KB and $u1 and $v1 and 2 of ($m*)
}

rule ODIN_R70_MultiPort_JNDI_LDAP_Callback_Responder
{
    meta:
        author = "Odin by Brandefense"
        monograph = "70"
        description = "Detects Python JNDI/LDAP out-of-band callback listeners and high-port TCP verification scripts"
        date = "2026-11-26"
    strings:
        $s1 = "socket" ascii
        $p1 = "1389" ascii
        $p2 = "1099" ascii
        $c1 = "hello-test-13890" ascii
        $c2 = "jndi:ldap://" ascii nocase
        $c3 = "13890" ascii
    condition:
        filesize < 256KB and $s1 and 1 of ($p*) and 1 of ($c*)
}

rule ODIN_R70_WebRoot_Backup_Archive_Harvester
{
    meta:
        author = "Odin by Brandefense"
        monograph = "70"
        description = "Detects automated Python web-root RAR and ZIP backup archive harvester scripts"
        date = "2026-11-26"
    strings:
        $a1 = ".rar" ascii nocase
        $a2 = ".zip" ascii nocase
        $h1 = "requests" ascii
        $h2 = "urllib" ascii
        $o1 = ".jsonl" ascii
        $o2 = "targets" ascii nocase
    condition:
        filesize < 128KB and $a1 and $a2 and 1 of ($h*) and 1 of ($o*)
}

rule ODIN_R70_HTTP_Request_Smuggling_and_SSRF_Poller
{
    meta:
        author = "Odin by Brandefense"
        monograph = "70"
        description = "Detects raw-socket HTTP CL-TE request-smuggling and SSRF probe scripts"
        date = "2026-11-26"
    strings:
        $t1 = "Transfer-Encoding" ascii nocase
        $t2 = "Content-Length" ascii nocase
        $c1 = "chunked" ascii nocase
        $n1 = "socket" ascii
        $n2 = "ssl" ascii
        $n3 = "\\r\\n0\\r\\n\\r\\n" ascii
    condition:
        filesize < 128KB and $t1 and $t2 and $c1 and 1 of ($n*)
}
