<?php
declare(strict_types=1);
/**
 * VULNERABLE LAB: Robots.txt Disclosure
 * Educational only.
 */
$flag = 'VULNLAB{RECO-009_55d9e60af952}';
?>
<!DOCTYPE html>
<html><head><meta charset="UTF-8"><title>Robots.txt Disclosure</title>
<style>body{font-family:system-ui;background:#0d1117;color:#e6edf3;padding:2rem;max-width:800px;margin:0 auto}input,button{padding:.5rem;margin:.3rem 0;background:#161b22;border:1px solid #30363d;color:#e6edf3}code{background:#161b22;padding:.2rem .4rem}.note{background:#1c2128;padding:1rem;border-radius:6px;margin:1rem 0}</style></head>
<body>
<h1>Robots.txt Disclosure</h1>
<div class="note">⚠️ Intentionally vulnerable: Robots.txt Disclosure</div>
<p>Interact with the form/parameters to discover the vulnerability and obtain the flag.</p>
<form method="GET">
<input name="input" style="width:70%" placeholder="Try your payload..." value="<?= htmlspecialchars($_GET["input"] ?? "") ?>">
<button type="submit">Go</button>
</form>
<?php
$in = $_GET["input"] ?? "";
if ($in !== "") {
  echo "<div class=\"note\"><strong>Echo (vulnerable context):</strong> " . $in . "</div>";
  if (preg_match("/flag|admin|exploit|union|script|\.\./i", $in)) {
    echo "<p><strong>Flag:</strong> <code>" . htmlspecialchars($flag) . "</code></p>";
  }
}
?>
<p><a href="/VulnLab/labs.php" style="color:#58a6ff">← Back to Labs</a></p>
</body></html>
