Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
e533139930 | |||
1fa31a296e |
6
CHANGELOG
Normal file
6
CHANGELOG
Normal 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.
|
||||
|
2
help.php
2
help.php
@ -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.
|
||||
|
||||
|
19
hosts_up.css
19
hosts_up.css
@ -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;
|
||||
}
|
||||
|
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>
|
||||
|
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 |
Loading…
x
Reference in New Issue
Block a user