diff --git a/.gitignore b/.gitignore index 9c1bc71..dc49af4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ -scans/*.yaml -!scans/example.yaml -scans/*.xml +confs/*.yaml +!confs/example.yaml +scans/ diff --git a/README.md b/README.md index 09cae68..e4b04a3 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Scan hosts with nmap and display results in webpage. -* Create a configuration yaml file in scans/ subdirectory (see example.yaml). +* Create a configuration yaml file in confs/ subdirectory (see example.yaml). It may be generated by scanning a network with `init.sh`. * Scan with `php scan_all.php` (use a cron task!). * Open index.php to see results. \ No newline at end of file diff --git a/scans/example.yaml b/confs/example.yaml similarity index 100% rename from scans/example.yaml rename to confs/example.yaml diff --git a/index.php b/index.php index 3a736f1..8ae1edf 100644 --- a/index.php +++ b/index.php @@ -2,8 +2,8 @@ $site = filter_input(INPUT_GET, "site", FILTER_SANITIZE_STRING); $site = escapeshellcmd($site); -if ($site and file_exists("scans/$site.yaml") and file_exists("scans/$site.xml")) { - $conf = yaml_parse_file("scans/$site.yaml"); +if ($site and file_exists("confs/$site.yaml") and file_exists("scans/$site.xml")) { + $conf = yaml_parse_file("confs/$site.yaml"); $scan = simplexml_load_file("scans/$site.xml"); require("results.php"); } else { diff --git a/init.sh b/init.sh index 61a45f9..8fef3a0 100644 --- a/init.sh +++ b/init.sh @@ -10,5 +10,5 @@ echo "Nom du site ?" read name echo "Plage IP (xxx.xxx.xxx.xxx/xx) ?" read network -nmap --script smb-enum-shares.nse -oX "scans/$name.xml" $network -xsltproc toyaml.xsl "scans/$name.xml" > "scans/$name.yaml" +nmap --script smb-enum-shares.nse -oX "confs/$name.xml" $network +xsltproc toyaml.xsl "confs/$name.xml" > "confs/$name.yaml" diff --git a/ls.php b/ls.php index ac330b0..bacfd57 100644 --- a/ls.php +++ b/ls.php @@ -22,7 +22,7 @@