Compare commits

...

2 Commits
v0.1 ... master

Author SHA1 Message Date
e533139930 Some CSS changes 2014-06-23 18:07:55 +02:00
1fa31a296e Added hostnames and decreased font size a bit 2014-06-04 13:36:42 +02:00
6 changed files with 27 additions and 15 deletions

6
CHANGELOG Normal file
View File

@ -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.

View File

@ -6,7 +6,7 @@ include ("htmlblock.html");
<p class="text">
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.

View File

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

View File

@ -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>&emsp;" . $name["0"]["$counter"] .
"<br />\n";
$counter++;
}
print "</p>\n";
?>
</div>
</body>
</html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 25 KiB