little fixes
This commit is contained in:
parent
f0485f6abd
commit
215422cd61
22
config.php
22
config.php
@ -1,12 +1,12 @@
|
||||
<?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";
|
||||
$STYLESHEETSDIR = "stylesheets";
|
||||
|
||||
$NMAP = "sudo nmap"; # nmap command, E.g. 'nmap', 'sudo nmap' for root privileges or '/usr/bin/nmap' if not in PATH
|
||||
$DATADIR = ".";
|
||||
$SCRIPTARGSFILE = "script-args.ini";
|
||||
$LANSCANOPTIONS = "-PSmicrosoft-ds -F -T5 --datadir '$DATADIR' --script http-info,smb-shares-size --script-args-file '$SCRIPTARGSFILE'";
|
||||
$HOSTSCANOPTIONS = "-A -T5 --datadir '$DATADIR' --script http-info,smb-shares-size --script-args-file '$SCRIPTARGSFILE'";
|
||||
$CUSTOMSCANOPTIONS = "--datadir '$DATADIR' --script-args-file '$SCRIPTARGSFILE'";
|
||||
$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";
|
||||
$STYLESHEETSDIR = "stylesheets";
|
||||
$NMAP = "sudo nmap"; # nmap command, E.g. 'nmap', 'sudo nmap' for root privileges or '/usr/bin/nmap' if not in PATH
|
||||
$NMAPDIR = dirname(`which nmap`) . "/../share/nmap";
|
||||
$DATADIR = ".";
|
||||
$SCRIPTARGSFILE = "script-args.ini";
|
||||
$LANSCANOPTIONS = "-PSmicrosoft-ds -F -T5 --datadir '$DATADIR' --script http-info,smb-shares-size --script-args-file '$SCRIPTARGSFILE'";
|
||||
$HOSTSCANOPTIONS = "-A -T5 --datadir '$DATADIR' --script http-info,smb-shares-size --script-args-file '$SCRIPTARGSFILE'";
|
||||
$COMMONOPTIONS = "--datadir '$DATADIR' --script-args-file '$SCRIPTARGSFILE'";
|
||||
|
91
options.php
91
options.php
@ -1,3 +1,5 @@
|
||||
<?php include_once 'config.php'; ?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
|
||||
@ -29,14 +31,14 @@
|
||||
|
||||
<main class="ui main container">
|
||||
|
||||
<h1 class="ui inverted header">Scanner un <?= $preset == "host" ? "hôte" : "réseau" ?></h1>
|
||||
<h1 class="ui inverted header">Scanner un réseau</h1>
|
||||
|
||||
<form id="newScanForm" class="ui inverted form" method="get" action="scan.php">
|
||||
<div class="inverted field">
|
||||
<label for="targetsInput" title="Les cibles peuvent être spécifiées par des noms d'hôtes, des adresses IP, des adresses de réseaux, etc.
|
||||
Exemples: <?= $_SERVER['REMOTE_ADDR']; ?>/24 <?= $_SERVER['SERVER_NAME']; ?> 10.0-255.0-255.1-254">Cibles</label>
|
||||
<input id="targetsInput" type="text" name="targets" placeholder="Cibles" spellcheck="false"
|
||||
pattern="[a-zA-Z0-9._\/ \-]+" value="<?= $targets; ?>" list="targetsList" title="Les cibles peuvent être spécifiées par des noms d'hôtes, des adresses IP, des adresses de réseaux, etc.
|
||||
pattern="[a-zA-Z0-9._\/ \-]+" list="targetsList" title="Les cibles peuvent être spécifiées par des noms d'hôtes, des adresses IP, des adresses de réseaux, etc.
|
||||
Exemples: <?= $_SERVER['REMOTE_ADDR']; ?>/24 <?= $_SERVER['SERVER_NAME']; ?> 10.0-255.0-255.1-254" />
|
||||
</div>
|
||||
|
||||
@ -381,12 +383,12 @@ Exemples: <?= $_SERVER['REMOTE_ADDR']; ?>/24 <?= $_SERVER['SERVER_NAME']; ?> 10.
|
||||
<div class="inverted field">
|
||||
<label for="TSelect" title="--T">Intensité des tests de version</label>
|
||||
<select id="TSelect" class="ui clearable dropdown" name="-T">
|
||||
<option value="0" <?= ($options["-T"] ?? "") == 0 ? " selected" : "" ?>>Paranoïaque</option>
|
||||
<option value="1" <?= ($options["-T"] ?? "") == 1 ? " selected" : "" ?>>Sournois</option>
|
||||
<option value="2" <?= ($options["-T"] ?? "") == 2 ? " selected" : "" ?>>Poli</option>
|
||||
<option value="3" <?= ($options["-T"] ?? "") == 3 ? " selected" : "" ?>>Normal</option>
|
||||
<option value="4" <?= ($options["-T"] ?? "") == 4 ? " selected" : "" ?>>Aggressif</option>
|
||||
<option value="5" <?= ($options["-T"] ?? "") == 5 ? " selected" : "" ?>>Dément</option>
|
||||
<option>Paranoïaque</option>
|
||||
<option>Sournois</option>
|
||||
<option>Poli</option>
|
||||
<option>Normal</option>
|
||||
<option>Aggressif</option>
|
||||
<option>Dément</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@ -429,17 +431,13 @@ Exemples: <?= $_SERVER['REMOTE_ADDR']; ?>/24 <?= $_SERVER['SERVER_NAME']; ?> 10.
|
||||
<label for="initialRTTNumber" title="--initial-rtt-timeout">Initial</label>
|
||||
<div class="ui right labeled input">
|
||||
<input type="number" min="0" id="initialRTTNumber" placeholder="Durée"
|
||||
oninput="initialRTTHidden.value = initialRTTNumber.value? initialRTTNumber.value+initialRTTUnit.value: ''; maxRTTHidden.initial=initialRTTHidden.value"
|
||||
<?= preg_match("/^\d+/", $options["--initial-rtt-timeout"] ?? "", $matches) ? "value='{$matches[0]}'" : "" ?>>
|
||||
oninput="initialRTTHidden.value = initialRTTNumber.value? initialRTTNumber.value+initialRTTUnit.value: ''; maxRTTHidden.initial=initialRTTHidden.value">
|
||||
<select id="initialRTTUnit" class="ui clearable dropdown label"
|
||||
oninput="initialRTTHidden.value = initialRTTNumber.value? initialRTTNumber.value+initialRTTUnit.value: ''">
|
||||
<option value="">ms</option>
|
||||
<option value="s"
|
||||
secondes</option>
|
||||
<option value="m"
|
||||
minutes</option>
|
||||
<option value="h"
|
||||
heures</option>
|
||||
<option value="s">secondes</option>
|
||||
<option value="m">minutes</option>
|
||||
<option value="h">heures</option>
|
||||
</select>
|
||||
</div>
|
||||
<input id="initialRTTHidden" type="hidden" name="--initial-rtt-timeout">
|
||||
@ -448,20 +446,19 @@ Exemples: <?= $_SERVER['REMOTE_ADDR']; ?>/24 <?= $_SERVER['SERVER_NAME']; ?> 10.
|
||||
<label for="minRTTNumber" title="--min-rtt-timeout">Minimum</label>
|
||||
<div class="ui right labeled input">
|
||||
<input type="number" min="0" id="minRTTNumber" placeholder="Durée"
|
||||
oninput="minRTTHidden.value = minRTTNumber.value? minRTTNumber.value+minRTTUnit.value: ''; maxRTTHidden.min=minRTTHidden.value"
|
||||
<?= preg_match("/^\d+/", $options["--min-rtt-timeout"] ?? "", $matches) ? "value='{$matches[0]}'" : "" ?>>
|
||||
oninput="minRTTHidden.value = minRTTNumber.value? minRTTNumber.value+minRTTUnit.value: ''; maxRTTHidden.min=minRTTHidden.value">
|
||||
<select id="minRTTUnit" class="ui clearable dropdown label"
|
||||
oninput="minRTTHidden.value = minRTTNumber.value? minRTTNumber.value+minRTTUnit.value: ''">
|
||||
<option value="">ms</option>
|
||||
<option value="s"
|
||||
secondes
|
||||
</option>
|
||||
</option>
|
||||
<option value="m"
|
||||
minutes
|
||||
</option>
|
||||
</option>
|
||||
<option value="h"
|
||||
heures
|
||||
</option>
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<input id="minRTTHidden" type="hidden" name="--min-rtt-timeout">
|
||||
@ -470,20 +467,19 @@ Exemples: <?= $_SERVER['REMOTE_ADDR']; ?>/24 <?= $_SERVER['SERVER_NAME']; ?> 10.
|
||||
<label for="maxRTTNumber" title="--max-rtt-timeout">Maximum</label>
|
||||
<div class="ui right labeled input">
|
||||
<input type="number" min="0" id="maxRTTNumber" placeholder="Durée"
|
||||
oninput="maxRTTHidden.value = maxRTTNumber.value? maxRTTNumber.value+maxRTTUnit.value: ''; minRTTHidden.max=maxRTTHidden.value"
|
||||
<?= preg_match("/^\d+/", $options["--max-rtt-timeout"] ?? "", $matches) ? "value='{$matches[0]}'" : "" ?>>
|
||||
oninput="maxRTTHidden.value = maxRTTNumber.value? maxRTTNumber.value+maxRTTUnit.value: ''; minRTTHidden.max=maxRTTHidden.value">
|
||||
<select id="maxRTTUnit" class="ui clearable dropdown label"
|
||||
oninput="maxRTTHidden.value = maxRTTNumber.value? maxRTTNumber.value+maxRTTUnit.value: ''">
|
||||
<option value="">ms</option>
|
||||
<option value="s"
|
||||
secondes
|
||||
</option>
|
||||
</option>
|
||||
<option value="m"
|
||||
minutes
|
||||
</option>
|
||||
</option>
|
||||
<option value="h"
|
||||
heures
|
||||
</option>
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<input id="maxRTTHidden" type="hidden" name="--max-rtt-timeout">
|
||||
@ -501,17 +497,16 @@ Exemples: <?= $_SERVER['REMOTE_ADDR']; ?>/24 <?= $_SERVER['SERVER_NAME']; ?> 10.
|
||||
<label for="hostTimoutInput" title="--host-timeout">Délai d'expiration du scan d'un hôte trop lent</label>
|
||||
<div class="ui right labeled input">
|
||||
<input type="number" min="0" id="hostTimoutNumber" placeholder="Durée"
|
||||
oninput="hostTimoutHidden.value = hostTimoutNumber.value? hostTimoutNumber.value+hostTimoutUnit.value: ''"
|
||||
<?= preg_match("/^\d+/", $options["--host-timeout"] ?? "", $matches) ? "value='{$matches[0]}'" : "" ?>>
|
||||
oninput="hostTimoutHidden.value = hostTimoutNumber.value? hostTimoutNumber.value+hostTimoutUnit.value: ''">
|
||||
<select id="hostTimoutUnit" class="ui clearable dropdown label"
|
||||
oninput="hostTimoutHidden.value = hostTimoutNumber.value? hostTimoutNumber.value+hostTimoutUnit.value: ''">
|
||||
<option value="">ms</option>
|
||||
<option value="s"secondes
|
||||
</option>
|
||||
<option value="m"minutes
|
||||
</option>
|
||||
<option value="h"heures
|
||||
</option>
|
||||
<option value="s" secondes
|
||||
</option>
|
||||
<option value="m" minutes
|
||||
</option>
|
||||
<option value="h" heures
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<input id="hostTimoutHidden" type="hidden" name="--host-timeout">
|
||||
@ -522,17 +517,16 @@ Exemples: <?= $_SERVER['REMOTE_ADDR']; ?>/24 <?= $_SERVER['SERVER_NAME']; ?> 10.
|
||||
<label for="scanDelayNumber" title="--scan-delay">Délai entre les paquets de tests</label>
|
||||
<div class="ui right labeled input">
|
||||
<input type="number" min="0" id="scanDelayNumber" placeholder="Durée"
|
||||
oninput="scanDelayHidden.value = scanDelayNumber.value? scanDelayNumber.value+scanDelayUnit.value: ''"
|
||||
<?= preg_match("/^\d+/", $options["--scan-delay"] ?? "", $matches) ? "value='{$matches[0]}'" : "" ?>>
|
||||
oninput="scanDelayHidden.value = scanDelayNumber.value? scanDelayNumber.value+scanDelayUnit.value: ''">
|
||||
<select id="scanDelayUnit" class="ui clearable dropdown label"
|
||||
oninput="scanDelayHidden.value = scanDelayNumber.value? scanDelayNumber.value+scanDelayUnit.value: ''">
|
||||
<option value="">ms</option>
|
||||
<option value="s"secondes
|
||||
</option>
|
||||
<option value="m"minutes
|
||||
</option>
|
||||
<option value="h"heures
|
||||
</option>
|
||||
<option value="s" secondes
|
||||
</option>
|
||||
<option value="m" minutes
|
||||
</option>
|
||||
<option value="h" heures
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<input id="scanDelayHidden" type="hidden" name="--scan-delay">
|
||||
@ -541,19 +535,18 @@ Exemples: <?= $_SERVER['REMOTE_ADDR']; ?>/24 <?= $_SERVER['SERVER_NAME']; ?> 10.
|
||||
<label for="maxScanDelay" title="--max-scan-delay">Maximum</label>
|
||||
<div class="ui right labeled input">
|
||||
<input type="number" min="0" id="maxScanDelay" placeholder="Durée"
|
||||
oninput="maxRTTHidden.value = maxScanDelay.value? maxScanDelay.value+maxRTTUnit.value: ''"
|
||||
<?= preg_match("/^\d+/", $options["--max-scan-delay"] ?? "", $matches) ? "value='{$matches[0]}'" : "" ?>>
|
||||
oninput="maxRTTHidden.value = maxScanDelay.value? maxScanDelay.value+maxRTTUnit.value: ''">
|
||||
<select id="maxRTTUnit" class="ui clearable dropdown label"
|
||||
oninput="maxRTTHidden.value = maxScanDelay.value? maxScanDelay.value+maxRTTUnit.value: ''">
|
||||
<option value="">ms</option>
|
||||
<option value="s"
|
||||
secondes
|
||||
</option>
|
||||
</option>
|
||||
<option value="m"
|
||||
minutes
|
||||
</option>
|
||||
<option value="h"heures
|
||||
</option>
|
||||
</option>
|
||||
<option value="h" heures
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<input id="maxRTTHidden" type="hidden" name="--max-scan-delay">
|
||||
@ -652,7 +645,7 @@ Exemples: <?= $_SERVER['REMOTE_ADDR']; ?>/24 <?= $_SERVER['SERVER_NAME']; ?> 10.
|
||||
<?php
|
||||
$services = [];
|
||||
foreach ([$DATADIR, $NMAPDIR] as $dir) {
|
||||
echo "<!-- $nmap_services -->\n";
|
||||
echo "<!-- nmap_services -->\n";
|
||||
if (file_exists("$dir/nmap-services")) {
|
||||
$nmap_services = file("$dir/nmap-services");
|
||||
foreach ($nmap_services as $service) {
|
||||
|
@ -20,7 +20,7 @@ if (!file_exists($path)) {
|
||||
|
||||
$xml = simplexml_load_file($path);
|
||||
$cmd = $xml["args"];
|
||||
if (substr( $cmd, 0, 5 ) != "nmap ") {
|
||||
if (substr($cmd, 0, 5) != "nmap ") {
|
||||
die("Erreur : $path n'est pas un fichier de scan nmap");
|
||||
}
|
||||
|
||||
@ -29,4 +29,4 @@ $cmd = $NMAP . substr($xml["args"], 4);
|
||||
header('Content-type: text/xml');
|
||||
system("$cmd", $retcode);
|
||||
|
||||
exit();
|
||||
exit();
|
||||
|
10
scan.php
10
scan.php
@ -2,20 +2,20 @@
|
||||
|
||||
include_once 'config.php';
|
||||
|
||||
$fileNameRegex = '/^[0-9a-zA-Z-_. ]+$/';
|
||||
$targetsListRegex = '/^[\da-zA-Z-. \/]+$/';
|
||||
$fileNameRegex = '/^[\da-zA-Z-_. ]+$/';
|
||||
$targetsListRegex = '/^[\da-zA-Z-_. \/]+$/';
|
||||
|
||||
$name = filter_input(INPUT_GET, 'name', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => $fileNameRegex], "flags" => FILTER_NULL_ON_FAILURE]);
|
||||
|
||||
$lan = filter_input(INPUT_GET, 'lan', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => $targetsListRegex], "flags" => FILTER_NULL_ON_FAILURE]);
|
||||
if ($lan) {
|
||||
$cmd = "$NMAP $LANSCANOPTIONS --stylesheet '$BASEDIR/$STYLESHEETSDIR/lanScan.xsl?name=$name' -oX - $lan";
|
||||
$cmd = "$NMAP $LANSCANOPTIONS $COMMONOPTIONS --stylesheet '$BASEDIR/$STYLESHEETSDIR/lanScan.xsl?name=" . rawurlencode($name) . "' -oX - $lan";
|
||||
$filename = str_replace("/", "!", $lan);
|
||||
}
|
||||
|
||||
$host = filter_input(INPUT_GET, 'host', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => $targetsListRegex], "flags" => FILTER_NULL_ON_FAILURE]);
|
||||
if ($host) {
|
||||
$cmd = "$NMAP $HOSTSCANOPTIONS --stylesheet '$BASEDIR/$STYLESHEETSDIR/hostScan.xsl?name=$name' -oX - $host";
|
||||
$cmd = "$NMAP $HOSTSCANOPTIONS $COMMONOPTIONS --stylesheet '$BASEDIR/$STYLESHEETSDIR/hostScan.xsl?name=" . rawurlencode($name) . "' -oX - $host";
|
||||
$filename = str_replace("/", "!", $host);
|
||||
}
|
||||
|
||||
@ -147,7 +147,7 @@ if ($targets) {
|
||||
}
|
||||
}
|
||||
|
||||
$cmd = "$NMAP$options $CUSTOMSCANOPTIONS --stylesheet $BASEDIR/$STYLESHEETSDIR/lanScan.xsl?name=$name' -oX - $targets";
|
||||
$cmd = "$NMAP$options $COMMONOPTIONS --stylesheet '$BASEDIR/$STYLESHEETSDIR/lanScan.xsl?name" . rawurlencode($name) . "' -oX - $targets";
|
||||
$filename = str_replace("/", "!", $targets);
|
||||
}
|
||||
|
||||
|
@ -2,23 +2,27 @@
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.1">
|
||||
|
||||
<xsl:import href="head.xsl" />
|
||||
<xsl:import href="nav.xsl" />
|
||||
<xsl:import href="services.xsl" />
|
||||
<xsl:import href="toast.xsl" />
|
||||
<xsl:import href="lib/head.xsl" />
|
||||
<xsl:import href="lib/nav.xsl" />
|
||||
<xsl:import href="lib/services.xsl" />
|
||||
<xsl:import href="lib/toast.xsl" />
|
||||
|
||||
<xsl:output method="html" encoding="UTF-8" />
|
||||
<xsl:output indent="yes" />
|
||||
<xsl:strip-space elements='*' />
|
||||
|
||||
<xsl:variable name="stylesheetURL" select="substring-before(substring-after(processing-instruction('xml-stylesheet'),'href="'), '?')" />
|
||||
<xsl:variable name="stylesheetURL"
|
||||
select="substring-before(substring-after(processing-instruction('xml-stylesheet'),'href="'), '?')" />
|
||||
<xsl:variable name="base" select="concat($stylesheetURL, '/../../')" />
|
||||
<xsl:variable name="name" select="substring-before(substring-after(processing-instruction('xml-stylesheet'),'name='), '"')" />
|
||||
<xsl:variable name="name"
|
||||
select="substring-before(substring-after(processing-instruction('xml-stylesheet'),'name='), '"')" />
|
||||
|
||||
<xsl:template match="nmaprun">
|
||||
<xsl:variable name="targets" select="substring-after(@args, '-oX - ')" />
|
||||
<xsl:variable name="current" select="." />
|
||||
<xsl:variable name="init" select="document(concat($base, 'scans/', $name, '.xml'))/nmaprun" />
|
||||
<xsl:variable
|
||||
name="current" select="." />
|
||||
<xsl:variable name="init"
|
||||
select="document(concat($base, 'scans/', $name, '.xml'))/nmaprun" />
|
||||
|
||||
<html lang="fr">
|
||||
<xsl:apply-templates select="." mode="head">
|
||||
@ -29,10 +33,12 @@
|
||||
|
||||
<body>
|
||||
<xsl:apply-templates select="." mode="nav">
|
||||
<xsl:with-param name="name" select="$name" />
|
||||
</xsl:apply-templates>
|
||||
|
||||
<main class="ui main container inverted segment">
|
||||
<xsl:apply-templates select="$current/host | $init/host[not(address/@addr=$current/host/address/@addr)][not(status/@state='down')]">
|
||||
<xsl:apply-templates
|
||||
select="$current/host | $init/host[not(address/@addr=$current/host/address/@addr)][not(status/@state='down')]">
|
||||
<xsl:with-param name="init" select="$init" />
|
||||
<xsl:with-param name="current" select="$current" />
|
||||
</xsl:apply-templates>
|
||||
@ -54,9 +60,12 @@ $('.ui.dropdown').dropdown()
|
||||
<xsl:template match="host">
|
||||
<xsl:param name="init" />
|
||||
<xsl:param name="current" />
|
||||
<xsl:variable name="addr" select="address/@addr" />
|
||||
<xsl:variable name="initHost" select="$init/host[address/@addr=$addr]" />
|
||||
<xsl:variable name="currentHost" select="$current/host[address/@addr=$addr]" />
|
||||
<xsl:variable name="addr"
|
||||
select="address/@addr" />
|
||||
<xsl:variable name="initHost"
|
||||
select="$init/host[address/@addr=$addr]" />
|
||||
<xsl:variable name="currentHost"
|
||||
select="$current/host[address/@addr=$addr]" />
|
||||
<xsl:variable name="hostAddress">
|
||||
<xsl:choose>
|
||||
<xsl:when test="hostnames/hostname/@name">
|
||||
@ -86,7 +95,8 @@ $('.ui.dropdown').dropdown()
|
||||
</xsl:choose>
|
||||
</h1>
|
||||
|
||||
<table class="ui inverted table" style="width: max-content">
|
||||
<table
|
||||
class="ui inverted table" style="width: max-content">
|
||||
<thead>
|
||||
<tr>
|
||||
<xsl:if test="address[@addrtype='ipv4']/@addr">
|
||||
@ -146,7 +156,8 @@ $('.ui.dropdown').dropdown()
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<xsl:if test="hostscript/script">
|
||||
<xsl:if
|
||||
test="hostscript/script">
|
||||
<div class="ui inverted tree accordion">
|
||||
<div class="title">
|
||||
<i class="dropdown icon"></i> Informations supplémentaires </div>
|
||||
@ -156,26 +167,32 @@ $('.ui.dropdown').dropdown()
|
||||
</div>
|
||||
</xsl:if>
|
||||
|
||||
<h2 class="ui header">Services</h2>
|
||||
<h2
|
||||
class="ui header">Services</h2>
|
||||
|
||||
<div class="ui cards">
|
||||
<xsl:apply-templates select="$currentHost/ports/port | $initHost/ports/port[not(@portid=$currentHost/ports/port/@portid)][not(state/@state='closed')]">
|
||||
<xsl:apply-templates
|
||||
select="$currentHost/ports/port | $initHost/ports/port[not(@portid=$currentHost/ports/port/@portid)][not(state/@state='closed')]">
|
||||
<xsl:with-param name="initHost" select="$initHost" />
|
||||
<xsl:with-param name="currentHost" select="$currentHost" />
|
||||
<xsl:with-param name="hostAddress" select="$hostAddress" />
|
||||
</xsl:apply-templates>
|
||||
</div>
|
||||
|
||||
<xsl:apply-templates select="trace" />
|
||||
<xsl:apply-templates
|
||||
select="trace" />
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="port">
|
||||
<xsl:param name="hostAddress" />
|
||||
<xsl:param name="initHost" />
|
||||
<xsl:param name="currentHost" />
|
||||
<xsl:variable name="portid" select="@portid" />
|
||||
<xsl:variable name="initPort" select="$initHost/ports/port[@portid=$portid]" />
|
||||
<xsl:variable name="currentPort" select="$currentHost/ports/port[@portid=$portid]" />
|
||||
<xsl:variable
|
||||
name="portid" select="@portid" />
|
||||
<xsl:variable name="initPort"
|
||||
select="$initHost/ports/port[@portid=$portid]" />
|
||||
<xsl:variable name="currentPort"
|
||||
select="$currentHost/ports/port[@portid=$portid]" />
|
||||
<xsl:variable name="color">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$currentPort/script[@id='http-info']/elem[@key='status']>=500">red</xsl:when>
|
||||
@ -187,7 +204,8 @@ $('.ui.dropdown').dropdown()
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
|
||||
<div class="ui inverted card {$color}">
|
||||
<div
|
||||
class="ui inverted card {$color}">
|
||||
<div class="content">
|
||||
<div class="header">
|
||||
<div class="ui {$color} ribbon label">
|
||||
@ -236,7 +254,8 @@ $('.ui.dropdown').dropdown()
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<xsl:if test="service/@name='ftp' or service/@name='ssh' or service/@name='http' or service/@name='https' or service/@name='ms-wbt-server'">
|
||||
<xsl:if
|
||||
test="service/@name='ftp' or service/@name='ssh' or service/@name='http' or service/@name='https' or service/@name='ms-wbt-server'">
|
||||
<a class="ui {$color} button" target="_blank">
|
||||
<xsl:attribute name="href">
|
||||
<xsl:choose>
|
||||
@ -244,7 +263,8 @@ $('.ui.dropdown').dropdown()
|
||||
<xsl:text>rdp.php?v=</xsl:text>
|
||||
<xsl:value-of select="$hostAddress" />
|
||||
<xsl:text>&p=</xsl:text>
|
||||
<xsl:value-of select="@portid" />
|
||||
<xsl:value-of
|
||||
select="@portid" />
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:choose>
|
||||
@ -256,7 +276,8 @@ $('.ui.dropdown').dropdown()
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:text>://</xsl:text>
|
||||
<xsl:value-of select="$hostAddress" />
|
||||
<xsl:value-of
|
||||
select="$hostAddress" />
|
||||
<xsl:text>:</xsl:text>
|
||||
<xsl:value-of select="@portid" />
|
||||
</xsl:otherwise>
|
||||
@ -271,11 +292,13 @@ $('.ui.dropdown').dropdown()
|
||||
<xsl:attribute name="style">
|
||||
<xsl:for-each select="$currentPort/script[@id='smb-shares-size']/table">
|
||||
<xsl:sort select="elem[@key='FreeSize'] div elem[@key='TotalSize']" order="ascending" />
|
||||
<xsl:if test="position()=1">
|
||||
<xsl:if
|
||||
test="position()=1">
|
||||
<xsl:text>--free: </xsl:text>
|
||||
<xsl:value-of select="elem[@key='FreeSize']" />
|
||||
<xsl:text>; --total: </xsl:text>
|
||||
<xsl:value-of select="elem[@key='TotalSize']" />
|
||||
<xsl:value-of
|
||||
select="elem[@key='TotalSize']" />
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</xsl:attribute>
|
||||
@ -309,7 +332,8 @@ $('.ui.dropdown').dropdown()
|
||||
</tbody>
|
||||
</table>
|
||||
</xsl:if>
|
||||
<xsl:apply-templates select="table" />
|
||||
<xsl:apply-templates
|
||||
select="table" />
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="@output" />
|
||||
@ -362,7 +386,9 @@ $('.ui.dropdown').dropdown()
|
||||
|
||||
<xsl:template match="table">
|
||||
<xsl:param name="hostAddress" />
|
||||
<a class="item share-size" href="file://///{$hostAddress}/{@key}" target="_blank" rel="noopener noreferrer" style="--free: {elem[@key='FreeSize']}; --total: {elem[@key='TotalSize']}">
|
||||
<a class="item share-size"
|
||||
href="file://///{$hostAddress}/{@key}" target="_blank" rel="noopener noreferrer"
|
||||
style="--free: {elem[@key='FreeSize']}; --total: {elem[@key='TotalSize']}">
|
||||
<xsl:value-of select="@key" />
|
||||
</a>
|
||||
</xsl:template>
|
||||
@ -391,10 +417,17 @@ $('.ui.dropdown').dropdown()
|
||||
<xsl:value-of select="@ttl" />
|
||||
</td>
|
||||
<td>
|
||||
<xsl:value-of select="@host" />
|
||||
<xsl:text> (</xsl:text>
|
||||
<xsl:value-of select="@ipaddr" />
|
||||
<xsl:text>)</xsl:text>
|
||||
<xsl:choose>
|
||||
<xsl:when test="@host">
|
||||
<xsl:value-of select="@host" />
|
||||
<xsl:text> (</xsl:text>
|
||||
<xsl:value-of select="@ipaddr" />
|
||||
<xsl:text>)</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="@ipaddr" />
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</td>
|
||||
<td>
|
||||
<xsl:value-of select="@rtt" />
|
||||
|
@ -2,22 +2,26 @@
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.1">
|
||||
|
||||
<xsl:import href="head.xsl" />
|
||||
<xsl:import href="nav.xsl" />
|
||||
<xsl:import href="services.xsl" />
|
||||
<xsl:import href="toast.xsl" />
|
||||
<xsl:import href="lib/head.xsl" />
|
||||
<xsl:import href="lib/nav.xsl" />
|
||||
<xsl:import href="lib/services.xsl" />
|
||||
<xsl:import href="lib/toast.xsl" />
|
||||
|
||||
<xsl:output method="html" encoding="UTF-8" indent="yes" />
|
||||
<xsl:strip-space elements='*' />
|
||||
|
||||
<xsl:variable name="stylesheetURL" select="substring-before(substring-after(processing-instruction('xml-stylesheet'),'href="'), '?')" />
|
||||
<xsl:variable name="stylesheetURL"
|
||||
select="substring-before(substring-after(processing-instruction('xml-stylesheet'),'href="'), '?')" />
|
||||
<xsl:variable name="base" select="concat($stylesheetURL, '/../../')" />
|
||||
<xsl:variable name="name" select="substring-before(substring-after(processing-instruction('xml-stylesheet'),'name='), '"')"/>
|
||||
<xsl:variable name="name"
|
||||
select="substring-before(substring-after(processing-instruction('xml-stylesheet'),'name='), '"')" />
|
||||
|
||||
<xsl:template match="nmaprun">
|
||||
<xsl:variable name="targets" select="substring-after(@args, '-oX - ')" />
|
||||
<xsl:variable name="current" select="." />
|
||||
<xsl:variable name="init" select="document(concat($base, 'scans/', $name, '.xml'))/nmaprun" />
|
||||
<xsl:variable
|
||||
name="current" select="." />
|
||||
<xsl:variable name="init"
|
||||
select="document(concat($base, 'scans/', $name, '.xml'))/nmaprun" />
|
||||
|
||||
<html lang="fr">
|
||||
<xsl:apply-templates select="." mode="head">
|
||||
@ -28,13 +32,14 @@
|
||||
|
||||
<body>
|
||||
<xsl:apply-templates select="." mode="nav">
|
||||
<xsl:with-param name="name" select="$name" />
|
||||
</xsl:apply-templates>
|
||||
|
||||
<main class="ui main container inverted segment">
|
||||
<h1 class="ui header">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$name">
|
||||
<xsl:value-of select="$name" />
|
||||
<xsl:value-of select="$name" disable-output-escaping="yes" />
|
||||
<div class="sub header">
|
||||
<xsl:value-of select="$targets" />
|
||||
</div>
|
||||
@ -45,7 +50,8 @@
|
||||
</xsl:choose>
|
||||
</h1>
|
||||
|
||||
<table id="scanResultsTable" style="width:100%" role="grid" class="ui sortable small compact stuck striped table">
|
||||
<table id="scanResultsTable" style="width:100%" role="grid"
|
||||
class="ui sortable small compact stuck striped table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: min-width">Etat</th>
|
||||
@ -59,7 +65,8 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<xsl:apply-templates select="host | $init/host[not(address/@addr=$current/host/address/@addr)][not(status/@state='down')]">
|
||||
<xsl:apply-templates
|
||||
select="host | $init/host[not(address/@addr=$current/host/address/@addr)][not(status/@state='down')]">
|
||||
<xsl:with-param name="init" select="$init" />
|
||||
<xsl:with-param name="current" select="$current" />
|
||||
</xsl:apply-templates>
|
||||
@ -95,9 +102,12 @@ $('.ui.dropdown').dropdown()
|
||||
<xsl:template match="host">
|
||||
<xsl:param name="init" />
|
||||
<xsl:param name="current" />
|
||||
<xsl:variable name="addr" select="address/@addr" />
|
||||
<xsl:variable name="initHost" select="$init/host[address/@addr=$addr]" />
|
||||
<xsl:variable name="currentHost" select="$current/host[address/@addr=$addr]" />
|
||||
<xsl:variable name="addr"
|
||||
select="address/@addr" />
|
||||
<xsl:variable name="initHost"
|
||||
select="$init/host[address/@addr=$addr]" />
|
||||
<xsl:variable name="currentHost"
|
||||
select="$current/host[address/@addr=$addr]" />
|
||||
<xsl:variable name="hostAddress">
|
||||
<xsl:choose>
|
||||
<xsl:when test="hostnames/hostname/@name">
|
||||
@ -144,14 +154,17 @@ $('.ui.dropdown').dropdown()
|
||||
<xsl:if test="substring-after(hostnames/hostname/@name, '.')">
|
||||
<wbr />
|
||||
<xsl:text>.</xsl:text>
|
||||
<xsl:value-of select="substring-after(hostnames/hostname/@name, '.')" />
|
||||
<xsl:value-of
|
||||
select="substring-after(hostnames/hostname/@name, '.')" />
|
||||
</xsl:if>
|
||||
</td>
|
||||
<td>
|
||||
<xsl:value-of select="address[@addrtype='mac']/@vendor" />
|
||||
</td>
|
||||
<td>
|
||||
<xsl:apply-templates select="ports/port | $initHost/ports/port[not(state/@state='closed')][not(@portid=$currentHost/ports/port/@portid)]" mode="service">
|
||||
<xsl:apply-templates
|
||||
select="ports/port | $initHost/ports/port[not(state/@state='closed')][not(@portid=$currentHost/ports/port/@portid)]"
|
||||
mode="service">
|
||||
<xsl:with-param name="initHost" select="$initHost" />
|
||||
<xsl:with-param name="currentHost" select="$currentHost" />
|
||||
<xsl:with-param name="hostAddress" select="$hostAddress" />
|
||||
|
1071
stylesheets/nmap.xsl
1071
stylesheets/nmap.xsl
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user