diff --git a/CHANGELOG b/CHANGELOG new file mode 100644 index 0000000..b75d7ab --- /dev/null +++ b/CHANGELOG @@ -0,0 +1,6 @@ +v0.1 - 2014-06-03 + First version of Hosts Up released. + +v0.2 - 2014-06-04 + Added hostnames to Hosts Up and decreased font size a bit. + diff --git a/help.php b/help.php index c1d4b3f..8137cd3 100644 --- a/help.php +++ b/help.php @@ -6,7 +6,7 @@ include ("htmlblock.html");

When entering the Hosts Up webpage it scans the network specified in the index.php file ($network variable) and displays all live hosts. The scan is a -simple ping sweep performed by Nmap. When a host is clicked it is automatically +simple ping sweep performed by Nmap. When a IP-number is clicked it is automatically port scanned and the results show up on the webpage. That's pretty much all there is to it. diff --git a/hosts_up.css b/hosts_up.css index 7b15819..4942b8c 100644 --- a/hosts_up.css +++ b/hosts_up.css @@ -13,7 +13,7 @@ h1 p { font-family:"Arial"; - font-size:22px; + font-size:20px; } p.top diff --git a/index.php b/index.php index a0cfd66..3a70e20 100644 --- a/index.php +++ b/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 "

Hosts that are up

\n"; print "

\n"; -foreach ($out[0] as $i) +$counter = 0; +foreach ($ip[0] as $i) { - print "$i
\n"; + print "$i " . $name["0"]["$counter"] . + "
\n"; + $counter++; } print "

\n"; - ?> - diff --git a/screenshots/index.png b/screenshots/index.png index 8a6b901..9eb430f 100644 Binary files a/screenshots/index.png and b/screenshots/index.png differ diff --git a/screenshots/scan.png b/screenshots/scan.png index ada65b2..eb8a715 100644 Binary files a/screenshots/scan.png and b/screenshots/scan.png differ