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

@ -8,23 +8,33 @@
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/fomantic-ui@2.9.2/dist/semantic.min.css"> <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/fomantic-ui@2.9.2/dist/semantic.min.css">
<script src="https://cdn.jsdelivr.net/npm/fomantic-ui@2.9.2/dist/semantic.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/fomantic-ui@2.9.2/dist/semantic.min.js"></script>
<style> <style>
#logo { #logo {
margin: 0 -.4rem 0 0; margin: 0 -.4rem 0 0;
} }
.main.container { .main.container {
margin-top: 5em; margin-top: 5em;
} }
.ui.dropdown, .ui.dropdown .menu > .item { .ui.dropdown, .ui.dropdown .menu > .item {
font-size: .85714286rem; font-size: .85714286rem;
} }
.ui.mini button > .detail { .ui.mini button > .detail {
margin-left: .1em; margin-left: .1em;
} }
.content { .ui.mini.cards > .card {
display: flex; width: inherit;
align-items: baseline; }
gap: .5em; .ui.cards > .card > .content {
} display: flex;
align-items: baseline;
gap: .5em;
padding: .3em;
}
.ui.mini.menu .item {
padding: .6em;
}
.ui.mini.menu {
min-height: 1em;
}
</style> </style>
<script> <script>
onload = function (event) { onload = function (event) {
@ -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);