host scan

This commit is contained in:
2025-02-04 02:42:17 +01:00
parent 6f0cc6e9bd
commit dd16294e8d
6 changed files with 391 additions and 7 deletions

View File

@ -14,6 +14,22 @@ if ($lan) {
header('Content-type: text/xml');
system("$cmd", $retcode);
exit();
}
exit();
$host = filter_input(INPUT_GET, 'host', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => '/^[\da-zA-Z-. \/]+$/'], "flags" => FILTER_NULL_ON_FAILURE]);
if ($host) {
$cmd = "$hostScanCmd $host";
if (!file_exists($SCANSDIR)) mkdir($SCANSDIR);
$filename = str_replace("/", "!", $host);
$path = "$SCANSDIR/$filename.xml";
if (!file_exists($path)) $cmd .= " | tee '$path'";
header('Content-type: text/xml');
system("$cmd", $retcode);
exit();
}