script-arg-file.ini

This commit is contained in:
Adrien MALINGREY 2024-10-23 15:46:59 +02:00
parent 8e5f010da0
commit 4e14da1860
5 changed files with 12 additions and 11 deletions

View File

@ -1,10 +1,11 @@
<?php
$port = (($_SERVER['REQUEST_SCHEME'] == "http" && $_SERVER['SERVER_PORT'] == 80) || ($_SERVER['REQUEST_SCHEME'] == "https" && $_SERVER['SERVER_PORT'] == 443)) ? "" : ":{$_SERVER['SERVER_PORT']}";
$BASEDIR = "{$_SERVER['REQUEST_SCHEME']}://{$_SERVER['SERVER_NAME']}$port" . dirname($_SERVER['SCRIPT_NAME']);
$SCANSDIR = 'scans';
$NMAPDIR = dirname(`which nmap`) . "/../share/nmap";
$DATADIR = "datadir";
$port = (($_SERVER['REQUEST_SCHEME'] == "http" && $_SERVER['SERVER_PORT'] == 80) || ($_SERVER['REQUEST_SCHEME'] == "https" && $_SERVER['SERVER_PORT'] == 443)) ? "" : ":{$_SERVER['SERVER_PORT']}";
$BASEDIR = "{$_SERVER['REQUEST_SCHEME']}://{$_SERVER['SERVER_NAME']}$port" . dirname($_SERVER['SCRIPT_NAME']);
$SCANSDIR = 'scans';
$NMAPDIR = dirname(`which nmap`) . "/../share/nmap";
$DATADIR = "datadir";
$SCRIPTARGS = "script-arg-file.ini";
$presets = [
"default" => [
@ -21,7 +22,6 @@ $presets = [
'-sV' => true,
'-T' => 5,
'--script' => "http-info,smb-shares-size",
'--script-args-file' => "smb-authentication.ini",
'--stylesheet' => "$BASEDIR/templates/hostScan.xsl",
'refreshPeriod' => 60,
'sudo' => true,

View File

@ -0,0 +1,3 @@
smbdomain =
smbuser =
smbpassword =

View File

@ -1,3 +0,0 @@
smbdomain = auth.ad.e2.rie.gouv.fr
smbuser = application.drieat
smbpassword = d+iFiWn4!cAzdr3KopiM>EA

View File

@ -116,8 +116,6 @@ if ($preset && isset($presets[$preset])) {
], false) ?: $presets["default"];
}
$options["--datadir"] = $DATADIR;
/*echo "<!--";
var_dump($options);
echo "-->\n";*/

View File

@ -3,6 +3,9 @@
include_once 'config.php';
include_once 'filter_inputs.php';
$options["--datadir"] = $DATADIR;
$options["--script-args-file"] = $SCRIPTARGS;
if (!file_exists($SCANSDIR)) mkdir($SCANSDIR);
$command = ($options["sudo"]?? false ? "sudo " : "") . "nmap";