change file extensions

This commit is contained in:
Adrien MALINGREY 2023-05-15 16:15:30 +02:00
parent 0ac085a97e
commit 1046de0b8d
6 changed files with 10 additions and 10 deletions

View File

@ -5,7 +5,7 @@ et affiche le résultat dans une page web.
* Créer un fichier de configuration YAML dans un sous-dossier ./configs/ (voir l'exemple ci-dessous).
Il peut être généré en scannant un réseau avec : `./discover <CIDR>`.
* Scanner avec le script `./scan_all` (utiliser une tâche cron !).
* Scanner avec le script `./scan_all.sh` (utiliser une tâche cron !).
* Voir les résultats en ouvrant `.\index.php` dans le navigateur web.
## Exemple

View File

@ -4,7 +4,7 @@ Scan hosts with `nmap` and display results in webpage.
* Create a configuration yaml file in ./configs/ subdirectory (see example below).
It may be generated by scanning a network with `./discover <CIDR>`.
* Scan with `./scan_all` (use a cron task!).
* Scan with `./scan_all.sh` (use a cron task!).
* Open `.\index.php` in web browser to see results.
## Example

View File

@ -19,7 +19,7 @@ site="${network/\//_}"
mkdir -p "scans"
nmap -F -oX "scans/$site.xml" $network
mkdir -p "configs"
xsltproc --stringparam network "$network" to_config.xsl "scans/$site.xml" > "configs/$site.yaml"
php to_XML.php "configs/$site.yaml" > "site/$site.xml"
xsltproc --stringparam network "$network" to_config.xsl "scans/$site.xml" > "configs/$site.yml"
php to_XML.php "configs/$site.yml" > "site/$site.xml"
popd > /dev/null

4
scan
View File

@ -6,9 +6,9 @@ if [ "$#" -ne 1 ]; then
fi
pushd "$(dirname -- "$0")" > /dev/null
site="$(basename ${1/.yaml/})"
site="$(basename ${1/.yml/})"
php "to_XML.php" "configs/$site.yaml" > "site/$site.xml" \
php "to_XML.php" "configs/$site.yml" > "site/$site.xml" \
&& eval $(xsltproc "nmap_cmd.xsl" "site/$site.xml") \
&& mv "scans/$site.xml.tmp" "scans/$site.xml"

View File

@ -5,11 +5,11 @@ pushd "$(dirname -- $0)" > /dev/null
mkdir -p scans
mkdir -p site
for config in configs/*.yaml
for config in configs/*.yml
do
site="$(basename ${config/.yaml/})"
site="$(basename ${config/.yml/})"
echo "Scan $site"
./scan "$site"
./scan.sh "$site"
done
popd > /dev/null

View File

@ -1,6 +1,6 @@
<?php
$file = $argv[1];
$site = basename($file, ".yaml");
$site = basename($file, ".yml");
$__DIR__ = __DIR__;
$conf = yaml_parse_file($file);