Minor file structure updates

This commit is contained in:
Russ 2015-08-25 23:37:44 -04:00
parent a7d9b08865
commit b9781ea0b6
10 changed files with 79 additions and 80 deletions

View File

@ -6,7 +6,7 @@
</head>
<body>
<div class=header>
<h2>LiquidWeb Traffic Monitoring</h2>
<h2>Traffic Monitoring</h2>
<h3>Destination IPs by Source</h3>
<?php include("includes/menu.php"); ?>
</div>
@ -16,10 +16,10 @@
<?php
//Include DB connection info
include("includes/db_config.php");
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
//Create dropdown
$query = "SELECT port, svc_name FROM commonports ORDER BY port";
$tbllist = mysqli_query($conn, $query);
@ -30,7 +30,7 @@
$name=$row["svc_name"];
$options.="<option value=\"$id\">$id - $name</option>";
}
//Check Connection
if ($conn->connect_error) {
die("Connection Failed: " . $conn->connect_error);
@ -65,27 +65,27 @@
if(isset($_GET['formIP'])) {
$varIP = filter_var(trim($_GET['formIP']), FILTER_VALIDATE_IP);
}
// Create connection
$conn2 = new mysqli($servername, $username, $password, $dbname);
//Check Connection
if ($conn2->connect_error) {
die("Connection Failed: " . $conn2->connect_error);
}
//Query
$sql = "SELECT src_ip, dst_ip FROM `rawdata` WHERE `src_ip` = '".$varIP."' AND `dst_port` = '".$varPort."' GROUP BY dst_ip ORDER BY dst_ip;";
$result = $conn2->query($sql);
//If there are results of the query, display them.
if ($result->num_rows >0) {
echo "Now viewing data for Destination Port: $varPort";
echo "<table align='center'><tr><th colspan='2'>Source IP: $varIP <a href=http://utilities.mon.liquidweb.com/netdata/whoislookup.php?formIPaddr=".$varIP." target=_blank>Whois</a></tr></th><tr><th>Destination IPs</th><th>Netblock</tr>";
echo "<table align='center'><tr><th colspan='2'>Source IP: $varIP <a href=http://DOMAIN.com/netdata/whoislookup.php?formIPaddr=".$varIP." target=_blank>Whois</a></tr></th><tr><th>Destination IPs</th><th>Netblock</tr>";
while ($row = $result->fetch_assoc()) {
echo "<tr><td>".$row["dst_ip"]."</td><td><a href=https://billing.int.liquidweb.com/mysql/content/admin/netblock/assignment/search.mhtml?customer=".$row["dst_ip"]."&submit=Search target=_blank>Netblock</a></tr>";
echo "<tr><td>".$row["dst_ip"]."</td><td><a href=https://DOMAIN.com/ips/assignment/search.mhtml?customer=".$row["dst_ip"]."&submit=Search target=_blank>Internal IP</a></tr>";
}
echo "</table>";
} else {

View File

@ -12,7 +12,7 @@
</head>
<body>
<div class=header>
<h2>LiquidWeb Traffic Monitoring</h2>
<h2>Traffic Monitoring</h2>
<h3>Inbound Traffic Graphs</h3>
<?php include("includes/menu.php"); ?>
</div>
@ -23,10 +23,10 @@
<?php
//Include DB connection info
include("includes/db_config.php");
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
//Create dropdown
$query = "SELECT port, svc_name FROM commonports ORDER BY port";
$tbllist = mysqli_query($conn, $query);
@ -37,7 +37,7 @@
$name=$row["svc_name"];
$options.="<option value=\"$id\">$id - $name</option>";
}
//Check Connection
if ($conn->connect_error) {
die("Connection Failed: " . $conn->connect_error);

View File

@ -27,7 +27,6 @@
<li><a href="mapping.php">Traffic Map</a></li>
</ul>
</li>
<li><a href="https://noc.liquidweb.com/blackhole/" target="_blank">NOC Nullrouter</a></li>
</ul>
</nav>
</body>

View File

@ -86,7 +86,7 @@
</head>
<body>
<div class=header>
<h2>LiquidWeb Traffic Monitoring</h2>
<h2>Traffic Monitoring</h2>
<?php include("includes/menu.php"); ?>
</div>
<div name=content>
@ -100,11 +100,11 @@
//Set MySQL connection variables
// Create connection
$conn2 = new mysqli($servername, $username, $password, $dbname);
//Query
$sql = "SELECT src_ip, COUNT(DISTINCT(dst_ip)), COUNT(src_ip) FROM `rawdata` WHERE `dst_port` = '22' AND time > (UNIX_TIMESTAMP() - 1800) GROUP BY src_ip ORDER BY COUNT(DISTINCT(dst_ip)) DESC LIMIT 10";
$result = $conn2->query($sql);
//If there are results, display them in a table
if ($result->num_rows >0) {
@ -112,7 +112,7 @@
echo "<br>";
echo "<table align='center'><tr><th>Source IP</th><th># of targets</th><th># of connections</th><th>Source Whois</th><th>Destination IPs</th></tr>";
while ($row = $result->fetch_assoc()) {
echo "<tr><td>".$row["src_ip"]."</td><td>".$row["COUNT(DISTINCT(dst_ip))"]."</td><td>".$row["COUNT(src_ip)"]."</td><td><a href=http://utilities.mon.liquidweb.com/netdata/whoislookup.php?formIPaddr=".$row["src_ip"]." target=_blank>Whois</a></td><td><a href=http://utilities.mon.liquidweb.com/netdata/destinationips.php?formIP=".$row["src_ip"]."&formPort=22 target=_blank>List</a></td></tr>";
echo "<tr><td>".$row["src_ip"]."</td><td>".$row["COUNT(DISTINCT(dst_ip))"]."</td><td>".$row["COUNT(src_ip)"]."</td><td><a href=http://DOMAIN.com/netdata/whoislookup.php?formIPaddr=".$row["src_ip"]." target=_blank>Whois</a></td><td><a href=http://DOMAIN.com/netdata/destinationips.php?formIP=".$row["src_ip"]."&formPort=22 target=_blank>List</a></td></tr>";
}
echo "</table>";
} else {
@ -122,9 +122,9 @@
?>
</div>
<div id=col2>
Total Connections, every 30 minutes for the past 24hrs.
Total Connections, every 30 minutes for the past 24hrs.
<br>
<img src="graph/30min24hr.php?port=22">
<img src="graph/30min24hr.php?port=22">
</div>
<!--Perform the MySQL query to get the source IPs, and geolocate them using the Pear Net::GeoIP class -->

View File

@ -17,13 +17,13 @@
<script type='text/javascript'>
//This javascript will load when the page loads.
jQuery(document).ready( function($){
//Initialize the Google Maps
var geocoder;
var map;
var markersArray = [];
var infos = [];
geocoder = new google.maps.Geocoder();
var myOptions = {
zoom: 2,
@ -33,7 +33,7 @@
//Load the Map into the map_canvas div
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
// map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
var mcOptions = {gridSize: 50, maxZoom: 14};
var mcOptions = {gridSize: 50, maxZoom: 14};
//Initialize a variable that the auto-size the map to whatever you are plotting
var bounds = new google.maps.LatLngBounds();
//Initialize the encoded string
@ -44,7 +44,7 @@
encodedString = document.getElementById("encodedString").value;
//Split the encoded string into an array the separates each location
stringArray = encodedString.split("****");
var x;
for (x = 0; x < stringArray.length; x = x + 1)
{
@ -84,13 +84,13 @@
infos.length = 0;
}
}
});
</script>
</head>
<body>
<div class=header>
<h2>LiquidWeb Traffic Monitoring</h2>
<h2>Traffic Monitoring</h2>
<h3>Source IP Address Mapping</h3>
<?php include("includes/menu.php"); ?>
</div>
@ -101,10 +101,10 @@
<?php
//Include DB Connection Info
include("includes/db_config.php");
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
//Create dropdown
$query = "SELECT port, svc_name FROM commonports ORDER BY port";
$tbllist = mysqli_query($conn, $query);
@ -115,7 +115,7 @@
$name=$row["svc_name"];
$options.="<option value=\"$id\">$id - $name</option>";
}
//Check Connection
if ($conn->connect_error) {
die("Connection Failed: " . $conn->connect_error);
@ -149,23 +149,23 @@
}else{
$varPort = 0;
}
//Connect to DB to pull IPs
// Create connection
$conn1 = new mysqli($servername, $username, $password, $dbname);
//Create dropdown
$query1 = "SELECT src_ip FROM rawdata WHERE `dst_port` = '".$varPort."' AND time > (UNIX_TIMESTAMP() - 900) GROUP BY src_ip";
$iplist = mysqli_query($conn1, $query1);
echo "Now Viewing data for Destination port: $varPort";
//Initialize your first couple variables
$encodedString = ""; //This is the string that will hold all your location data
$x = 0; //This is a trigger to keep the string tidy
//Multiple rows are returned
while ($row = mysqli_fetch_array($iplist))
{

View File

@ -6,7 +6,7 @@
</head>
<body>
<div class=header>
<h2>LiquidWeb Traffic Monitoring</h2>
<h2>Traffic Monitoring</h2>
<h3>Source IP Search</h3>
<?php include("includes/menu.php"); ?>
</div>
@ -16,10 +16,10 @@
<?php
//Include DB Connection Info
include("includes/db_config.php");
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
//Create dropdown
$query = "SELECT port, svc_name FROM commonports ORDER BY port";
$tbllist = mysqli_query($conn, $query);
@ -30,7 +30,7 @@
$name=$row["svc_name"];
$options.="<option value=\"$id\">$id - $name</option>";
}
//Check Connection
if ($conn->connect_error) {
die("Connection Failed: " . $conn->connect_error);
@ -65,27 +65,27 @@
if(isset($_GET['formIP'])) {
$varIP = filter_var(trim($_GET['formIP']), FILTER_VALIDATE_IP);
}
// Create connection
$conn2 = new mysqli($servername, $username, $password, $dbname);
//Check Connection
if ($conn2->connect_error) {
die("Connection Failed: " . $conn2->connect_error);
}
//Query
$sql = "SELECT src_ip, COUNT(DISTINCT(dst_ip)), COUNT(src_ip) FROM `rawdata` WHERE `src_ip` = '".$varIP."' AND `dst_port` = '".$varPort."'";
$result = $conn2->query($sql);
//If there are results, display them in a table
if ($result->num_rows >0) {
echo "Now viewing data for IP: $varIP for Destination Port: $varPort";
echo "<table align='center'><tr><th>Source IP</th><th># of targets</th><th># of connections</th><th>Source Whois</th><th>Destination IPs</th></tr>";
while ($row = $result->fetch_assoc()) {
echo "<tr><td>".$row["src_ip"]."</a></td><td>".$row["COUNT(DISTINCT(dst_ip))"]."</td><td>".$row["COUNT(src_ip)"]."</td><td><a href=http://utilities.mon.liquidweb.com/netdata/whoislookup.php?formIPaddr=".$row["src_ip"]." target=_blank>Whois</a></td><td><a href=http://utilities.mon.liquidweb.com/netdata/destinationips.php?formIP=".$row["src_ip"]."&formPort=$varPort target=_blank>List</a></td></tr>";
echo "<tr><td>".$row["src_ip"]."</a></td><td>".$row["COUNT(DISTINCT(dst_ip))"]."</td><td>".$row["COUNT(src_ip)"]."</td><td><a href=http://DOMAIN.com/netdata/whoislookup.php?formIPaddr=".$row["src_ip"]." target=_blank>Whois</a></td><td><a href=http://DOMAIN.com/netdata/destinationips.php?formIP=".$row["src_ip"]."&formPort=$varPort target=_blank>List</a></td></tr>";
}
echo "</table>";
} else {

View File

@ -6,7 +6,7 @@
</head>
<body>
<div class=header>
<h2>LiquidWeb Traffic Monitoring</h2>
<h2>Traffic Monitoring</h2>
<h3>Source IPs by Destination</h3>
<?php include("includes/menu.php"); ?>
</div>
@ -16,10 +16,10 @@
<?php
//Include DB Connection Info
include("includes/db_config.php");
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
//Create dropdown
$query = "SELECT port, svc_name FROM commonports ORDER BY port";
$tbllist = mysqli_query($conn, $query);
@ -30,7 +30,7 @@
$name=$row["svc_name"];
$options.="<option value=\"$id\">$id - $name</option>";
}
//Check Connection
if ($conn->connect_error) {
die("Connection Failed: " . $conn->connect_error);
@ -65,27 +65,27 @@
if(isset($_GET['formIP'])) {
$varIP = filter_var(trim($_GET['formIP']), FILTER_VALIDATE_IP);
}
// Create connection
$conn2 = new mysqli($servername, $username, $password, $dbname);
//Check Connection
if ($conn2->connect_error) {
die("Connection Failed: " . $conn2->connect_error);
}
//Query
$sql = "SELECT src_ip, dst_ip FROM `rawdata` WHERE `dst_ip` = '".$varIP."' AND `dst_port` = '".$varPort."' AND time > (UNIX_TIMESTAMP() - 86400) GROUP BY src_ip ORDER BY src_ip;";
$result = $conn2->query($sql);
//If there are results of the query, display them.
if ($result->num_rows >0) {
echo "Now viewing data for Destination Port: $varPort";
echo "<table align='center'><tr><th colspan='2'>Destination IP: $varIP <a href=https://billing.int.liquidweb.com/mysql/content/admin/netblock/assignment/search.mhtml?customer=".$varIP."&submit=Search target=_blank>Netblock</a></tr></th><tr><th>Source IPs</th><th>Whois</tr>";
echo "<table align='center'><tr><th colspan='2'>Destination IP: $varIP <a href=https://DOMAIN.com/ips/assignment/search.mhtml?customer=".$varIP."&submit=Search target=_blank>Netblock</a></tr></th><tr><th>Source IPs</th><th>Whois</tr>";
while ($row = $result->fetch_assoc()) {
echo "<tr><td>".$row["src_ip"]."</td><td><a href=http://utilities.mon.liquidweb.com/netdata/whoislookup.php?formIPaddr=".$row["src_ip"]." target=_blank>Whois</a></tr>";
echo "<tr><td>".$row["src_ip"]."</td><td><a href=http://DOMAIN.com/netdata/whoislookup.php?formIPaddr=".$row["src_ip"]." target=_blank>Whois</a></tr>";
}
echo "</table>";
} else {

View File

@ -12,7 +12,7 @@
</head>
<body>
<div class=header>
<h2>LiquidWeb Traffic Monitoring</h2>
<h2>Traffic Monitoring</h2>
<h3>Top Destination IPs</h3>
<?php include("includes/menu.php"); ?>
</div>
@ -24,10 +24,10 @@
<?php
//Include DB Connection Info
include("includes/db_config.php");
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
//Create dropdown
$query = "SELECT port, svc_name FROM commonports ORDER BY port";
$tbllist = mysqli_query($conn, $query);
@ -38,7 +38,7 @@
$name=$row["svc_name"];
$options.="<option value=\"$id\">$id - $name</option>";
}
//Check Connection
if ($conn->connect_error) {
die("Connection Failed: " . $conn->connect_error);
@ -69,11 +69,11 @@
}
// Create connection
$conn2 = new mysqli($servername, $username, $password, $dbname);
//Query
$sql = "SELECT dst_ip, COUNT(DISTINCT(src_ip)), COUNT(dst_ip) FROM `rawdata` WHERE `dst_port` = '".$varPort."' AND time > (UNIX_TIMESTAMP() - 1800) GROUP BY dst_ip ORDER BY COUNT(DISTINCT(src_ip)) DESC LIMIT 50";
$result = $conn2->query($sql);
//If there are results, display them in a table
if ($result->num_rows >0) {
@ -81,7 +81,7 @@
echo "<br>";
echo "<table align='center'><tr><th>Destination IP</th><th># of sources</th><th># of connections</th><th>Destination Netblock</th><th>Source IPs</th></tr>";
while ($row = $result->fetch_assoc()) {
echo "<tr><td>".$row["dst_ip"]."</td><td>".$row["COUNT(DISTINCT(src_ip))"]."</td><td>".$row["COUNT(dst_ip)"]."</td><td><a href=https://billing.int.liquidweb.com/mysql/content/admin/netblock/assignment/search.mhtml?customer=".$row["dst_ip"]."&submit=Search target=_blank>Netblock</a></td><td><a href=http://utilities.mon.liquidweb.com/netdata/sourceips.php?formIP=".$row["dst_ip"]."&formPort=$varPort target=_blank>List</a></td></tr>";
echo "<tr><td>".$row["dst_ip"]."</td><td>".$row["COUNT(DISTINCT(src_ip))"]."</td><td>".$row["COUNT(dst_ip)"]."</td><td><a href=https://DOMAIN.com/ips/assignment/search.mhtml?customer=".$row["dst_ip"]."&submit=Search target=_blank>Netblock</a></td><td><a href=http://DOMAIN.com/netdata/sourceips.php?formIP=".$row["dst_ip"]."&formPort=$varPort target=_blank>List</a></td></tr>";
}
echo "</table>";
} else {

View File

@ -12,7 +12,7 @@
</head>
<body>
<div class=header>
<h2>LiquidWeb Traffic Monitoring</h2>
<h2>Traffic Monitoring</h2>
<h3>Top Source IPs</h3>
<?php include("includes/menu.php"); ?>
</div>
@ -23,10 +23,10 @@
<?php
//Include DB Connection Info
include("includes/db_config.php");
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
//Create dropdown
$query = "SELECT port, svc_name FROM commonports ORDER BY port";
$tbllist = mysqli_query($conn, $query);
@ -37,7 +37,7 @@
$name=$row["svc_name"];
$options.="<option value=\"$id\">$id - $name</option>";
}
//Check Connection
if ($conn->connect_error) {
die("Connection Failed: " . $conn->connect_error);
@ -68,11 +68,11 @@
}
// Create connection
$conn2 = new mysqli($servername, $username, $password, $dbname);
//Query
$sql = "SELECT src_ip, COUNT(DISTINCT(dst_ip)), COUNT(src_ip) FROM `rawdata` WHERE `dst_port` = '".$varPort."' AND time > (UNIX_TIMESTAMP() - 1800) GROUP BY src_ip ORDER BY COUNT(DISTINCT(dst_ip)) DESC LIMIT 50";
$result = $conn2->query($sql);
//If there are results, display them in a table
if ($result->num_rows >0) {
@ -80,7 +80,7 @@
echo "<br>";
echo "<table align='center'><tr><th>Source IP</th><th># of targets</th><th># of connections</th><th>Source Whois</th><th>Destination IPs</th></tr>";
while ($row = $result->fetch_assoc()) {
echo "<tr><td>".$row["src_ip"]."</td><td>".$row["COUNT(DISTINCT(dst_ip))"]."</td><td>".$row["COUNT(src_ip)"]."</td><td><a href=http://utilities.mon.liquidweb.com/netdata/whoislookup.php?formIPaddr=".$row["src_ip"]." target=_blank>Whois</a></td><td><a href=http://utilities.mon.liquidweb.com/netdata/destinationips.php?formIP=".$row["src_ip"]."&formPort=$varPort target=_blank>List</a></td></tr>";
echo "<tr><td>".$row["src_ip"]."</td><td>".$row["COUNT(DISTINCT(dst_ip))"]."</td><td>".$row["COUNT(src_ip)"]."</td><td><a href=http://DOMAIN.com/netdata/whoislookup.php?formIPaddr=".$row["src_ip"]." target=_blank>Whois</a></td><td><a href=http://DOMAIN.com/netdata/destinationips.php?formIP=".$row["src_ip"]."&formPort=$varPort target=_blank>List</a></td></tr>";
}
echo "</table>";
} else {

View File

@ -6,7 +6,7 @@
</head>
<body>
<div class=header>
<h2>LiquidWeb Traffic Monitoring</h2>
<h2>Traffic Monitoring</h2>
<h3>IP WhoIs Lookup</h3>
<?php include("includes/menu.php"); ?>
</div>