diff --git a/config.php b/config.php index f0ec42f..1585330 100644 --- a/config.php +++ b/config.php @@ -4,4 +4,5 @@ $BASEDIR = "{$_SERVER['REQUEST_SCHEME']}://{$_SERVER['SERVER_NAME']}$port" . dir $SCANSDIR = "scans"; $STYLESHEETSDIR = "stylesheets"; -$lanScanCmd = "sudo nmap -PSmicrosoft-ds -F -T5 -oX - --stylesheet $BASEDIR/$STYLESHEETSDIR/lanScan.xsl"; \ No newline at end of file +$lanScanCmd = "sudo nmap -PSmicrosoft-ds -F -T5 -oX - --stylesheet $BASEDIR/$STYLESHEETSDIR/lanScan.xsl"; +$hostScanCmd = "sudo nmap -A -oX - --stylesheet $BASEDIR/$STYLESHEETSDIR/hostScan.xsl"; \ No newline at end of file diff --git a/scan.php b/scan.php index 9502452..4689547 100644 --- a/scan.php +++ b/scan.php @@ -14,6 +14,22 @@ if ($lan) { header('Content-type: text/xml'); system("$cmd", $retcode); + + exit(); } -exit(); \ No newline at end of file +$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(); +} \ No newline at end of file diff --git a/style.css b/style.css index f59529b..26cd780 100644 --- a/style.css +++ b/style.css @@ -69,4 +69,8 @@ body { ) !important; text-align: center !important; font-size: .64285714rem !important; +} + +.ui.card .table { + overflow-x: auto; } \ No newline at end of file diff --git a/stylesheets/hostScan.xsl b/stylesheets/hostScan.xsl new file mode 100644 index 0000000..c0ec706 --- /dev/null +++ b/stylesheets/hostScan.xsl @@ -0,0 +1,363 @@ + + + + + + + + + + + + + + + + + + + + + + lanScan - <xsl:value-of select="$targets" /> + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +

+ + + + + + + + + + + ui label + + green + red + + + + +

+ + + + + + + + + + + + + + + + + + +
Adresse IPv4Adresse MACConstructeurOS
+ + + + + + + +
+ +
+
+ + Informations supplémentaires +
+
+ +
+
+ +

Services

+ +
+ + + + + +
+ +
+ + + + + + + + + +
+ + ui inverted card + + red + orange + green + green + orange + red + + +
+
+
+ + ui red ribbon label + + red + orange + green + green + orange + red + + + + : + + +
+ + + + / + + + +
+
+ + + + + + + + v + + + + + + + + +
+ +
+
+ + Détails +
+
+ +
+
+
+
+
+
+
+ +
+ + +
+
+ + +
+
+ + + + + + + +
+
+ +
+ + + +
+
+
+
+ + + + +
+
+ + +
+
+ + + + + +
+
+ +
+
+
+ + + + + +
+
+
+
+ + + + + + + + + + + + +
\ No newline at end of file diff --git a/stylesheets/lanScan.xsl b/stylesheets/lanScan.xsl index 4db20a3..e27322a 100644 --- a/stylesheets/lanScan.xsl +++ b/stylesheets/lanScan.xsl @@ -26,6 +26,7 @@ lanScan - <xsl:value-of select="$targets" /> + + class="ui sortable small stuck striped table"> @@ -185,13 +186,12 @@ $('.ui.dropdown').dropdown() - \ No newline at end of file diff --git a/stylesheets/services.xsl b/stylesheets/services.xsl index e94e3d4..a667bb4 100644 --- a/stylesheets/services.xsl +++ b/stylesheets/services.xsl @@ -65,7 +65,7 @@ - / + :
Etat - - scan.php?host= + + scan.php?host=