diff --git a/README.md b/README.md index 400f181..10105d9 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,3 @@ Pour donner les droits à lanScan sous Linux, installer `sudo` au besoin, puis c ``` www-data ALL = NOPASSWD: /usr/bin/nmap ```` -et modifier le fichier `config.php` avec : -```php -$use_sudo = true; -``` diff --git a/config.php b/config.php index e30194f..3a4bf70 100644 --- a/config.php +++ b/config.php @@ -13,12 +13,10 @@ $HOSTSCAN_OPTIONS = [ 'Pn' => true, 'F' => true, 'sV' => true, + 'T5' => true, 'stylesheet' => "$BASEDIR/hostScan.xsl" ]; -$refreshPeriod = 60; -$use_sudo = false; - $SCANSDIR = 'scans'; $DATADIR = '/usr/share/nmap'; diff --git a/filter_inputs.php b/filter_inputs.php index 72912a0..42cfda4 100644 --- a/filter_inputs.php +++ b/filter_inputs.php @@ -1,5 +1,7 @@ :"\/|?]+$/'; -$targets = filter_input(INPUT_GET, 'targets', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => $targetsListRegex]]); -$lan = filter_input(INPUT_GET, 'lan', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => $targetsListRegex]]); -$host = filter_input(INPUT_GET, 'host', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => $targetsListRegex]]); +$targets = filter_input(INPUT_GET, 'targets', 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]); +$host = filter_input(INPUT_GET, 'host', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => $targetsListRegex], "flags" => FILTER_NULL_ON_FAILURE]); $saveAs = filter_input(INPUT_GET, 'saveAs', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => $fileNameRegex]]); $compareWith = filter_input(INPUT_GET, 'compareWith', FILTER_VALIDATE_URL); -$refreshPeriod = filter_input(INPUT_GET, 'refreshPeriod', FILTER_VALIDATE_INT, ['options' => ['min_range' => 0]]) ?? $refreshPeriod; +$refreshPeriod = filter_input(INPUT_GET, 'refreshPeriod', FILTER_VALIDATE_INT, ['options' => ['min_range' => 0]]); +$sudo = filter_input(INPUT_GET, 'sudo', FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE); if ($lan) { $targets = $lan; diff --git a/options.php b/options.php index e4049c8..5022bf2 100755 --- a/options.php +++ b/options.php @@ -363,6 +363,13 @@ foreach (scandir($SCANSDIR) as $filename) {