@@ -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 "
";
echo "
Source IP | # of targets | # of connections | Source Whois | Destination IPs |
";
while ($row = $result->fetch_assoc()) {
- echo "".$row["src_ip"]." | ".$row["COUNT(DISTINCT(dst_ip))"]." | ".$row["COUNT(src_ip)"]." | Whois | List |
";
+ echo "".$row["src_ip"]." | ".$row["COUNT(DISTINCT(dst_ip))"]." | ".$row["COUNT(src_ip)"]." | Whois | List |
";
}
echo "
";
} else {
@@ -122,9 +122,9 @@
?>
- Total Connections, every 30 minutes for the past 24hrs.
+ Total Connections, every 30 minutes for the past 24hrs.
-
+
diff --git a/webdata/mapping.php b/webdata/mapping.php
index 1f16d77..c984632 100644
--- a/webdata/mapping.php
+++ b/webdata/mapping.php
@@ -17,13 +17,13 @@
@@ -101,10 +101,10 @@
$id - $name";
}
-
+
//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))
{
diff --git a/webdata/search.php b/webdata/search.php
index 179e729..4fa6694 100644
--- a/webdata/search.php
+++ b/webdata/search.php
@@ -6,7 +6,7 @@
@@ -16,10 +16,10 @@
$id - $name";
}
-
+
//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 "