Location: PHPKode > projects > Cancerbero - The watchdog of the ports > cancerbero-0.6/site/snapshots.php
<?php

include_once("include/dbconnect.php");
include_once("include/functions.php");
include_once("menu.html");

$config = new ReadConfig;
$general = $config->General('gui_debug');
if ($general['gui_debug'] == 1) {
	echo "<div align='center' class='orange'><h2><blink>Debug mode activated</blink></h2></div>";
}

$snap = $_GET['snap'];


switch($snap)
{

case "last10":

	$query = "SELECT h.host_id,DATE(FROM_UNIXTIME(d_last_scan)) as Date,TIME(FROM_UNIXTIME(d_last_scan)) as Time,hostname as Hostname,ip as Ip,open_ports as Ports,CONCAT_WS(' - ',os_guessed, os_gen) AS OS from hosts h, scans s WHERE h.host_id = s.host_id ORDER BY scan_rec_id DESC LIMIT 10";
	$title="<h1>Last 10 IPs Scanned Info</h1>";
	draw_table ($title, $query, 800);

	break;

case "today":

	$query = "SELECT h.host_id,DATE(FROM_UNIXTIME(d_last_scan)) as Date,TIME(FROM_UNIXTIME(d_last_scan)) as Time,hostname as Hostname,ip as Ip,open_ports as Ports,CONCAT_WS(' - ',os_guessed, os_gen) AS OS from hosts h, scans s WHERE h.host_id = s.host_id and (DATE(FROM_UNIXTIME(d_scan)) = CURDATE())";

	$date = date('l dS \of F Y');
	$title="<h1>IPs Scanned Today: $date</h1>";
	draw_table ($title,$query, 800);


	break;

case "last24h":

	$query = "SELECT  h.host_id,DATE(FROM_UNIXTIME(d_last_scan)) as Date,TIME(FROM_UNIXTIME(d_last_scan)) as Time,hostname as Hostname,ip as Ip,open_ports as Ports,CONCAT_WS(' - ',os_guessed, os_gen) AS OS from hosts h, scans s WHERE h.host_id = s.host_id  and (DATE(FROM_UNIXTIME(d_scan)) >= date_sub(curdate(), interval 24 hour)) order by scan_rec_id desc";

	$title="<h1>IPs Scanned in last 24h</h1>";
	draw_table ($title,$query, 800);

	break;

case "last72h":

	$query = "SELECT h.host_id,DATE(FROM_UNIXTIME(d_last_scan)) as Date,TIME(FROM_UNIXTIME(d_last_scan)) as Time,hostname as Hostname,ip as Ip,open_ports as Ports,CONCAT_WS(' - ',os_guessed, os_gen) AS OS from hosts h, scans s WHERE h.host_id = s.host_id and (DATE(FROM_UNIXTIME(d_scan)) >= date_sub(curdate(), interval 72 hour)) order by scan_rec_id desc";

	$title="<h1>IPs Scanned in last 72h</h1>";
        draw_table ($title,$query, 800);

	break;

case "nodns":

	$query = "select h.host_id,ip as Ip,DATE(FROM_UNIXTIME(d_last_scan)) as 'Last Scan',open_ports as 'Open Ports', ping as 'Pings Failed' from hosts h,scans s where h.host_id=s.host_id and h.d_last_scan = s.d_scan and hostname = 'NO DNS' and d_last_scan != 0 order by ip";

	$title="<h1>NO DNS machines</h1>";
	draw_table ($title,$query, 800);

	break;

default:
	echo "<div class='row'>";
	echo "	<h1>Parameter error</h1>";
	echo "</div>";
	break;
}
?>

<div class="row">
		&nbsp;
</div>

</div>
</div>
</body>
</html>
Return current item: Cancerbero - The watchdog of the ports