Compare commits
No commits in common. "baef7123b890e010ce6e6e4547136c01b8dcc17b" and "b55df2e88098b03f1dde62ab7bd74b728a9df9c0" have entirely different histories.
baef7123b8
...
b55df2e880
15
README.md
15
README.md
@ -8,10 +8,10 @@ On peut personnaliser les options prédéfinies pour les scans de réseau ou d'h
|
||||
```php
|
||||
$presets = [
|
||||
"default" => [
|
||||
'-PS' => 'microsoft-ds',
|
||||
'-F' => true,
|
||||
'-T' => 5,
|
||||
'--stylesheet' => "$BASEDIR/templates/hostsTable.xsl",
|
||||
'-PS' => 'microsoft-ds',
|
||||
'-F' => true,
|
||||
'-T5' => true,
|
||||
'--stylesheet' => "$BASEDIR/xslt/hostsTable.xsl",
|
||||
'refreshPeriod' => 60,
|
||||
'sudo' => false,
|
||||
],
|
||||
@ -19,11 +19,10 @@ $presets = [
|
||||
'-Pn' => true,
|
||||
'-F' => true,
|
||||
'-sV' => true,
|
||||
'-T' => 5,
|
||||
'--script' => "http-info,smb-shares-size",
|
||||
'--stylesheet' => "$BASEDIR/templates/servicesTable.xsl",
|
||||
'-T5' => true,
|
||||
'--stylesheet' => "$BASEDIR/xslt/servicesTable.xsl",
|
||||
'refreshPeriod' => 60,
|
||||
'sudo' => true,
|
||||
'sudo' => false,
|
||||
],
|
||||
];
|
||||
```
|
||||
|
@ -10,7 +10,7 @@ $presets = [
|
||||
"default" => [
|
||||
'-PS' => 'microsoft-ds',
|
||||
'-F' => true,
|
||||
'-T' => 5,
|
||||
'-T5' => true,
|
||||
'--stylesheet' => "$BASEDIR/templates/hostsTable.xsl",
|
||||
'refreshPeriod' => 60,
|
||||
'sudo' => false,
|
||||
@ -19,7 +19,7 @@ $presets = [
|
||||
'-Pn' => true,
|
||||
'-F' => true,
|
||||
'-sV' => true,
|
||||
'-T' => 5,
|
||||
'-T5' => true,
|
||||
'--script' => "http-info,smb-shares-size",
|
||||
'--stylesheet' => "$BASEDIR/templates/servicesTable.xsl",
|
||||
'refreshPeriod' => 60,
|
||||
|
@ -73,7 +73,12 @@ if ($preset && isset($presets[$preset])) {
|
||||
'--osscan-guess' => FILTER_VALIDATE_BOOLEAN,
|
||||
'--max-os-tries' => ['filter' => FILTER_VALIDATE_INT, 'options' => ['min_range' => 0]],
|
||||
// TIMING AND PERFORMANCE:
|
||||
'-T' => ['filter' => FILTER_VALIDATE_INT, 'options' => ['min_range' => 0, 'max_range' => 5]],
|
||||
'-T0' => FILTER_VALIDATE_BOOLEAN,
|
||||
'-T1' => FILTER_VALIDATE_BOOLEAN,
|
||||
'-T2' => FILTER_VALIDATE_BOOLEAN,
|
||||
'-T3' => FILTER_VALIDATE_BOOLEAN,
|
||||
'-T4' => FILTER_VALIDATE_BOOLEAN,
|
||||
'-T5' => FILTER_VALIDATE_BOOLEAN,
|
||||
'--min-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]],
|
||||
|
35
index.php
35
index.php
@ -319,11 +319,21 @@ Exemples: <?= $_SERVER['REMOTE_ADDR']; ?>/24 <?= $_SERVER['SERVER_NAME']; ?> 10.
|
||||
<label for="allportsCheckbox" title="--allports">N'exclure aucun port de la détection de version</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="field">
|
||||
<label for="versionIntensityInput" title="--version-intensity">Intensité des tests de version</label>
|
||||
<input type="number" min="0" max="9" id="versionIntensityInput" name="--version-intensity" placeholder="Intensité"
|
||||
value="<?= $options["--version-intensity"] ?? "" ?>" title="2: léger, 9: tous, défaut: 7">
|
||||
<label for="versionIntensitySelect" title="--version-intensity">Intensité des tests de version</label>
|
||||
<select class="ui dropdown" id="versionIntensitySelect" name="--version-intensity" value="<?= $options["--version-intensity"] ?? ""?>">
|
||||
<option value="0">0</option>
|
||||
<option value="1">1</option>
|
||||
<option value="2">2 Léger</option>
|
||||
<option value="3">3</option>
|
||||
<option value="4">4</option>
|
||||
<option value="5">5</option>
|
||||
<option value="6">6</option>
|
||||
<option value="7">7 Défaut</option>
|
||||
<option value="8">8</option>
|
||||
<option value="9">9 Tous</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="inline field">
|
||||
@ -375,27 +385,12 @@ Exemples: <?= $_SERVER['REMOTE_ADDR']; ?>/24 <?= $_SERVER['SERVER_NAME']; ?> 10.
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label for="maxOSTriesInput" title="--max-os-tries">Nombre d'essais maximum</label>
|
||||
<label for="maxOSTriesInput">Nombre d'essais maximum</label>
|
||||
<input type="number" min="0" id="maxOSTriesInput" name="--max-os-tries" placeholder="Nombre d'essais"
|
||||
value="<?= $options["--max-os-tries"] ?? "" ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="title"><i class="icon dropdown"></i>Temporisation et performances</div>
|
||||
<div class="content">
|
||||
<div class="field">
|
||||
<label for="TSelect" title="--T">Intensité des tests de version</label>
|
||||
<select class="ui dropdown" id="TSelect" name="-T" value="<?= $options["-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>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="title"><i class="icon dropdown"></i>Divers</div>
|
||||
<div class="content">
|
||||
<div class="field">
|
||||
|
18
scan.php
18
scan.php
@ -6,19 +6,19 @@ include_once 'filter_inputs.php';
|
||||
if (!file_exists($SCANSDIR)) mkdir($SCANSDIR);
|
||||
|
||||
$command = ($options["sudo"]?? false ? "sudo " : "") . "nmap";
|
||||
foreach ($options as $option => $value) {
|
||||
if (substr($option, 0, 1) == '-') {
|
||||
foreach ($options as $arg => $value) {
|
||||
if (substr($arg, 0, 1) == '-') {
|
||||
if (is_null($value)) {
|
||||
http_response_code(400);
|
||||
$errorMessage = "Valeur incorrecte pour le paramètre <var>$option</var> : " . filter_input(INPUT_GET, $option, FILTER_SANITIZE_FULL_SPECIAL_CHARS);
|
||||
$errorMessage = "Valeur incorrecte pour le paramètre <var>$arg</var> : " . filter_input(INPUT_GET, $arg, FILTER_SANITIZE_FULL_SPECIAL_CHARS);
|
||||
include_once ".";
|
||||
die();
|
||||
} else if ($value) {
|
||||
if ($value === true) {
|
||||
$command .= " $option";
|
||||
$command .= " $arg";
|
||||
} else {
|
||||
if (substr($option, 0, 2) == '--') $command .= " $option " . escapeshellarg($value);
|
||||
else $command .= " $option" . escapeshellarg($value);
|
||||
if (substr($arg, 0, 2) == '--') $command .= " $arg " . escapeshellarg($value);
|
||||
else $command .= " $arg" . escapeshellarg($value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -43,9 +43,9 @@ $xml->load($tempPath);
|
||||
|
||||
$saveAsURL = $options["saveAs"]?? false ? "$BASEDIR/$SCANSDIR/{$options["saveAs"]}.xml" : "";
|
||||
$xml->insertBefore($xml->createProcessingInstruction('xslt-param', "name='savedAs' value='".htmlentities($saveAsURL, ENT_QUOTES)."'"), $xml->documentElement);
|
||||
foreach ($options as $option => $value) {
|
||||
if (substr($option, 0, 1) != '-') {
|
||||
$xml->insertBefore($xml->createProcessingInstruction('xslt-param', "name='$option' value='".htmlentities($value, ENT_QUOTES)."'"), $xml->documentElement);
|
||||
foreach ($options as $arg => $value) {
|
||||
if (substr($arg, 0, 1) != '-') {
|
||||
$xml->insertBefore($xml->createProcessingInstruction('xslt-param', "name='$arg' value='".htmlentities($value, ENT_QUOTES)."'"), $xml->documentElement);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user