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

22 lines
1.2 KiB
PHP

<?php
header("Content-Type: application/json");
$out = [];
// grep for opus-pattern-badge in /var/www/html
$out["opus_pattern_sources"] = trim(@shell_exec("grep -lrE 'opus-pattern-badge|opus-pattern-style' /var/www/html --include='*.js' --include='*.html' --include='*.php' 2>/dev/null | head -10"));
$out["opus_udrill_sources"] = trim(@shell_exec("grep -lrE 'opus-udrill|opus-dashboard-entry' /var/www/html --include='*.js' --include='*.html' --include='*.php' 2>/dev/null | head -10"));
$out["wtp_dock_sources"] = trim(@shell_exec("grep -lrE 'WTP Global|ERP Global|Admin.*Droid|Orch.*WevCode' /var/www/html --include='*.js' --include='*.html' 2>/dev/null | head -10"));
// Read the opus-pattern injector
$f = @shell_exec("grep -lrE 'opus-pattern-badge' /var/www/html --include='*.js' --include='*.php' 2>/dev/null | head -1");
$f = trim($f);
if ($f && file_exists($f)) {
$c = @file_get_contents($f);
$out["pattern_injector_file"] = $f;
$out["pattern_injector_has_guard"] = strpos($c, "PUBLIC-GUARD") !== false || strpos($c, "public_paths") !== false || strpos($c, "AMBRE-V1") !== false;
// Extract first 300 chars
$out["pattern_injector_head"] = substr($c, 0, 400);
}
echo json_encode($out, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES);