From e2c1c6604edb366751845aa572ff68a0a05daa35 Mon Sep 17 00:00:00 2001 From: adrien Date: Fri, 24 Jan 2025 17:38:33 +0100 Subject: [PATCH] WIP --- config.php | 32 ++++++++++--------- filter_inputs.php | 2 +- index.php | 16 ++++++++-- scan.php | 12 +++---- script-args.ini | 0 {datadir/scripts => scripts}/README.md | 0 {datadir/scripts => scripts}/http-info.nse | 0 .../scripts => scripts}/smb-shares-size.nse | 0 templates/cards.xsl | 2 +- templates/compact.xsl | 4 +-- templates/hostScan.xsl | 2 +- templates/lanScan.xsl | 2 +- 12 files changed, 42 insertions(+), 30 deletions(-) create mode 100644 script-args.ini rename {datadir/scripts => scripts}/README.md (100%) rename {datadir/scripts => scripts}/http-info.nse (100%) rename {datadir/scripts => scripts}/smb-shares-size.nse (100%) diff --git a/config.php b/config.php index f824ca8..c634b9c 100644 --- a/config.php +++ b/config.php @@ -1,29 +1,31 @@ [ '-PS' => 'microsoft-ds', '-F' => true, '-T' => 5, - '--stylesheet' => "$BASEDIR/templates/lanScan.xsl", + '--stylesheet' => "lanScan.xsl", 'refreshPeriod' => 60, 'sudo' => false, ], "host" => [ - '-Pn' => true, - '-F' => true, - '-sV' => true, - '-T' => 5, - '--script' => "http-info,smb-shares-size", - '--stylesheet' => "$BASEDIR/templates/hostScan.xsl", - 'refreshPeriod' => 60, - 'sudo' => true, + '-Pn' => true, + '-F' => true, + '-sV' => true, + '-T' => 5, + '--script' => "http-info,smb-shares-size", + '--stylesheet' => "hostScan.xsl", + 'refreshPeriod' => 60, + 'sudo' => true, ], ]; diff --git a/filter_inputs.php b/filter_inputs.php index 624a645..aa3cf65 100644 --- a/filter_inputs.php +++ b/filter_inputs.php @@ -107,7 +107,7 @@ if ($preset && isset($presets[$preset])) { '-V' => FILTER_VALIDATE_BOOLEAN, '--unprivileged' => FILTER_VALIDATE_BOOLEAN, '-h' => FILTER_VALIDATE_BOOLEAN, - '--stylesheet' => FILTER_VALIDATE_URL, + '--stylesheet' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $fileNameRegex]], // lanScan 'name' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $fileNameRegex]], 'originalURL' => FILTER_VALIDATE_URL, diff --git a/index.php b/index.php index 3ff9154..4cc8488 100755 --- a/index.php +++ b/index.php @@ -583,10 +583,10 @@ Exemples: /24 10.