This commit is contained in:
2025-01-24 17:38:33 +01:00
parent a593148c38
commit e2c1c6604e
12 changed files with 42 additions and 30 deletions

View File

@ -3,9 +3,10 @@
include_once 'config.php';
include_once 'filter_inputs.php';
if (!file_exists($SCANSDIR)) mkdir($SCANSDIR);
if (!$options["name"]) $options["name"] = str_replace('/', '!', $targets);
$options["--stylesheet"] = "$BASEDIR/$TEMPLATESDIR/${options["--stylesheet"]}?";
if (isset($options["name"])) {
$options["--stylesheet"] .= "name=" . rawurlencode($options["name"]) . "&";
}
$args = "";
foreach ($options as $option => $value) {
@ -27,11 +28,10 @@ foreach ($options as $option => $value) {
}
$command = "nmap $args -oX - $targets";
if (isset($options["sudo"])) $command = "sudo $command";
$command = "$NMAP $args -oX - $targets";
if (isset($options["name"])) {
if (!file_exists($SCANSDIR)) mkdir($SCANSDIR);
$path = "$SCANSDIR/{$options["name"]}.xml";
$command .= " | tee '$path'";
}