From ad794956088aa8e040e86e947392c3fdd6a7cbf6 Mon Sep 17 00:00:00 2001 From: adrien Date: Mon, 14 Oct 2024 00:49:19 +0200 Subject: [PATCH] saveAs and compareWith as URL --- config.php | 22 ++- filter_inputs.php | 24 +-- hostScan.xsl | 419 ++++++++++++++++++++++++++++++++++++++++++++++ index.php | 37 ++-- lanScan.xsl | 187 +++++++++++---------- options.php | 30 ++-- scan.php | 30 ++-- 7 files changed, 592 insertions(+), 157 deletions(-) create mode 100755 hostScan.xsl diff --git a/config.php b/config.php index c0e94e3..1a31793 100644 --- a/config.php +++ b/config.php @@ -1,10 +1,18 @@ 'ssh,http,https,msrpc,microsoft-ds', - 'F' => true, - 'T5' => true, - 'stylesheet' => 'lanScan.xls' +$BASEDIR = "{$_SERVER['REQUEST_SCHEME']}://{$_SERVER['SERVER_NAME']}:{$_SERVER['SERVER_PORT']}" . dirname($_SERVER['REQUEST_URI']); + +$LANSCAN_OPTIONS = [ + 'PS' => 'ssh,http,https,msrpc,microsoft-ds', + 'F' => true, + 'T5' => true, + 'stylesheet' => "$BASEDIR/lanScan.xsl" ]; -$NMAP_DATADIR = '/usr/share/nmap'; + +$HOSTSCAN_OPTIONS = [ + 'sV' => true, + 'stylesheet' => "$BASEDIR/hostScan.xsl" +]; + +$SCANSDIR = 'scans'; +$DATADIR = '/usr/share/nmap'; \ No newline at end of file diff --git a/filter_inputs.php b/filter_inputs.php index 04f20ae..6f6db3d 100644 --- a/filter_inputs.php +++ b/filter_inputs.php @@ -1,25 +1,17 @@ :"\/|?]+$/'; -$targets = filter_input(INPUT_GET, 'targets', FILTER_VALIDATE_REGEXP, [ - 'flags' => FILTER_NULL_ON_FAILURE, - 'options' => ['regexp' => "/^[\da-zA-Z-. \/]+$/"], -]); - -$saveAs = filter_input(INPUT_GET, 'saveAs', FILTER_VALIDATE_REGEXP, [ - 'flags' => FILTER_NULL_ON_FAILURE, - 'options' => ['regexp' => $fileNameRegex], -]); - -$compareWith = filter_input(INPUT_GET, 'compareWith', FILTER_VALIDATE_REGEXP, [ - 'flags' => FILTER_NULL_ON_FAILURE, - 'options' => ['regexp' => $fileNameRegex], -]); +$targets = filter_input(INPUT_GET, 'targets', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => $targetsListRegex]]); +$lan = filter_input(INPUT_GET, 'lan', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => $targetsListRegex]]); +$host = filter_input(INPUT_GET, 'host', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => $targetsListRegex]]); +$saveAs = filter_input(INPUT_GET, 'saveAs', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => $fileNameRegex]]); +$compareWith = filter_input(INPUT_GET, 'compareWith', FILTER_VALIDATE_URL); $inputs = filter_input_array(INPUT_GET, [ 'iR' => ['filter' => FILTER_VALIDATE_INT], @@ -111,5 +103,5 @@ $inputs = filter_input_array(INPUT_GET, [ 'V' => ['filter' => FILTER_VALIDATE_BOOLEAN], 'unprivileged' => ['filter' => FILTER_VALIDATE_BOOLEAN], 'h' => ['filter' => FILTER_VALIDATE_BOOLEAN], - 'stylesheet' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $fileNameRegex]], -], false) ?: $DEFAULT_ARGS; + 'stylesheet' => ['filter' => FILTER_VALIDATE_URL], +], false) ?: $LANSCAN_OPTIONS; diff --git a/hostScan.xsl b/hostScan.xsl new file mode 100755 index 0000000..4d7ce23 --- /dev/null +++ b/hostScan.xsl @@ -0,0 +1,419 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + /scan.php?targets= + + & + + + + + compareWith= + + + + + + + + + 60;URL= + + + + + <xsl:text>lanScan - </xsl:text> + <xsl:value-of select="$targets"/> + + + + + + + + + + + + + + + + + + +
+

+ + + + + + + + + + + + + + +
EtatAdresse IPNomServices
+
+ +
+ lanScan est basé sur Nmap +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + = + + + on + + & + + + + + + + on + + + + + + + + + + + + + + + + + + + + + + + + + positive + negative + + + + + +
+ + + ui green circular label + ui red circular label + + + +
+
+
down
+
+ + + + + + + + + + + + + + + + + + + + /scan.php?host= + + + + Scanner + + + +
+ + + + + + + + + + + + ui label + + red + orange + green + green + orange disabled + red disabled + + + mini dropdown button share-size + small + + + + + + :// + + : + + + + + + rdp.php?v= + + &p= + + + + +
+ + U: + : + + +
+ + + + + + --free: + + ; --total: + + + + + + + +
+
+ + + + + + +
\ No newline at end of file diff --git a/index.php b/index.php index 00e548b..aeb7f10 100755 --- a/index.php +++ b/index.php @@ -25,31 +25,26 @@ include_once 'filter_inputs.php'; + +
@@ -58,13 +53,13 @@ echo " \n";