diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..c6535a6 --- /dev/null +++ b/LICENSE @@ -0,0 +1,17 @@ +Copyright (C) 2014 Jack-Benny Persson + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + diff --git a/README.md b/README.md new file mode 100644 index 0000000..d4cb2bb --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ +# Hosts Up # +Hosts Up is a collection of small PHP scripts and HTML documents I've made to +help me keep track of live hosts on my network at home and at work. Each time +the webpage is refreshed a new ping sweep on the network is performed. To see +which ports are open one can just click on a host and another script fires up an +Nmap scan of the host. The result is showed on the webpage. Both the ping sweep +and scans are using Nmap. Hence Nmap is required aswell as PHP's ability to +exeucte Nmap. + +## Some screenshots ## +![alt text](screenshots/index.png "Hosts Up index page") + +![alt text](screenshots/scan.png "Hosts Up scan page") + diff --git a/about.php b/about.php new file mode 100644 index 0000000..1ad2ea4 --- /dev/null +++ b/about.php @@ -0,0 +1,17 @@ + + +

About

+

+Hosts Up is a small collection of PHP scripts and HTML documents +I've made to simplify the task of keeping track of live hosts on +my network. It's nothing fancy or anything but it fulfills it purpose. +Hosts Up requires Nmap and that PHP is allowed to run the Nmap program +on the server it's being executed on. It's Nmap that takes care of the +pinging and port scanning of hosts. + +

+ + + diff --git a/help.php b/help.php new file mode 100644 index 0000000..c1d4b3f --- /dev/null +++ b/help.php @@ -0,0 +1,16 @@ + + +

Help

+

+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 +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 07157f3..7b15819 100644 --- a/hosts_up.css +++ b/hosts_up.css @@ -1,22 +1,75 @@ body { -background-color:#bababa; -} -h1 -{ -color:#28699b; -font-family:"Arial"; -text-align:left; -} -p -{ -font-family:"Arial"; -font-size:24px; + background-color:#bababa; } -#middle { +h1 +{ + color:#28699b; + font-family:"Arial"; + text-align:left; +} + +p +{ + font-family:"Arial"; + font-size:22px; +} + +p.top +{ + font-family:"Arial"; + font-size:18px; +} + +p.text +{ + font-family:"Arial"; + font-size:16px; +} + +pre +{ + font-size:18px; +} + +a:link +{ + text-decoration:none; + color:#000000; +} + +a:visited +{ + text-decoration:none; + color:#000000; +} + +a:hover +{ + text-decoration:underline; + color:#000000; +} + +a:active +{ + text-decoration:none; + color:#000000; +} + +#middle +{ position: absolute; - left: 40%; + left: 35%; top: 10%; + width:400px; + margin: 0px +} + +#top +{ + position: absolute; + left: 35%; + top: 5% margin: 0px } diff --git a/hosts_up.php b/hosts_up.php deleted file mode 100644 index ce39675..0000000 --- a/hosts_up.php +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - -HostsUp - - - - -
- -Hosts that are up\n"; -print "

\n"; - -foreach ($out[0] as $i) -{ - print $i . "
\n"; -} - -print "

\n"; - -?> - -
- - - diff --git a/htmlblock.html b/htmlblock.html new file mode 100644 index 0000000..8755749 --- /dev/null +++ b/htmlblock.html @@ -0,0 +1,25 @@ + + + + + + + + + +Hosts Up + + + + +
+

+Hosts Up | Help +| About | Copyright +

+
+ +
+
+ diff --git a/index.php b/index.php new file mode 100644 index 0000000..a0cfd66 --- /dev/null +++ b/index.php @@ -0,0 +1,28 @@ +Hosts that are up\n"; +print "

\n"; + +foreach ($out[0] as $i) +{ + print "$i
\n"; +} + +print "

\n"; + +?> + +
+ + + diff --git a/scan.php b/scan.php new file mode 100644 index 0000000..2e98572 --- /dev/null +++ b/scan.php @@ -0,0 +1,22 @@ +Open ports on $_GET[host]\n"; +print "
\n";
+
+$portscan = shell_exec("nmap $_GET[host]");
+preg_match_all('/[0-9]{1,5}\/..p.*/', $portscan, $openports);
+
+foreach ($openports[0] as $out)
+{
+    print "$out\n";
+}
+
+
+?>
+
+
+ + + + diff --git a/screenshots/index.png b/screenshots/index.png new file mode 100644 index 0000000..8a6b901 Binary files /dev/null and b/screenshots/index.png differ diff --git a/screenshots/scan.png b/screenshots/scan.png new file mode 100644 index 0000000..ada65b2 Binary files /dev/null and b/screenshots/scan.png differ