// Clearnet Labs, MiCollab AWV intrusion, TLP:CLEAR
rule CNL_MiCollab_AWV_Poller {
  meta: author = "Clearnet Labs" description = ".awvc per-minute poller"
  strings:
    $a = "/cmd?i=$I&h=$H&u=$U"
    $b = "/out?i=$I&h=$H&u=$U"
    $c = "/tmp/.awvo.$$"
  condition: uint16(0) == 0x2123 and filesize < 4KB and 2 of them
}

rule CNL_MiCollab_AWV_Collectors {
  meta: author = "Clearnet Labs" description = "master.sh, s1.sh, f2.sh collectors"
  strings:
    $m1 = "# Fleet collector: recon + secrets + file inventory + internal scan launch."
    $m2 = "##META ip=$IP host=$H"
    $s1 = "# Stage 1: fast host recon + secrets/DB capture + C2 agent install."
    $s2 = "/loot?t=s1"
    $f1 = "# Targeted valuable-file collection: configs, keys, licenses, small dumps."
    $f2 = "files2__"
  condition: uint16(0) == 0x2123 and filesize < 64KB and 2 of them
}

rule CNL_MiCollab_AWV_Scanners {
  meta: author = "Clearnet Labs" description = "scan2.sh, scan3.sh, S2V3 sweep"
  strings:
    $a = "# Stage 2 (v3): exhaustive internal enumeration."
    $b = "# Improved interior scan for MiCollab hosts."
    $c = "# Internal network scan. usage: scan2.sh"
    $d = "== DISCOVERY_DONE"
    $e = "S2V3"
    $f = "usage: scan3.sh"
  condition: uint16(0) == 0x2123 and filesize < 64KB and 2 of them
}

rule CNL_MiCollab_AWV_SSI_Probe {
  meta: author = "Clearnet Labs" description = "server-side include probe in the AWV slides folder" sha256 = "b1986505e18c4454bf006e66ea5d18db9d16f161d2bcfb93c1b9a8b27098f50c"
  strings:
    $a = "<!--#exec cmd=\"id;hostname;uname -r;rpm -q awc-oem-Axis2"
  condition: filesize < 1KB and $a
}

rule CNL_MiCollab_AWV_Cleanup {
  meta: author = "Clearnet Labs" description = "rival cleanup and sweep commands"
  strings:
    $a = "V3ilAccess!2026"
    $b = "AwvEject!"
    $c = "awv-persist"
    $d = "194.165.16.159"
    $k1 = "pkill -9 -f"
    $k2 = "crontab -l"
    $k3 = "user_profile set password='$NP'"
    $k4 = "from user_profile where password='$P'"
  condition: filesize < 20KB and 2 of ($a,$b,$c,$d) and 1 of ($k*)
}

rule CNL_MiCollab_AWV_DevtoolRecon {
  meta: author = "Clearnet Labs" description = "k-series AI coding tool reconnaissance"
  strings:
    $a = "== agent_dirs =="
    $b = "claude_desktop_config.json"
    $c = "== config_dirs =="
    $d = "== dotdirs =="
  condition: uint16(0) == 0x2123 and filesize < 8KB and 3 of them
}
