Compare commits
No commits in common. "7b66313c015626c4238f1f6497b79e2008b24095" and "7592b803fb6428d1b5820cc646104cca98ae389f" have entirely different histories.
7b66313c01
...
7592b803fb
6
.gitignore
vendored
6
.gitignore
vendored
@ -1,3 +1,3 @@
|
|||||||
confs/*.yaml
|
scans/*.yaml
|
||||||
!confs/example.yaml
|
!scans/example.yaml
|
||||||
scans/
|
scans/*.xml
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Scan hosts with nmap and display results in webpage.
|
Scan hosts with nmap and display results in webpage.
|
||||||
|
|
||||||
* Create a configuration yaml file in confs/ subdirectory (see example.yaml).
|
* Create a configuration yaml file in scans/ subdirectory (see example.yaml).
|
||||||
It may be generated by scanning a network with `init.sh`.
|
It may be generated by scanning a network with `init.sh`.
|
||||||
* Scan with `php scan_all.php` (use a cron task!).
|
* Scan with `php scan_all.php` (use a cron task!).
|
||||||
* Open index.php to see results.
|
* Open index.php to see results.
|
@ -2,8 +2,8 @@
|
|||||||
$site = filter_input(INPUT_GET, "site", FILTER_SANITIZE_STRING);
|
$site = filter_input(INPUT_GET, "site", FILTER_SANITIZE_STRING);
|
||||||
$site = escapeshellcmd($site);
|
$site = escapeshellcmd($site);
|
||||||
|
|
||||||
if ($site and file_exists("confs/$site.yaml") and file_exists("scans/$site.xml")) {
|
if ($site and file_exists("scans/$site.yaml") and file_exists("scans/$site.xml")) {
|
||||||
$conf = yaml_parse_file("confs/$site.yaml");
|
$conf = yaml_parse_file("scans/$site.yaml");
|
||||||
$scan = simplexml_load_file("scans/$site.xml");
|
$scan = simplexml_load_file("scans/$site.xml");
|
||||||
require("results.php");
|
require("results.php");
|
||||||
} else {
|
} else {
|
||||||
|
4
init.sh
4
init.sh
@ -10,5 +10,5 @@ echo "Nom du site ?"
|
|||||||
read name
|
read name
|
||||||
echo "Plage IP (xxx.xxx.xxx.xxx/xx) ?"
|
echo "Plage IP (xxx.xxx.xxx.xxx/xx) ?"
|
||||||
read network
|
read network
|
||||||
nmap --script smb-enum-shares.nse -oX "confs/$name.xml" $network
|
nmap --script smb-enum-shares.nse -oX "scans/$name.xml" $network
|
||||||
xsltproc toyaml.xsl "confs/$name.xml" > "confs/$name.yaml"
|
xsltproc toyaml.xsl "scans/$name.xml" > "scans/$name.yaml"
|
||||||
|
2
ls.php
2
ls.php
@ -22,7 +22,7 @@
|
|||||||
</header>
|
</header>
|
||||||
<div class="ui main text container">
|
<div class="ui main text container">
|
||||||
<div class="ui link selection list">
|
<div class="ui link selection list">
|
||||||
<?php foreach (scandir("./confs") as $file) {
|
<?php foreach (scandir("./scans") as $file) {
|
||||||
if (strrpos($file, ".yaml")) {
|
if (strrpos($file, ".yaml")) {
|
||||||
$site = str_replace(".yaml", "", $file);
|
$site = str_replace(".yaml", "", $file);
|
||||||
if (file_exists("scans/$site.xml")) {
|
if (file_exists("scans/$site.xml")) {
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
mkdir("scans");
|
foreach (scandir("./scans") as $file) {
|
||||||
foreach (scandir("./confs") as $file) {
|
|
||||||
if (strrpos($file, ".yaml")) {
|
if (strrpos($file, ".yaml")) {
|
||||||
$site = str_replace(".yaml", "", $file);
|
$site = str_replace(".yaml", "", $file);
|
||||||
$conf = yaml_parse_file("confs/$file");
|
$conf = yaml_parse_file("scans/$file");
|
||||||
|
|
||||||
$targets = [];
|
$targets = [];
|
||||||
$services = [];
|
$services = [];
|
||||||
|
19
toxml.php
19
toxml.php
@ -1,19 +0,0 @@
|
|||||||
<?php
|
|
||||||
$yaml = yaml_parse_file($argv[1]);
|
|
||||||
$xml = new SimpleXMLElement("<lanScanConf></lanScanConf>");
|
|
||||||
|
|
||||||
foreach ($yaml as $groupName => $hosts) {
|
|
||||||
$xmlGroup = $xml->addChild("group");
|
|
||||||
$xmlGroup->addAttribute("name", $groupName);
|
|
||||||
if ($hosts) foreach ($hosts as $hostName => $services) {
|
|
||||||
$xmlHost = $xmlGroup->addChild("host");
|
|
||||||
$xmlHost->addAttribute("name", $hostName);
|
|
||||||
if ($services) foreach ($services as $service) {
|
|
||||||
$xmlHost->addChild("service");
|
|
||||||
$xmlHost->addAttribute("name", $service);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
echo $xml->asXML();
|
|
||||||
?>
|
|
Reference in New Issue
Block a user