Files
html/api/ambre-leak-scan.php
2026-04-22 10:40:02 +02:00

47 lines
2.0 KiB
PHP

<?php
header("Content-Type: application/json");
$out = [];
// Check / root index widget + /wevia public
$root = @file_get_contents("/var/www/html/index.html");
$out["root"] = [
"size" => strlen($root ?? ""),
"has_claude_pattern" => preg_match_all("/Claude\s*Pattern/i", $root ?? ""),
"has_wtp_admin_ia_hub_master_orch" => preg_match_all("/\b(WTP|IA Hub|Master|Orch|WevCode|Arena|Droid|Admin|WEVIA Engine)\b/", $root ?? ""),
"has_chattbot_modules" => preg_match_all("/nx-badge|claude-pattern|chat-modules/i", $root ?? ""),
];
// Check wevia.html (public /wevia)
$wevia = @file_get_contents("/var/www/html/wevia.html");
$out["wevia_public"] = [
"size" => strlen($wevia ?? ""),
"has_claude_pattern_text" => preg_match_all("/Claude\s*Pattern/i", $wevia ?? ""),
"has_internal_shortcuts" => preg_match_all("/\b(WTP|IA Hub|Master|Orch|WevCode|Arena|Droid|Admin|WEVIA Engine)\b/", $wevia ?? ""),
"has_dashboards_shortcut" => strpos($wevia ?? "", "Dashboards") !== false,
];
// Find the HTML source rendering Claude Pattern + WTP/Hub/Master badges
// Most likely a panel in bottom-right of pages
$out["sources_with_claude_pattern"] = [];
foreach (glob("/var/www/html/*.html") as $f) {
$c = @file_get_contents($f);
if (preg_match("/Claude\s*Pattern/i", $c) || (strpos($c, "WTP") !== false && strpos($c, "Droid") !== false && strpos($c, "Orch") !== false)) {
$out["sources_with_claude_pattern"][] = [
"file" => basename($f),
"size" => filesize($f),
"has_claude_p" => (bool)preg_match("/Claude\s*Pattern/i", $c),
];
}
}
// Also check JS files
$out["js_with_claude_pattern"] = [];
foreach (array_merge(glob("/var/www/html/js/*.js") ?: [], glob("/var/www/html/api/*.js") ?: []) as $f) {
$c = @file_get_contents($f);
if (preg_match("/Claude\s*Pattern/i", $c)) {
$out["js_with_claude_pattern"][] = ["file"=>str_replace("/var/www/html", "", $f), "size"=>filesize($f)];
}
}
echo json_encode($out, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES);