First version of Hosts Up ready and working

This commit is contained in:
2014-06-03 19:11:13 +02:00
parent 2f2e8d9185
commit df0d784126
11 changed files with 206 additions and 60 deletions

28
index.php Normal file
View File

@@ -0,0 +1,28 @@
<?php
include("htmlblock.html");
// Change the network variable to your network
$network = "192.168.0.0/24";
$hosts = shell_exec("nmap $network -sn");
// Regexp to match any IP-number
preg_match_all("/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/", $hosts,
$out);
print "<h1>Hosts that are up</h1>\n";
print "<p>\n";
foreach ($out[0] as $i)
{
print "<a href=\"scan.php?host=$i\">$i</a> <br />\n";
}
print "</p>\n";
?>
</div>
</body>
</html>