This commit is contained in:
Adrien MALINGREY 2023-04-07 13:59:48 +02:00
parent 7b66313c01
commit 24c32fa513
4 changed files with 42 additions and 26 deletions

View File

@ -2,7 +2,17 @@
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 confs/ subdirectory (see example below).
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.
## Example
```yaml
group1:
host1.local: [ssh, http]
host2.local: [ftp, https, 5432]
group2:
host3: [ssh, ftp, 8006]
```

View File

@ -1,5 +0,0 @@
group1:
host1.local: [ssh, http]
host2.local: [ftp, https, 5432]
group2:
host3: [ssh, ftp, 8006]

View File

@ -20,10 +20,20 @@
.ui.mini button > .detail { .ui.mini button > .detail {
margin-left: .1em; margin-left: .1em;
} }
.content { .ui.mini.cards > .card {
width: inherit;
}
.ui.cards > .card > .content {
display: flex; display: flex;
align-items: baseline; align-items: baseline;
gap: .5em; gap: .5em;
padding: .3em;
}
.ui.mini.menu .item {
padding: .6em;
}
.ui.mini.menu {
min-height: 1em;
} }
</style> </style>
<script> <script>
@ -53,7 +63,7 @@
<div class="content"> <div class="content">
<div class="ui green empty circular label"></div> <div class="ui green empty circular label"></div>
<div><?=$scan_host->address["addr"]?></div> <div><?=$scan_host->address["addr"]?></div>
<div class="header" title="<?=strtok($scan_host->hostnames->hostname["name"], ".")?>"><?=strtok($scan_host->hostnames->hostname["name"], ".")?></div> <div class="header" title="<?=$scan_host->hostnames->hostname["name"]?>"><?=strtok($scan_host->hostnames->hostname["name"], ".")?></div>
</div> </div>
<div class="ui inverted primary centered wrapped wrapping bottom attached mini menu"> <div class="ui inverted primary centered wrapped wrapping bottom attached mini menu">
<?php <?php

View File

@ -1,5 +1,6 @@
<?php <?php
mkdir("scans"); if (!file_exists("scans")) mkdir("scans");
foreach (scandir("./confs") 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);