preset
This commit is contained in:
parent
ee532e1329
commit
6d94778307
20
config.php
20
config.php
@ -9,4 +9,22 @@ $DATADIR = ".";
|
|||||||
$SCRIPTARGSFILE = "script-args.ini";
|
$SCRIPTARGSFILE = "script-args.ini";
|
||||||
$LANSCANOPTIONS = "-PSmicrosoft-ds -F -T5 --datadir '$DATADIR' --script http-info,smb-shares-size --script-args-file '$SCRIPTARGSFILE'";
|
$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'";
|
$HOSTSCANOPTIONS = "-A -T5 --datadir '$DATADIR' --script http-info,smb-shares-size --script-args-file '$SCRIPTARGSFILE'";
|
||||||
$COMMONOPTIONS = "--datadir '$DATADIR' --script-args-file '$SCRIPTARGSFILE'";
|
$COMMONOPTIONS = [
|
||||||
|
"--datadir" => $DATADIR,
|
||||||
|
"--script-args-file" => $SCRIPTARGSFILE,
|
||||||
|
];
|
||||||
|
$PRESETS = [
|
||||||
|
"lanScan" => [
|
||||||
|
"-PS" => "microsoft-ds",
|
||||||
|
"-F" => true,
|
||||||
|
"-T" => 5,
|
||||||
|
"--script" => "http-info,smb-shares-size",
|
||||||
|
"--stylesheet" => "lanTable.xsl",
|
||||||
|
],
|
||||||
|
"host" => [
|
||||||
|
"-A" => true,
|
||||||
|
"-T" => 5,
|
||||||
|
"--script" => "http-info,smb-shares-size",
|
||||||
|
"--stylesheet" => "hostDetails.xsl",
|
||||||
|
],
|
||||||
|
];
|
11
index.php
11
index.php
@ -27,10 +27,6 @@
|
|||||||
background: #1b1c1dc0;
|
background: #1b1c1dc0;
|
||||||
backdrop-filter: blur(7px);
|
backdrop-filter: blur(7px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.logo {
|
|
||||||
margin-right: 0 !important;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
@ -55,11 +51,12 @@
|
|||||||
<h4 class="ui header">Découvrir ou superviser un réseau</h4>
|
<h4 class="ui header">Découvrir ou superviser un réseau</h4>
|
||||||
<div class="inverted field">
|
<div class="inverted field">
|
||||||
<div class="ui large input">
|
<div class="ui large input">
|
||||||
<input id="nameInput" type="text" name="lan" placeholder="<?= $_SERVER['REMOTE_ADDR']; ?>"
|
<input id="nameInput" type="text" name="target" placeholder="<?= $_SERVER['REMOTE_ADDR']; ?>"
|
||||||
list="targetsList" pattern="[a-zA-Z0-9._\/ \-]+" required title="Les cibles peuvent être spécifiées par des noms d'hôtes, des adresses IP, des adresses de réseaux, etc.
|
list="targetList" pattern="[a-zA-Z0-9._\/ \-]+" required 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" />
|
Exemples: <?= $_SERVER['REMOTE_ADDR']; ?>/24 <?= $_SERVER['SERVER_NAME']; ?> 10.0-255.0-255.1-254" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<input type="hidden" name="preset" value="lanScan" />
|
||||||
<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">
|
||||||
@ -100,7 +97,7 @@ Exemples: <?= $_SERVER['REMOTE_ADDR']; ?>/24 <?= $_SERVER['SERVER_NAME']; ?> 10.
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<datalist id='targetsList'>
|
<datalist id='targetList'>
|
||||||
<option value="<?= $_SERVER['REMOTE_ADDR']; ?>/24"></option>
|
<option value="<?= $_SERVER['REMOTE_ADDR']; ?>/24"></option>
|
||||||
<option value="<?= $_SERVER['SERVER_NAME']; ?>"></option>
|
<option value="<?= $_SERVER['SERVER_NAME']; ?>"></option>
|
||||||
</datalist>
|
</datalist>
|
||||||
|
84
options.php
84
options.php
@ -25,7 +25,8 @@
|
|||||||
<a class="ui icon button item" href="https://nmap.org/man/fr/index.html" target="_blank">
|
<a class="ui icon button item" href="https://nmap.org/man/fr/index.html" target="_blank">
|
||||||
<i class="question circle icon"></i>
|
<i class="question circle icon"></i>
|
||||||
</a>
|
</a>
|
||||||
<button id="toggleThemeButton" type="button" class="ui icon link item" title="Thème clair/sombre" onclick="toggleTheme()">
|
<button id="toggleThemeButton" type="button" class="ui icon link item" title="Thème clair/sombre"
|
||||||
|
onclick="toggleTheme()">
|
||||||
<i class="sun icon"></i>
|
<i class="sun icon"></i>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@ -38,10 +39,10 @@
|
|||||||
|
|
||||||
<form id="newScanForm" class="ui inverted form" method="get" action="scan.php">
|
<form id="newScanForm" class="ui inverted form" method="get" action="scan.php">
|
||||||
<div class="inverted field">
|
<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.
|
<label for="targetInput" 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>
|
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"
|
<input id="targetInput" type="text" name="target" placeholder="Cibles" spellcheck="false"
|
||||||
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.
|
pattern="[a-zA-Z0-9._\/ \-]+" list="targetList" 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" />
|
Exemples: <?= $_SERVER['REMOTE_ADDR']; ?>/24 <?= $_SERVER['SERVER_NAME']; ?> 10.0-255.0-255.1-254" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -50,7 +51,7 @@ Exemples: <?= $_SERVER['REMOTE_ADDR']; ?>/24 <?= $_SERVER['SERVER_NAME']; ?> 10.
|
|||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="inverted field">
|
<div class="inverted field">
|
||||||
<label for="excludeInput" title="--exclude">Exclure les hôtes ou réseaux</label>
|
<label for="excludeInput" title="--exclude">Exclure les hôtes ou réseaux</label>
|
||||||
<input id="excludeInput" type="text" name="--exclude" placeholder="Hôte/réseau" list="targetsList"
|
<input id="excludeInput" type="text" name="--exclude" placeholder="Hôte/réseau" list="targetList"
|
||||||
pattern="[a-zA-Z0-9._\/,\-]*">
|
pattern="[a-zA-Z0-9._\/,\-]*">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -384,12 +385,12 @@ Exemples: <?= $_SERVER['REMOTE_ADDR']; ?>/24 <?= $_SERVER['SERVER_NAME']; ?> 10.
|
|||||||
<div class="title"><i class="icon dropdown"></i>Temporisation et performances</div>
|
<div class="title"><i class="icon dropdown"></i>Temporisation et performances</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="inverted field">
|
<div class="inverted field">
|
||||||
<label for="TSelect" title="--T">Intensité des tests de version</label>
|
<label for="TSelect" title="-T">Intensité des tests de version</label>
|
||||||
<select id="TSelect" class="ui clearable dropdown" name="-T">
|
<select id="TSelect" class="ui clearable dropdown" name="-T">
|
||||||
<option>Paranoïaque</option>
|
<option>Paranoïaque</option>
|
||||||
<option>Sournois</option>
|
<option>Sournois</option>
|
||||||
<option>Poli</option>
|
<option>Poli</option>
|
||||||
<option>Normal</option>
|
<option selected>Normal</option>
|
||||||
<option>Aggressif</option>
|
<option>Aggressif</option>
|
||||||
<option>Dément</option>
|
<option>Dément</option>
|
||||||
</select>
|
</select>
|
||||||
@ -545,67 +546,83 @@ Exemples: <?= $_SERVER['REMOTE_ADDR']; ?>/24 <?= $_SERVER['SERVER_NAME']; ?> 10.
|
|||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="inverted field">
|
<div class="inverted field">
|
||||||
<div class="ui toggle inverted checkbox">
|
<div class="ui toggle inverted checkbox">
|
||||||
<input type="checkbox" id="f" name="-f">
|
<input id="fInput" type="checkbox" name="-f">
|
||||||
<label for="f" title="-f">Fragmentation des paquets</label>
|
<label for="fInput" title="-f">Fragmentation des paquets</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="two inverted fields">
|
<div class="two inverted fields">
|
||||||
<div class="inverted field">
|
<div class="inverted field">
|
||||||
<label for="mtu" title="--mtu">Taille des paquets</label>
|
<label for="mtuInput" title="--mtu">Taille des paquets</label>
|
||||||
<input type="number" id="mtu" name="--mtu" min="0">
|
<input id="mtuInput" type="number" name="--mtu" min="0">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="inverted field">
|
<div class="inverted field">
|
||||||
<label for="d" title="-d">Délai entre les paquets</label>
|
<label for="dInput" title="-d">Délai entre les paquets</label>
|
||||||
<input type="number" id="d" name="-d" min="0">
|
<input id="dInput" type="number" name="-d" min="0">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="inverted field">
|
<div class="inverted field">
|
||||||
<label for="g" title="-g">Port source</label>
|
<label for="gInput" title="-g">Port source</label>
|
||||||
<input type="number" id="g" name="-g" min="0" max="65535">
|
<input id="gInput" type="number" name="-g" min="0" max="65535">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="inverted field">
|
<div class="inverted field">
|
||||||
<label for="data-length" title="--data-length">Longueur des données</label>
|
<label for="dataLengthInput" title="--data-length">Longueur des données</label>
|
||||||
<input type="number" id="data-length" name="--data-length" min="0">
|
<input id="dataLengthInput" type="number" name="--data-length" min="0">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="inverted field">
|
<div class="inverted field">
|
||||||
<label for="D" title="-D">Leurre</label>
|
<label for="DInput" title="-D">Leurre</label>
|
||||||
<input type="text" id="D" name="-D">
|
<input id="DInput" type="text" name="-D">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="inverted field">
|
<div class="inverted field">
|
||||||
<label for="S" title="-S">Usurpation d'adresse IP</label>
|
<label for="SInput" title="-S">Usurpation d'adresse IP</label>
|
||||||
<input type="text" id="S" name="-S">
|
<input id="SInput" type="text" name="-S">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="inverted field">
|
<div class="inverted field">
|
||||||
<label for="ttl" title="--ttl">Valeur TTL</label>
|
<label for="ttlInput" title="--ttl">Valeur TTL</label>
|
||||||
<input type="number" id="ttl" name="--ttl" min="0" max="255">
|
<input id="ttlInput" type="number" name="--ttl" min="0" max="255">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="inverted field">
|
<div class="inverted field">
|
||||||
<label for="scan-delay" title="--scan-delay">Délai entre les scans</label>
|
<label for="scanDelayInput" title="--scan-delay">Délai entre les scans</label>
|
||||||
<input type="number" id="scan-delay" name="--scan-delay" min="0">
|
<input id="scanDelayInput" type="number" name="--scan-delay" min="0">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="inverted field">
|
<div class="inverted field">
|
||||||
<div class="ui checkbox">
|
<div class="ui checkbox">
|
||||||
<input type="checkbox" id="badsum" name="--badsum">
|
<input id="badsumCheckbox" type="checkbox" name="--badsum">
|
||||||
<label for="badsum" title="--badsum">Checksum incorrect</label>
|
<label for="badsumCheckbox" title="--badsum">Checksum incorrect</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="field">
|
||||||
|
<label for="stylesheetSelect" title="--stylesheet">Affichage des résultats</label>
|
||||||
|
<select id="stylesheetSelect" class="ui dropdown" name="--stylesheet" required>
|
||||||
|
<option value='lanTable.xsl' selected>Tableau du réseau</option>
|
||||||
|
<option value='hostDetails.xsl'>Détails de l'hôte</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="field">
|
||||||
|
<label for="nameInput">Enregistrer sous le nom (optionnel)</label>
|
||||||
|
<div class="ui small input">
|
||||||
|
<input id="nameInput" type="text" name="name" placeholder="Reseau local" pattern='[0-9a-zA-Z\-_\. ]+'
|
||||||
|
title="Caractères autorisés: a-z A-Z 0-9 - _ ." />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<button type="submit" class="ui teal submit button">Démarrer</button>
|
<button type="submit" class="ui teal submit button">Démarrer</button>
|
||||||
</form>
|
</form>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
<datalist id='targetsList'>
|
<datalist id='targetList'>
|
||||||
<option value="<?= $_SERVER['REMOTE_ADDR']; ?>/24"></option>
|
<option value="<?= $_SERVER['REMOTE_ADDR']; ?>/24"></option>
|
||||||
<option value="<?= $_SERVER['SERVER_NAME']; ?>"></option>
|
<option value="<?= $_SERVER['SERVER_NAME']; ?>"></option>
|
||||||
<?php
|
<?php
|
||||||
@ -682,6 +699,15 @@ Exemples: <?= $_SERVER['REMOTE_ADDR']; ?>/24 <?= $_SERVER['SERVER_NAME']; ?> 10.
|
|||||||
|
|
||||||
<script src="script.js"></script>
|
<script src="script.js"></script>
|
||||||
<script>
|
<script>
|
||||||
|
class TagsInput extends Tagify {
|
||||||
|
constructor(input, options = {}, delim = ",") {
|
||||||
|
if (!options.delimiters) options.delimiters = " |,"
|
||||||
|
if (!options.originalInputValueFormat) options.originalInputValueFormat = tags => tags.map(tag => tag.value).join(delim)
|
||||||
|
if (input.list) options.whitelist = Array.from(input.list.options).map(option => option.value)
|
||||||
|
super(input, options)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$(".ui.accordion").accordion()
|
$(".ui.accordion").accordion()
|
||||||
|
|
||||||
$(".ui.clearable.dropdown").dropdown({
|
$(".ui.clearable.dropdown").dropdown({
|
||||||
@ -691,7 +717,7 @@ Exemples: <?= $_SERVER['REMOTE_ADDR']; ?>/24 <?= $_SERVER['SERVER_NAME']; ?> 10.
|
|||||||
clearable: false
|
clearable: false
|
||||||
})
|
})
|
||||||
|
|
||||||
new TagsInput(targetsInput, {}, " ")
|
new TagsInput(targetInput, {}, " ")
|
||||||
new TagsInput(excludeInput)
|
new TagsInput(excludeInput)
|
||||||
new TagsInput(PSInput)
|
new TagsInput(PSInput)
|
||||||
new TagsInput(PAInput)
|
new TagsInput(PAInput)
|
||||||
|
38
scan.php
38
scan.php
@ -3,24 +3,15 @@
|
|||||||
include_once 'config.php';
|
include_once 'config.php';
|
||||||
|
|
||||||
$fileNameRegex = '/^[\da-zA-Z-_. ]+$/';
|
$fileNameRegex = '/^[\da-zA-Z-_. ]+$/';
|
||||||
$targetsListRegex = '/^[\da-zA-Z-_. \/]+$/';
|
$targetListRegex = '/^[\da-zA-Z-_. \/]+$/';
|
||||||
|
|
||||||
|
$target = filter_input(INPUT_GET, 'target', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => $targetListRegex], "flags" => FILTER_NULL_ON_FAILURE]);
|
||||||
$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]);
|
$preset = filter_input(INPUT_GET, "preset", FILTER_SANITIZE_FULL_SPECIAL_CHARS);
|
||||||
if ($lan) {
|
if ($preset && isset($PRESETS[$preset])) {
|
||||||
$cmd = "$NMAP $LANSCANOPTIONS $COMMONOPTIONS --stylesheet '$BASEDIR/$STYLESHEETSDIR/lanScan.xsl?name=" . rawurlencode($name) . "' -oX - $lan";
|
$inputs = $PRESETS[$preset];
|
||||||
$filename = str_replace("/", "!", $lan);
|
} else {
|
||||||
}
|
|
||||||
|
|
||||||
$host = filter_input(INPUT_GET, 'host', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => $targetsListRegex], "flags" => FILTER_NULL_ON_FAILURE]);
|
|
||||||
if ($host) {
|
|
||||||
$cmd = "$NMAP $HOSTSCANOPTIONS $COMMONOPTIONS --stylesheet '$BASEDIR/$STYLESHEETSDIR/hostScan.xsl?name=" . rawurlencode($name) . "' -oX - $host";
|
|
||||||
$filename = str_replace("/", "!", $host);
|
|
||||||
}
|
|
||||||
|
|
||||||
$targets = filter_input(INPUT_GET, 'targets', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => $targetsListRegex], "flags" => FILTER_NULL_ON_FAILURE]);
|
|
||||||
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\-]+)*$/';
|
||||||
@ -115,16 +106,15 @@ if ($targets) {
|
|||||||
'-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,
|
|
||||||
'--unprivileged' => FILTER_VALIDATE_BOOLEAN,
|
'--unprivileged' => FILTER_VALIDATE_BOOLEAN,
|
||||||
'-h' => FILTER_VALIDATE_BOOLEAN,
|
|
||||||
'--stylesheet' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $fileNameRegex]],
|
'--stylesheet' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $fileNameRegex]],
|
||||||
// lanScan
|
|
||||||
'name' => ['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => $fileNameRegex]],
|
|
||||||
'originalURL' => FILTER_VALIDATE_URL,
|
|
||||||
'refreshPeriod' => ['filter' => FILTER_VALIDATE_INT, 'options' => ['min_range' => 0]],
|
|
||||||
'sudo' => FILTER_VALIDATE_BOOLEAN,
|
|
||||||
], false);
|
], false);
|
||||||
|
}
|
||||||
|
|
||||||
|
$inputs = array_merge($COMMONOPTIONS, $inputs);
|
||||||
|
|
||||||
|
$inputs['--stylesheet'] = "$BASEDIR/$STYLESHEETSDIR/{$inputs['--stylesheet']}?";
|
||||||
|
if($name) $inputs['--stylesheet'] .= "name=$name";
|
||||||
|
|
||||||
$options = "";
|
$options = "";
|
||||||
foreach ($inputs as $option => $value) {
|
foreach ($inputs as $option => $value) {
|
||||||
@ -147,9 +137,7 @@ if ($targets) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$cmd = "$NMAP$options $COMMONOPTIONS --stylesheet '$BASEDIR/$STYLESHEETSDIR/lanScan.xsl?name" . rawurlencode($name) . "' -oX - $targets";
|
$cmd = "$NMAP$options -oX - $target";
|
||||||
$filename = str_replace("/", "!", $targets);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($cmd) {
|
if ($cmd) {
|
||||||
if ($name) {
|
if ($name) {
|
||||||
|
@ -2,6 +2,10 @@ body.inverted {
|
|||||||
background-color: #1b1c1d;
|
background-color: #1b1c1d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ui.menu .header.item {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.logo {
|
.logo {
|
||||||
display: flex !important;
|
display: flex !important;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
<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="target" select="substring-after(@args, '-oX - ')" />
|
||||||
<xsl:variable name="current" select="." />
|
<xsl:variable name="current" select="." />
|
||||||
<xsl:variable name="init" select="document(concat($base, 'scans/', $name, '.xml'))/nmaprun" />
|
<xsl:variable name="init" select="document(concat($base, 'scans/', $name, '.xml'))/nmaprun" />
|
||||||
|
|
||||||
@ -24,7 +24,7 @@
|
|||||||
<xsl:apply-templates select="." mode="head">
|
<xsl:apply-templates select="." mode="head">
|
||||||
<xsl:with-param name="base" select="$base" />
|
<xsl:with-param name="base" select="$base" />
|
||||||
<xsl:with-param name="name" select="$name" />
|
<xsl:with-param name="name" select="$name" />
|
||||||
<xsl:with-param name="targets" select="$targets" />
|
<xsl:with-param name="target" select="$target" />
|
||||||
</xsl:apply-templates>
|
</xsl:apply-templates>
|
||||||
|
|
||||||
<body class="inverted">
|
<body class="inverted">
|
||||||
@ -133,7 +133,9 @@ $('.ui.dropdown').dropdown()
|
|||||||
</xsl:if>
|
</xsl:if>
|
||||||
<xsl:if test="os/osmatch/@name">
|
<xsl:if test="os/osmatch/@name">
|
||||||
<td>
|
<td>
|
||||||
<abbr title="Confiance : {os/osmatch/@accuracy}%"><xsl:value-of select="os/osmatch/@name" /></abbr>
|
<abbr title="Confiance : {os/osmatch/@accuracy}%">
|
||||||
|
<xsl:value-of select="os/osmatch/@name" />
|
||||||
|
</abbr>
|
||||||
</td>
|
</td>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
<xsl:if test="distance/@value">
|
<xsl:if test="distance/@value">
|
@ -15,7 +15,7 @@
|
|||||||
<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="target" select="substring-after(@args, '-oX - ')" />
|
||||||
<xsl:variable name="current" select="." />
|
<xsl:variable name="current" select="." />
|
||||||
<xsl:variable name="init" select="document(concat($base, 'scans/', $name, '.xml'))/nmaprun" />
|
<xsl:variable name="init" select="document(concat($base, 'scans/', $name, '.xml'))/nmaprun" />
|
||||||
|
|
||||||
@ -23,7 +23,7 @@
|
|||||||
<xsl:apply-templates select="." mode="head">
|
<xsl:apply-templates select="." mode="head">
|
||||||
<xsl:with-param name="base" select="$base" />
|
<xsl:with-param name="base" select="$base" />
|
||||||
<xsl:with-param name="name" select="$name" />
|
<xsl:with-param name="name" select="$name" />
|
||||||
<xsl:with-param name="targets" select="$targets" />
|
<xsl:with-param name="target" select="$target" />
|
||||||
</xsl:apply-templates>
|
</xsl:apply-templates>
|
||||||
|
|
||||||
<body class="inverted">
|
<body class="inverted">
|
||||||
@ -32,16 +32,17 @@
|
|||||||
</xsl:apply-templates>
|
</xsl:apply-templates>
|
||||||
|
|
||||||
<main class="ui main container inverted vertical segment">
|
<main class="ui main container inverted vertical segment">
|
||||||
|
|
||||||
<h1 class="ui header">
|
<h1 class="ui header">
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="$name">
|
<xsl:when test="$name">
|
||||||
<xsl:value-of select="$name" disable-output-escaping="yes" />
|
<xsl:value-of select="$name" disable-output-escaping="yes" />
|
||||||
<div class="sub header">
|
<div class="sub header">
|
||||||
<xsl:value-of select="$targets" />
|
<xsl:value-of select="$target" />
|
||||||
</div>
|
</div>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:otherwise>
|
<xsl:otherwise>
|
||||||
<xsl:value-of select="$targets" />
|
<xsl:value-of select="$target" />
|
||||||
</xsl:otherwise>
|
</xsl:otherwise>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
</h1>
|
</h1>
|
||||||
@ -52,7 +53,9 @@
|
|||||||
<th style="width: min-width">État</th>
|
<th style="width: min-width">État</th>
|
||||||
<th>Adresse IP</th>
|
<th>Adresse IP</th>
|
||||||
<th>Nom</th>
|
<th>Nom</th>
|
||||||
|
<xsl:if test="host/address[@addrtype='mac']/@vendor">
|
||||||
<th>Constructeur</th>
|
<th>Constructeur</th>
|
||||||
|
</xsl:if>
|
||||||
<th class="six wide">Services</th>
|
<th class="six wide">Services</th>
|
||||||
<th style="width: min-width" title="Scan intensif">
|
<th style="width: min-width" title="Scan intensif">
|
||||||
<i class="search plus icon"></i>
|
<i class="search plus icon"></i>
|
||||||
@ -178,8 +181,7 @@ $('.ui.dropdown').dropdown()
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a class="ui mini icon teal icon button" target="_blank" title="Scan intensif">
|
<a class="ui mini icon teal icon button" target="_blank" title="Scan intensif">
|
||||||
<xsl:attribute name="href">scan.php?host=<xsl:value-of select="$hostAddress" />
|
<xsl:attribute name="href">scan.php?target=<xsl:value-of select="$hostAddress" />&preset=host</xsl:attribute>
|
||||||
</xsl:attribute>
|
|
||||||
<i class="search plus icon"></i>
|
<i class="search plus icon"></i>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
@ -5,7 +5,7 @@
|
|||||||
<xsl:template match="nmaprun" mode="head">
|
<xsl:template match="nmaprun" mode="head">
|
||||||
<xsl:param name="base" />
|
<xsl:param name="base" />
|
||||||
<xsl:param name="name" />
|
<xsl:param name="name" />
|
||||||
<xsl:param name="targets" />
|
<xsl:param name="target" />
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
@ -25,18 +25,14 @@
|
|||||||
<xsl:value-of select="$name" />
|
<xsl:value-of select="$name" />
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:otherwise>
|
<xsl:otherwise>
|
||||||
<xsl:value-of select="$targets" />
|
<xsl:value-of select="$target" />
|
||||||
</xsl:otherwise>
|
</xsl:otherwise>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
</title>
|
</title>
|
||||||
<link rel="icon" href="favicon.ico" />
|
<link rel="icon" href="favicon.ico" />
|
||||||
<link rel="stylesheet" type="text/css"
|
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/fomantic-ui@2.9.3/dist/semantic.min.css" />
|
||||||
href="https://cdn.jsdelivr.net/npm/fomantic-ui@2.9.3/dist/semantic.min.css" />
|
<link href="https://cdn.jsdelivr.net/npm/@yaireo/tagify/dist/tagify.css" rel="stylesheet" type="text/css" />
|
||||||
<link href="https://cdn.jsdelivr.net/npm/@yaireo/tagify/dist/tagify.css"
|
<link href="https://cdn.datatables.net/v/se/jszip-3.10.1/dt-2.1.8/b-3.1.2/b-html5-3.1.2/b-print-3.1.2/cr-2.0.4/fc-5.0.3/fh-4.0.1/r-3.0.3/datatables.min.css" rel="stylesheet" />
|
||||||
rel="stylesheet" type="text/css" />
|
|
||||||
<link
|
|
||||||
href="https://cdn.datatables.net/v/se/jszip-3.10.1/dt-2.1.8/b-3.1.2/b-html5-3.1.2/b-print-3.1.2/cr-2.0.4/fc-5.0.3/fh-4.0.1/r-3.0.3/datatables.min.css"
|
|
||||||
rel="stylesheet" />
|
|
||||||
<link rel="stylesheet" type="text/css" href="style.css" />
|
<link rel="stylesheet" type="text/css" href="style.css" />
|
||||||
<script src="https://code.jquery.com/jquery-3.7.1.js"></script>
|
<script src="https://code.jquery.com/jquery-3.7.1.js"></script>
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.9.2/semantic.min.js"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.9.2/semantic.min.js"></script>
|
||||||
@ -44,8 +40,7 @@
|
|||||||
<script src="https://cdn.jsdelivr.net/npm/@yaireo/tagify/dist/tagify.polyfills.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/@yaireo/tagify/dist/tagify.polyfills.min.js"></script>
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
|
||||||
<script
|
<script src="https://cdn.datatables.net/v/se/jszip-3.10.1/dt-2.1.8/b-3.1.2/b-html5-3.1.2/b-print-3.1.2/cr-2.0.4/fc-5.0.3/fh-4.0.1/r-3.0.3/datatables.min.js"></script>
|
||||||
src="https://cdn.datatables.net/v/se/jszip-3.10.1/dt-2.1.8/b-3.1.2/b-html5-3.1.2/b-print-3.1.2/cr-2.0.4/fc-5.0.3/fh-4.0.1/r-3.0.3/datatables.min.js"></script>
|
|
||||||
<script>
|
<script>
|
||||||
DataTable.ext.type.detect.unshift(function (d) {
|
DataTable.ext.type.detect.unshift(function (d) {
|
||||||
return /[\d]+\.[\d]+\.[\d]+\.[\d]+/.test(d)
|
return /[\d]+\.[\d]+\.[\d]+\.[\d]+/.test(d)
|
||||||
|
@ -57,7 +57,7 @@
|
|||||||
<div class="right menu">
|
<div class="right menu">
|
||||||
<div class="ui right aligned category search item">
|
<div class="ui right aligned category search item">
|
||||||
<form id="scanForm" action="scan.php" method="get">
|
<form id="scanForm" action="scan.php" method="get">
|
||||||
<div class="ui inverted icon input" id="targetsInputDiv">
|
<div class="ui inverted icon input" id="targetInputDiv">
|
||||||
<input name="lan" class="prompt" type="text" placeholder="Scanner un réseau" pattern="[a-zA-Z0-9._\/ \-]+" title="Les cibles peuvent être spécifiées par des noms d'hôtes, des adresses IP, des adresses de réseaux, etc.
|
<input name="lan" class="prompt" type="text" placeholder="Scanner un réseau" pattern="[a-zA-Z0-9._\/ \-]+" title="Les cibles peuvent être spécifiées par des noms d'hôtes, des adresses IP, des adresses de réseaux, etc.
|
||||||
Exemples: 192.168.1.0/24 scanme.nmap.org 10.0-255.0-255.1-254" />
|
Exemples: 192.168.1.0/24 scanme.nmap.org 10.0-255.0-255.1-254" />
|
||||||
<i class="satellite dish icon"></i>
|
<i class="satellite dish icon"></i>
|
||||||
@ -81,7 +81,7 @@ Exemples: 192.168.1.0/24 scanme.nmap.org 10.0-255.0-255.1-254" />
|
|||||||
<script>
|
<script>
|
||||||
scanForm.onsubmit = function(event) {
|
scanForm.onsubmit = function(event) {
|
||||||
if (scanForm.checkValidity()) {
|
if (scanForm.checkValidity()) {
|
||||||
targetsInputDiv.classList.add('loading')
|
targetInputDiv.classList.add('loading')
|
||||||
$.toast({
|
$.toast({
|
||||||
title : 'Scan en cours...',
|
title : 'Scan en cours...',
|
||||||
message : 'Merci de patienter',
|
message : 'Merci de patienter',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user