cant decode uri :(
This commit is contained in:
parent
b03c6a42ae
commit
e2239d3894
@ -54,8 +54,8 @@ Exemples: <?= $_SERVER['REMOTE_ADDR']; ?>/24 <?= $_SERVER['SERVER_NAME']; ?> 10.
|
|||||||
<div class="field">
|
<div class="field">
|
||||||
<label for="nameInput">Enregistrer sous le nom (optionnel)</label>
|
<label for="nameInput">Enregistrer sous le nom (optionnel)</label>
|
||||||
<div class="ui small input">
|
<div class="ui small input">
|
||||||
<input id="nameInput" type="text" name="name" placeholder="Réseau local"
|
<input id="nameInput" type="text" name="name" placeholder="Reseau local"
|
||||||
pattern='[^<>:"\\\/\|@?]+' title="Caractères interdits : <>:"\/|@?">
|
pattern='[0-9a-zA-Z\-_\. ]+' title="Caractères autorisés: a-z A-Z 0-9 - _ ."/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="ui error message"></div>
|
<div class="ui error message"></div>
|
||||||
@ -78,7 +78,7 @@ Exemples: <?= $_SERVER['REMOTE_ADDR']; ?>/24 <?= $_SERVER['SERVER_NAME']; ?> 10.
|
|||||||
foreach (scandir($SCANSDIR) as $filename) {
|
foreach (scandir($SCANSDIR) as $filename) {
|
||||||
if (substr($filename, -4) == '.xml') {
|
if (substr($filename, -4) == '.xml') {
|
||||||
$name = str_replace('!', '/', substr_replace($filename, '', -4));
|
$name = str_replace('!', '/', substr_replace($filename, '', -4));
|
||||||
echo "<tr><td class='selectable'><a href='$SCANSDIR/" . rawurlencode($filename) . "'><i class='tasks icon'></i>$name</a></td><td class='collapsing'><a href='rescan.php?name=$name' class='ui mini labelled button' onclick='rescan(this)'><i class='sync icon'></i>Rescanner</a></td></tr>\n";
|
echo "<tr><td class='selectable'><a href='$SCANSDIR/" . rawurlencode($filename) . "'><i class='tasks icon'></i>$name</a></td><td class='collapsing'><a href='rescan.php?name=$name' class='ui mini labelled button' onclick='rescan(this)'><i class='sync icon'></i>Rescanner</a></td><td class='collapsing'><a href='rm.php?name=$name' class='ui mini negative icon button'><i class='trash icon'></i></a></td></td></tr>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
23
rm.php
Normal file
23
rm.php
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
error_reporting(E_ALL);
|
||||||
|
ini_set('display_errors', '1');
|
||||||
|
ini_set('display_startup_errors', '1');
|
||||||
|
|
||||||
|
include_once 'config.php';
|
||||||
|
|
||||||
|
$fileNameRegex = '/^[0-9a-zA-Z-_. ]+$/';
|
||||||
|
|
||||||
|
$name = filter_input(INPUT_GET, 'name', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => $fileNameRegex], "flags" => FILTER_NULL_ON_FAILURE]);
|
||||||
|
if (!$name) {
|
||||||
|
die("Paramètre manquant ou incorrect : name");
|
||||||
|
}
|
||||||
|
|
||||||
|
$path = "$SCANSDIR/$name.xml";
|
||||||
|
if (!file_exists($path)) {
|
||||||
|
die("Scan inconnu : $name");
|
||||||
|
}
|
||||||
|
|
||||||
|
unlink($path);
|
||||||
|
|
||||||
|
header('Location: .');
|
167
scan.php
167
scan.php
@ -2,128 +2,128 @@
|
|||||||
|
|
||||||
include_once 'config.php';
|
include_once 'config.php';
|
||||||
|
|
||||||
$fileNameRegex = '/^[^<>:\/|?]+$/';
|
$fileNameRegex = '/^[0-9a-zA-Z-_. ]+$/';
|
||||||
$targetsListRegex = '/^[\da-zA-Z-. \/]+$/';
|
$targetsListRegex = '/^[\da-zA-Z-. \/]+$/';
|
||||||
|
|
||||||
$name = filter_input(INPUT_GET, 'name', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => $fileNameRegex], "flags" => FILTER_NULL_ON_FAILURE]);
|
$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]);
|
$lan = filter_input(INPUT_GET, 'lan', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => $targetsListRegex], "flags" => FILTER_NULL_ON_FAILURE]);
|
||||||
if ($lan) {
|
if ($lan) {
|
||||||
$cmd = "$NMAP $LANSCANOPTIONS --stylesheet '$BASEDIR/$STYLESHEETSDIR/lanScan.xsl?name=$name&' -oX - $lan";
|
$cmd = "$NMAP $LANSCANOPTIONS --stylesheet '$BASEDIR/$STYLESHEETSDIR/lanScan.xsl?name=$name' -oX - $lan";
|
||||||
$filename = str_replace("/", "!", $lan);
|
$filename = str_replace("/", "!", $lan);
|
||||||
}
|
}
|
||||||
|
|
||||||
$host = filter_input(INPUT_GET, 'host', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => $targetsListRegex], "flags" => FILTER_NULL_ON_FAILURE]);
|
$host = filter_input(INPUT_GET, 'host', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => $targetsListRegex], "flags" => FILTER_NULL_ON_FAILURE]);
|
||||||
if ($host) {
|
if ($host) {
|
||||||
$cmd = "$NMAP $HOSTSCANOPTIONS --stylesheet '$BASEDIR/$STYLESHEETSDIR/hostScan.xsl?name=$name&' -oX - $host";
|
$cmd = "$NMAP $HOSTSCANOPTIONS --stylesheet '$BASEDIR/$STYLESHEETSDIR/hostScan.xsl?name=$name' -oX - $host";
|
||||||
$filename = str_replace("/", "!", $host);
|
$filename = str_replace("/", "!", $host);
|
||||||
}
|
}
|
||||||
|
|
||||||
$targets = filter_input(INPUT_GET, 'targets', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => $targetsListRegex], "flags" => FILTER_NULL_ON_FAILURE]);
|
$targets = filter_input(INPUT_GET, 'targets', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => $targetsListRegex], "flags" => FILTER_NULL_ON_FAILURE]);
|
||||||
if ($targets) {
|
if ($targets) {
|
||||||
$hostsListRegex = '/^[\da-zA-Z-.,:\/]+$/';
|
$hostsListRegex = '/^[\da-zA-Z-.,:\/]+$/';
|
||||||
$protocolePortsListRegex = '/^(([TU]:)?[0-9\-]+|[a-z\-]+)(,([TU]:)?[0-9\-]+|,[a-z\-]+)*$/';
|
$protocolePortsListRegex = '/^(([TU]:)?[0-9\-]+|[a-z\-]+)(,([TU]:)?[0-9\-]+|,[a-z\-]+)*$/';
|
||||||
$portsListRegex = '/^([0-9\-]+|[a-z\-]+)(,[0-9\-]+|,[a-z\-]+)*$/';
|
$portsListRegex = '/^([0-9\-]+|[a-z\-]+)(,[0-9\-]+|,[a-z\-]+)*$/';
|
||||||
$tempoRegex = '/^\d+[smh]?$/';
|
$tempoRegex = '/^\d+[smh]?$/';
|
||||||
|
|
||||||
$inputs = filter_input_array(INPUT_GET, [
|
$inputs = filter_input_array(INPUT_GET, [
|
||||||
// TARGET SPECIFICATION:
|
// TARGET SPECIFICATION:
|
||||||
'-iR' => ['filter' => FILTER_VALIDATE_INT, 'options' => ['min_range' => 0]],
|
'-iR' => ['filter' => FILTER_VALIDATE_INT, 'options' => ['min_range' => 0]],
|
||||||
'--exclude' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $hostsListRegex]],
|
'--exclude' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $hostsListRegex]],
|
||||||
// HOST DISCOVERY:
|
// HOST DISCOVERY:
|
||||||
'-sL' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $hostsListRegex]],
|
'-sL' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $hostsListRegex]],
|
||||||
'-sP' => FILTER_VALIDATE_BOOLEAN,
|
'-sP' => FILTER_VALIDATE_BOOLEAN,
|
||||||
'-P0' => FILTER_VALIDATE_BOOLEAN,
|
'-P0' => FILTER_VALIDATE_BOOLEAN,
|
||||||
'-Pn' => FILTER_VALIDATE_BOOLEAN,
|
'-Pn' => FILTER_VALIDATE_BOOLEAN,
|
||||||
'-PS' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $portsListRegex]],
|
'-PS' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $portsListRegex]],
|
||||||
'-PA' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $portsListRegex]],
|
'-PA' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $portsListRegex]],
|
||||||
'-PU' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $portsListRegex]],
|
'-PU' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $portsListRegex]],
|
||||||
'-PE' => FILTER_VALIDATE_BOOLEAN,
|
'-PE' => FILTER_VALIDATE_BOOLEAN,
|
||||||
'-PP' => FILTER_VALIDATE_BOOLEAN,
|
'-PP' => FILTER_VALIDATE_BOOLEAN,
|
||||||
'-PM' => FILTER_VALIDATE_BOOLEAN,
|
'-PM' => FILTER_VALIDATE_BOOLEAN,
|
||||||
'-PO' => ['filter' => FILTER_VALIDATE_INT, 'options' => ['min_range' => 0, 'max_range' => 255]],
|
'-PO' => ['filter' => FILTER_VALIDATE_INT, 'options' => ['min_range' => 0, 'max_range' => 255]],
|
||||||
'-PR' => FILTER_VALIDATE_BOOLEAN,
|
'-PR' => FILTER_VALIDATE_BOOLEAN,
|
||||||
'--send-ip' => FILTER_VALIDATE_BOOLEAN,
|
'--send-ip' => FILTER_VALIDATE_BOOLEAN,
|
||||||
'-n' => FILTER_VALIDATE_BOOLEAN,
|
'-n' => FILTER_VALIDATE_BOOLEAN,
|
||||||
'-R' => FILTER_VALIDATE_BOOLEAN,
|
'-R' => FILTER_VALIDATE_BOOLEAN,
|
||||||
'--dns-servers' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $hostsListRegex]],
|
'--dns-servers' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $hostsListRegex]],
|
||||||
// SCAN TECHNIQUES:
|
// SCAN TECHNIQUES:
|
||||||
'-sS' => FILTER_VALIDATE_BOOLEAN,
|
'-sS' => FILTER_VALIDATE_BOOLEAN,
|
||||||
'-sT' => FILTER_VALIDATE_BOOLEAN,
|
'-sT' => FILTER_VALIDATE_BOOLEAN,
|
||||||
'-sA' => FILTER_VALIDATE_BOOLEAN,
|
'-sA' => FILTER_VALIDATE_BOOLEAN,
|
||||||
'-sW' => FILTER_VALIDATE_BOOLEAN,
|
'-sW' => FILTER_VALIDATE_BOOLEAN,
|
||||||
'-sM' => FILTER_VALIDATE_BOOLEAN,
|
'-sM' => FILTER_VALIDATE_BOOLEAN,
|
||||||
'-sF' => FILTER_VALIDATE_BOOLEAN,
|
'-sF' => FILTER_VALIDATE_BOOLEAN,
|
||||||
'-sN' => FILTER_VALIDATE_BOOLEAN,
|
'-sN' => FILTER_VALIDATE_BOOLEAN,
|
||||||
'-sX' => FILTER_VALIDATE_BOOLEAN,
|
'-sX' => FILTER_VALIDATE_BOOLEAN,
|
||||||
'-sU' => FILTER_VALIDATE_BOOLEAN,
|
'-sU' => FILTER_VALIDATE_BOOLEAN,
|
||||||
'--scanflags' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => '/^(URG|ACK|PSH|RST|SYN|FIN|,)+|[1-9]?[0-9]|[1-2][0-9][0-9]$/']],
|
'--scanflags' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => '/^(URG|ACK|PSH|RST|SYN|FIN|,)+|[1-9]?[0-9]|[1-2][0-9][0-9]$/']],
|
||||||
'-sI' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => '/^[a-zA-Z\d:.-]+(:\d+)?$/']],
|
'-sI' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => '/^[a-zA-Z\d:.-]+(:\d+)?$/']],
|
||||||
'-sO' => FILTER_VALIDATE_BOOLEAN,
|
'-sO' => FILTER_VALIDATE_BOOLEAN,
|
||||||
'-b' => FILTER_VALIDATE_URL,
|
'-b' => FILTER_VALIDATE_URL,
|
||||||
'--traceroute' => FILTER_VALIDATE_BOOLEAN,
|
'--traceroute' => FILTER_VALIDATE_BOOLEAN,
|
||||||
'--reason' => FILTER_VALIDATE_BOOLEAN,
|
'--reason' => FILTER_VALIDATE_BOOLEAN,
|
||||||
// PORT SPECIFICATION AND SCAN ORDER:
|
// PORT SPECIFICATION AND SCAN ORDER:
|
||||||
'-p' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $portsListRegex]],
|
'-p' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $portsListRegex]],
|
||||||
'-F' => FILTER_VALIDATE_BOOLEAN,
|
'-F' => FILTER_VALIDATE_BOOLEAN,
|
||||||
'-r' => FILTER_VALIDATE_BOOLEAN,
|
'-r' => FILTER_VALIDATE_BOOLEAN,
|
||||||
'--top-ports' => FILTER_VALIDATE_INT,
|
'--top-ports' => FILTER_VALIDATE_INT,
|
||||||
'--port-ratio' => ['filter' => FILTER_VALIDATE_FLOAT, 'options' => ['min_range' => 0, 'max_range' => 1]],
|
'--port-ratio' => ['filter' => FILTER_VALIDATE_FLOAT, 'options' => ['min_range' => 0, 'max_range' => 1]],
|
||||||
// SERVICE/VERSION DETECTION:
|
// SERVICE/VERSION DETECTION:
|
||||||
'-sV' => FILTER_VALIDATE_BOOLEAN,
|
'-sV' => FILTER_VALIDATE_BOOLEAN,
|
||||||
'--version-light' => FILTER_VALIDATE_BOOLEAN,
|
'--version-light' => FILTER_VALIDATE_BOOLEAN,
|
||||||
'--version-intensity' => ['filter' => FILTER_VALIDATE_INT, 'options' => ['min_range' => 0, 'max_range' => 9]],
|
'--version-intensity' => ['filter' => FILTER_VALIDATE_INT, 'options' => ['min_range' => 0, 'max_range' => 9]],
|
||||||
'--version-all' => FILTER_VALIDATE_BOOLEAN,
|
'--version-all' => FILTER_VALIDATE_BOOLEAN,
|
||||||
'--version-trace' => FILTER_VALIDATE_BOOLEAN,
|
'--version-trace' => FILTER_VALIDATE_BOOLEAN,
|
||||||
// SCRIPT SCAN:
|
// SCRIPT SCAN:
|
||||||
'-sC' => FILTER_VALIDATE_BOOLEAN,
|
'-sC' => FILTER_VALIDATE_BOOLEAN,
|
||||||
'--script' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => '/^[a-z][a-z0-9,\-\.\/]*$/']],
|
'--script' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => '/^[a-z][a-z0-9,\-\.\/]*$/']],
|
||||||
'--script-args' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => '/^([a-zA-Z][a-zA-Z0-9\-_]*=[^"]+(,[a-zA-Z][a-zA-Z0-9\-_]*=[^"]+)?)$/']],
|
'--script-args' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => '/^([a-zA-Z][a-zA-Z0-9\-_]*=[^"]+(,[a-zA-Z][a-zA-Z0-9\-_]*=[^"]+)?)$/']],
|
||||||
// OS DETECTION:
|
// OS DETECTION:
|
||||||
'-O' => FILTER_VALIDATE_BOOLEAN,
|
'-O' => FILTER_VALIDATE_BOOLEAN,
|
||||||
'--osscan-limit' => FILTER_VALIDATE_BOOLEAN,
|
'--osscan-limit' => FILTER_VALIDATE_BOOLEAN,
|
||||||
'--osscan-guess' => FILTER_VALIDATE_BOOLEAN,
|
'--osscan-guess' => FILTER_VALIDATE_BOOLEAN,
|
||||||
'--max-os-tries' => ['filter' => FILTER_VALIDATE_INT, 'options' => ['min_range' => 0]],
|
'--max-os-tries' => ['filter' => FILTER_VALIDATE_INT, 'options' => ['min_range' => 0]],
|
||||||
// TIMING AND PERFORMANCE:
|
// TIMING AND PERFORMANCE:
|
||||||
'-T' => ['filter' => FILTER_VALIDATE_INT, 'options' => ['min_range' => 0, 'max_range' => 5]],
|
'-T' => ['filter' => FILTER_VALIDATE_INT, 'options' => ['min_range' => 0, 'max_range' => 5]],
|
||||||
'--min-hostgroup' => ['filter' => FILTER_VALIDATE_INT, 'options' => ['min_range' => 0]],
|
'--min-hostgroup' => ['filter' => FILTER_VALIDATE_INT, 'options' => ['min_range' => 0]],
|
||||||
'--max-hostgroup' => ['filter' => FILTER_VALIDATE_INT, 'options' => ['min_range' => 0]],
|
'--max-hostgroup' => ['filter' => FILTER_VALIDATE_INT, 'options' => ['min_range' => 0]],
|
||||||
'--min-parallelism' => ['filter' => FILTER_VALIDATE_INT, 'options' => ['min_range' => 0]],
|
'--min-parallelism' => ['filter' => FILTER_VALIDATE_INT, 'options' => ['min_range' => 0]],
|
||||||
'--max-parallelism' => ['filter' => FILTER_VALIDATE_INT, 'options' => ['min_range' => 0]],
|
'--max-parallelism' => ['filter' => FILTER_VALIDATE_INT, 'options' => ['min_range' => 0]],
|
||||||
'--min-rtt-timeout' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $tempoRegex]],
|
'--min-rtt-timeout' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $tempoRegex]],
|
||||||
'--max-rtt-timeout' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $tempoRegex]],
|
'--max-rtt-timeout' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $tempoRegex]],
|
||||||
'--initial-rtt-timeout' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $tempoRegex]],
|
'--initial-rtt-timeout' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $tempoRegex]],
|
||||||
'--max-retries' => ['filter' => FILTER_VALIDATE_INT, 'options' => ['min_range' => 0]],
|
'--max-retries' => ['filter' => FILTER_VALIDATE_INT, 'options' => ['min_range' => 0]],
|
||||||
'--host-timeout' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $tempoRegex]],
|
'--host-timeout' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $tempoRegex]],
|
||||||
'--scan-delay' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $tempoRegex]],
|
'--scan-delay' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $tempoRegex]],
|
||||||
'--max-scan-delay' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $tempoRegex]],
|
'--max-scan-delay' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $tempoRegex]],
|
||||||
// FIREWALL/IDS EVASION AND SPOOFING:
|
// FIREWALL/IDS EVASION AND SPOOFING:
|
||||||
'-f' => FILTER_VALIDATE_INT,
|
'-f' => FILTER_VALIDATE_INT,
|
||||||
'--mtu' => FILTER_VALIDATE_INT,
|
'--mtu' => FILTER_VALIDATE_INT,
|
||||||
'-D' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $hostsListRegex]],
|
'-D' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $hostsListRegex]],
|
||||||
'-S' => ['filter' => FILTER_VALIDATE_IP],
|
'-S' => ['filter' => FILTER_VALIDATE_IP],
|
||||||
'-e' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => '/^[a-z\d]+$/']],
|
'-e' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => '/^[a-z\d]+$/']],
|
||||||
'-g' => FILTER_VALIDATE_INT,
|
'-g' => FILTER_VALIDATE_INT,
|
||||||
'--source-port' => FILTER_VALIDATE_INT,
|
'--source-port' => FILTER_VALIDATE_INT,
|
||||||
'--data-length' => FILTER_VALIDATE_INT,
|
'--data-length' => FILTER_VALIDATE_INT,
|
||||||
'--ip-options' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => '/^\"(R|T|U|L [\da-zA-Z-.: ]+|S [\da-zA-Z-.: ]+|\\\\x[\da-fA-F]{1,2}(\*[\d]+)?|\\\\[0-2]?[\d]{1,2}(\*[\d]+)?)\"$/']],
|
'--ip-options' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => '/^\"(R|T|U|L [\da-zA-Z-.: ]+|S [\da-zA-Z-.: ]+|\\\\x[\da-fA-F]{1,2}(\*[\d]+)?|\\\\[0-2]?[\d]{1,2}(\*[\d]+)?)\"$/']],
|
||||||
'--ttl' => ['filter' => FILTER_VALIDATE_INT, 'options' => ['min_range' => 0, 'max_range' => 255]],
|
'--ttl' => ['filter' => FILTER_VALIDATE_INT, 'options' => ['min_range' => 0, 'max_range' => 255]],
|
||||||
'--spoof-mac' => FILTER_VALIDATE_MAC,
|
'--spoof-mac' => FILTER_VALIDATE_MAC,
|
||||||
'--badsum' => FILTER_VALIDATE_BOOLEAN,
|
'--badsum' => FILTER_VALIDATE_BOOLEAN,
|
||||||
// MISC:
|
// MISC:
|
||||||
// '6' => FILTER_VALIDATE_BOOLEAN,
|
// '6' => FILTER_VALIDATE_BOOLEAN,
|
||||||
'-A' => FILTER_VALIDATE_BOOLEAN,
|
'-A' => FILTER_VALIDATE_BOOLEAN,
|
||||||
'--send-eth' => FILTER_VALIDATE_BOOLEAN,
|
'--send-eth' => FILTER_VALIDATE_BOOLEAN,
|
||||||
'--privileged' => FILTER_VALIDATE_BOOLEAN,
|
'--privileged' => FILTER_VALIDATE_BOOLEAN,
|
||||||
'-V' => FILTER_VALIDATE_BOOLEAN,
|
'-V' => FILTER_VALIDATE_BOOLEAN,
|
||||||
'--unprivileged' => FILTER_VALIDATE_BOOLEAN,
|
'--unprivileged' => FILTER_VALIDATE_BOOLEAN,
|
||||||
'-h' => FILTER_VALIDATE_BOOLEAN,
|
'-h' => FILTER_VALIDATE_BOOLEAN,
|
||||||
'--stylesheet' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $fileNameRegex]],
|
'--stylesheet' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $fileNameRegex]],
|
||||||
// lanScan
|
// lanScan
|
||||||
'name' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $fileNameRegex]],
|
'name' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $fileNameRegex]],
|
||||||
'originalURL' => FILTER_VALIDATE_URL,
|
'originalURL' => FILTER_VALIDATE_URL,
|
||||||
'refreshPeriod' => ['filter' => FILTER_VALIDATE_INT, 'options' => ['min_range' => 0]],
|
'refreshPeriod' => ['filter' => FILTER_VALIDATE_INT, 'options' => ['min_range' => 0]],
|
||||||
'sudo' => FILTER_VALIDATE_BOOLEAN,
|
'sudo' => FILTER_VALIDATE_BOOLEAN,
|
||||||
], false);
|
], false);
|
||||||
|
|
||||||
$options = "";
|
$options = "";
|
||||||
@ -138,23 +138,26 @@ if ($targets) {
|
|||||||
if ($value === true) {
|
if ($value === true) {
|
||||||
$options .= " $option";
|
$options .= " $option";
|
||||||
} else {
|
} else {
|
||||||
if (substr($option, 0, 2) == '--') $options .= " $option " . escapeshellarg($value);
|
if (substr($option, 0, 2) == '--')
|
||||||
else $options .= " $option" . escapeshellarg($value);
|
$options .= " $option " . escapeshellarg($value);
|
||||||
|
else
|
||||||
|
$options .= " $option" . escapeshellarg($value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$cmd = "$NMAP$options $CUSTOMSCANOPTIONS --stylesheet $BASEDIR/$STYLESHEETSDIR/lanScan.xsl?name=$name&' -oX - $targets";
|
$cmd = "$NMAP$options $CUSTOMSCANOPTIONS --stylesheet $BASEDIR/$STYLESHEETSDIR/lanScan.xsl?name=$name' -oX - $targets";
|
||||||
$filename = str_replace("/", "!", $targets);
|
$filename = str_replace("/", "!", $targets);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($cmd) {
|
if ($cmd) {
|
||||||
if ($name) {
|
if ($name) {
|
||||||
if (!file_exists($SCANSDIR)) mkdir($SCANSDIR);
|
if (!file_exists($SCANSDIR))
|
||||||
|
mkdir($SCANSDIR);
|
||||||
|
|
||||||
$path = "$SCANSDIR/$name.xml";
|
$path = "$SCANSDIR/$name.xml";
|
||||||
$cmd .= " | tee " .escapeshellarg($path);
|
$cmd .= " | tee " . escapeshellarg($path);
|
||||||
}
|
}
|
||||||
|
|
||||||
header('Content-type: text/xml');
|
header('Content-type: text/xml');
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
<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="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:template match="nmaprun">
|
||||||
<xsl:variable name="targets" select="substring-after(@args, '-oX - ')" />
|
<xsl:variable name="targets" select="substring-after(@args, '-oX - ')" />
|
||||||
|
@ -7,13 +7,12 @@
|
|||||||
<xsl:import href="services.xsl" />
|
<xsl:import href="services.xsl" />
|
||||||
<xsl:import href="toast.xsl" />
|
<xsl:import href="toast.xsl" />
|
||||||
|
|
||||||
<xsl:output method="html" encoding="UTF-8" />
|
<xsl:output method="html" encoding="UTF-8" indent="yes" escape-uri-attributes="no" />
|
||||||
<xsl:output indent="yes" />
|
|
||||||
<xsl:strip-space elements='*' />
|
<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="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='), '"')" disable-output-escaping="no"/>
|
||||||
|
|
||||||
<xsl:template match="nmaprun">
|
<xsl:template match="nmaprun">
|
||||||
<xsl:variable name="targets" select="substring-after(@args, '-oX - ')" />
|
<xsl:variable name="targets" select="substring-after(@args, '-oX - ')" />
|
||||||
|
@ -7,6 +7,16 @@
|
|||||||
<xsl:template match="runstats">
|
<xsl:template match="runstats">
|
||||||
<xsl:param name="init"/>
|
<xsl:param name="init"/>
|
||||||
<script>
|
<script>
|
||||||
|
<xsl:if test="$init/runstats/finished">
|
||||||
|
$.toast({
|
||||||
|
message : 'Comparaison avec les résultats du ' + new Date("<xsl:value-of select="$init/runstats/finished/@timestr"/>").toLocaleString(),
|
||||||
|
class : 'info',
|
||||||
|
showIcon : 'calendar',
|
||||||
|
displayTime: 0,
|
||||||
|
closeIcon : true,
|
||||||
|
position : 'bottom right',
|
||||||
|
})
|
||||||
|
</xsl:if>
|
||||||
<xsl:if test="finished/@summary">
|
<xsl:if test="finished/@summary">
|
||||||
$.toast({
|
$.toast({
|
||||||
title : '<xsl:value-of select="finished/@exit"/>',
|
title : '<xsl:value-of select="finished/@exit"/>',
|
||||||
@ -26,16 +36,6 @@ $.toast({
|
|||||||
displayTime: 0,
|
displayTime: 0,
|
||||||
closeIcon : true,
|
closeIcon : true,
|
||||||
position : 'bottom right',
|
position : 'bottom right',
|
||||||
})
|
|
||||||
</xsl:if>
|
|
||||||
<xsl:if test="$init/runstats/finished">
|
|
||||||
$.toast({
|
|
||||||
message : 'Comparaison avec les résultats du ' + new Date("<xsl:value-of select="$init/runstats/finished/@timestr"/>").toLocaleString(),
|
|
||||||
class : 'info',
|
|
||||||
showIcon : 'calendar',
|
|
||||||
displayTime: 0,
|
|
||||||
closeIcon : true,
|
|
||||||
position : 'bottom right',
|
|
||||||
})
|
})
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user