Compare commits
2 Commits
b55df2e880
...
baef7123b8
Author | SHA1 | Date | |
---|---|---|---|
baef7123b8 | |||
f14062fda5 |
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
|
```php
|
||||||
$presets = [
|
$presets = [
|
||||||
"default" => [
|
"default" => [
|
||||||
'-PS' => 'microsoft-ds',
|
'-PS' => 'microsoft-ds',
|
||||||
'-F' => true,
|
'-F' => true,
|
||||||
'-T5' => true,
|
'-T' => 5,
|
||||||
'--stylesheet' => "$BASEDIR/xslt/hostsTable.xsl",
|
'--stylesheet' => "$BASEDIR/templates/hostsTable.xsl",
|
||||||
'refreshPeriod' => 60,
|
'refreshPeriod' => 60,
|
||||||
'sudo' => false,
|
'sudo' => false,
|
||||||
],
|
],
|
||||||
@ -19,10 +19,11 @@ $presets = [
|
|||||||
'-Pn' => true,
|
'-Pn' => true,
|
||||||
'-F' => true,
|
'-F' => true,
|
||||||
'-sV' => true,
|
'-sV' => true,
|
||||||
'-T5' => true,
|
'-T' => 5,
|
||||||
'--stylesheet' => "$BASEDIR/xslt/servicesTable.xsl",
|
'--script' => "http-info,smb-shares-size",
|
||||||
|
'--stylesheet' => "$BASEDIR/templates/servicesTable.xsl",
|
||||||
'refreshPeriod' => 60,
|
'refreshPeriod' => 60,
|
||||||
'sudo' => false,
|
'sudo' => true,
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
```
|
```
|
||||||
|
@ -10,7 +10,7 @@ $presets = [
|
|||||||
"default" => [
|
"default" => [
|
||||||
'-PS' => 'microsoft-ds',
|
'-PS' => 'microsoft-ds',
|
||||||
'-F' => true,
|
'-F' => true,
|
||||||
'-T5' => true,
|
'-T' => 5,
|
||||||
'--stylesheet' => "$BASEDIR/templates/hostsTable.xsl",
|
'--stylesheet' => "$BASEDIR/templates/hostsTable.xsl",
|
||||||
'refreshPeriod' => 60,
|
'refreshPeriod' => 60,
|
||||||
'sudo' => false,
|
'sudo' => false,
|
||||||
@ -19,7 +19,7 @@ $presets = [
|
|||||||
'-Pn' => true,
|
'-Pn' => true,
|
||||||
'-F' => true,
|
'-F' => true,
|
||||||
'-sV' => true,
|
'-sV' => true,
|
||||||
'-T5' => true,
|
'-T' => 5,
|
||||||
'--script' => "http-info,smb-shares-size",
|
'--script' => "http-info,smb-shares-size",
|
||||||
'--stylesheet' => "$BASEDIR/templates/servicesTable.xsl",
|
'--stylesheet' => "$BASEDIR/templates/servicesTable.xsl",
|
||||||
'refreshPeriod' => 60,
|
'refreshPeriod' => 60,
|
||||||
|
@ -73,12 +73,7 @@ if ($preset && isset($presets[$preset])) {
|
|||||||
'--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:
|
||||||
'-T0' => FILTER_VALIDATE_BOOLEAN,
|
'-T' => ['filter' => FILTER_VALIDATE_INT, 'options' => ['min_range' => 0, 'max_range' => 5]],
|
||||||
'-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]],
|
'--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]],
|
||||||
|
33
index.php
33
index.php
@ -321,19 +321,9 @@ Exemples: <?= $_SERVER['REMOTE_ADDR']; ?>/24 <?= $_SERVER['SERVER_NAME']; ?> 10.
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label for="versionIntensitySelect" title="--version-intensity">Intensité des tests de version</label>
|
<label for="versionIntensityInput" title="--version-intensity">Intensité des tests de version</label>
|
||||||
<select class="ui dropdown" id="versionIntensitySelect" name="--version-intensity" value="<?= $options["--version-intensity"] ?? ""?>">
|
<input type="number" min="0" max="9" id="versionIntensityInput" name="--version-intensity" placeholder="Intensité"
|
||||||
<option value="0">0</option>
|
value="<?= $options["--version-intensity"] ?? "" ?>" title="2: léger, 9: tous, défaut: 7">
|
||||||
<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>
|
||||||
|
|
||||||
<div class="inline field">
|
<div class="inline field">
|
||||||
@ -385,12 +375,27 @@ Exemples: <?= $_SERVER['REMOTE_ADDR']; ?>/24 <?= $_SERVER['SERVER_NAME']; ?> 10.
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label for="maxOSTriesInput">Nombre d'essais maximum</label>
|
<label for="maxOSTriesInput" title="--max-os-tries">Nombre d'essais maximum</label>
|
||||||
<input type="number" min="0" id="maxOSTriesInput" name="--max-os-tries" placeholder="Nombre d'essais"
|
<input type="number" min="0" id="maxOSTriesInput" name="--max-os-tries" placeholder="Nombre d'essais"
|
||||||
value="<?= $options["--max-os-tries"] ?? "" ?>">
|
value="<?= $options["--max-os-tries"] ?? "" ?>">
|
||||||
</div>
|
</div>
|
||||||
</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="title"><i class="icon dropdown"></i>Divers</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="field">
|
<div class="field">
|
||||||
|
18
scan.php
18
scan.php
@ -6,19 +6,19 @@ include_once 'filter_inputs.php';
|
|||||||
if (!file_exists($SCANSDIR)) mkdir($SCANSDIR);
|
if (!file_exists($SCANSDIR)) mkdir($SCANSDIR);
|
||||||
|
|
||||||
$command = ($options["sudo"]?? false ? "sudo " : "") . "nmap";
|
$command = ($options["sudo"]?? false ? "sudo " : "") . "nmap";
|
||||||
foreach ($options as $arg => $value) {
|
foreach ($options as $option => $value) {
|
||||||
if (substr($arg, 0, 1) == '-') {
|
if (substr($option, 0, 1) == '-') {
|
||||||
if (is_null($value)) {
|
if (is_null($value)) {
|
||||||
http_response_code(400);
|
http_response_code(400);
|
||||||
$errorMessage = "Valeur incorrecte pour le paramètre <var>$arg</var> : " . filter_input(INPUT_GET, $arg, FILTER_SANITIZE_FULL_SPECIAL_CHARS);
|
$errorMessage = "Valeur incorrecte pour le paramètre <var>$option</var> : " . filter_input(INPUT_GET, $option, FILTER_SANITIZE_FULL_SPECIAL_CHARS);
|
||||||
include_once ".";
|
include_once ".";
|
||||||
die();
|
die();
|
||||||
} else if ($value) {
|
} else if ($value) {
|
||||||
if ($value === true) {
|
if ($value === true) {
|
||||||
$command .= " $arg";
|
$command .= " $option";
|
||||||
} else {
|
} else {
|
||||||
if (substr($arg, 0, 2) == '--') $command .= " $arg " . escapeshellarg($value);
|
if (substr($option, 0, 2) == '--') $command .= " $option " . escapeshellarg($value);
|
||||||
else $command .= " $arg" . escapeshellarg($value);
|
else $command .= " $option" . escapeshellarg($value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -43,9 +43,9 @@ $xml->load($tempPath);
|
|||||||
|
|
||||||
$saveAsURL = $options["saveAs"]?? false ? "$BASEDIR/$SCANSDIR/{$options["saveAs"]}.xml" : "";
|
$saveAsURL = $options["saveAs"]?? false ? "$BASEDIR/$SCANSDIR/{$options["saveAs"]}.xml" : "";
|
||||||
$xml->insertBefore($xml->createProcessingInstruction('xslt-param', "name='savedAs' value='".htmlentities($saveAsURL, ENT_QUOTES)."'"), $xml->documentElement);
|
$xml->insertBefore($xml->createProcessingInstruction('xslt-param', "name='savedAs' value='".htmlentities($saveAsURL, ENT_QUOTES)."'"), $xml->documentElement);
|
||||||
foreach ($options as $arg => $value) {
|
foreach ($options as $option => $value) {
|
||||||
if (substr($arg, 0, 1) != '-') {
|
if (substr($option, 0, 1) != '-') {
|
||||||
$xml->insertBefore($xml->createProcessingInstruction('xslt-param', "name='$arg' value='".htmlentities($value, ENT_QUOTES)."'"), $xml->documentElement);
|
$xml->insertBefore($xml->createProcessingInstruction('xslt-param', "name='$option' value='".htmlentities($value, ENT_QUOTES)."'"), $xml->documentElement);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user