Compare commits

..

No commits in common. "master" and "v0.1" have entirely different histories.
master ... v0.1

6 changed files with 15 additions and 27 deletions

View File

@ -1,6 +0,0 @@
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.

View File

@ -6,7 +6,7 @@ include ("htmlblock.html");
<p class="text"> <p class="text">
When entering the Hosts Up webpage it scans the network specified in the 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 index.php file ($network variable) and displays all live hosts. The scan is a
simple ping sweep performed by Nmap. When a IP-number is clicked it is automatically simple ping sweep performed by Nmap. When a host is clicked it is automatically
port scanned and the results show up on the webpage. That's pretty much all port scanned and the results show up on the webpage. That's pretty much all
there is to it. there is to it.

View File

@ -13,7 +13,7 @@ h1
p p
{ {
font-family:"Arial"; font-family:"Arial";
font-size:20px; font-size:22px;
} }
p.top p.top
@ -59,18 +59,17 @@ a:active
#middle #middle
{ {
position: absolute;
left: 35%;
top: 10%;
width:400px; width:400px;
margin: auto margin: 0px
} }
#top #top
{ {
width:400px; position: absolute;
margin: auto left: 35%;
} top: 5%
margin: 0px
hr
{
margin-left:0px;
width:280px;
} }

View File

@ -8,26 +8,21 @@ $hosts = shell_exec("nmap $network -sn");
// Regexp to match any IP-number // 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, preg_match_all("/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/", $hosts,
$ip); $out);
// 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 "<h1>Hosts that are up</h1>\n";
print "<p>\n"; print "<p>\n";
$counter = 0; foreach ($out[0] as $i)
foreach ($ip[0] as $i)
{ {
print "<a href=\"scan.php?host=$i\">$i</a>&emsp;" . $name["0"]["$counter"] . print "<a href=\"scan.php?host=$i\">$i</a> <br />\n";
"<br />\n";
$counter++;
} }
print "</p>\n"; print "</p>\n";
?> ?>
</div> </div>
</body> </body>
</html> </html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 23 KiB