Added hostnames and decreased font size a bit
This commit is contained in:
15
index.php
15
index.php
@@ -8,21 +8,26 @@ $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);
|
||||
$ip);
|
||||
|
||||
// Match hostnames (only the host part, up to the first dot)
|
||||
preg_match_all("/(?<=for\s)([a-z]*)/", $hosts, $name);
|
||||
|
||||
|
||||
print "<h1>Hosts that are up</h1>\n";
|
||||
print "<p>\n";
|
||||
|
||||
foreach ($out[0] as $i)
|
||||
$counter = 0;
|
||||
foreach ($ip[0] as $i)
|
||||
{
|
||||
print "<a href=\"scan.php?host=$i\">$i</a> <br />\n";
|
||||
print "<a href=\"scan.php?host=$i\">$i</a> " . $name["0"]["$counter"] .
|
||||
"<br />\n";
|
||||
$counter++;
|
||||
}
|
||||
|
||||
print "</p>\n";
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
Reference in New Issue
Block a user