$titlecolor = "darkblue"; } elseif (!strcmp($target, "ip_dst") || !strcmp($target, "dst_ip")) { $title = _("TOP ATTACKED"); $sufix = "ed"; $color = "#FAC800"; $titlecolor = "darkred"; } $shared = new DBA_shared(GET('shared')); $SS_Attack = $shared->get("SS_Attack" . $sufix . "Host{$runorder}"); $SA_Attack = $shared->get("SA_Attack" . $sufix . "Host{$runorder}"); if ($type == "event" && is_array($SS_Attack) && count($SS_Attack) > 0) { $list = $SS_Attack; } elseif ($type == "alarm" && is_array($SA_Attack) && count($SA_Attack) > 0) { $list = $SA_Attack; } else { $list = $security_report->AttackHost($target, $limit, $type, $date_from, $date_to); } $datax = $datay = array(); $gorientation = "h"; foreach ($list as $key => $l) { if ($key >= 10) { // ponemos un límite de resultados para la gráfica //break; $gorientation = "v"; } $ip = $l[0]; $occurrences = number_format($l[1], 0, ",", "."); $id = $l[2]; $ctx = $l[3]; $hostname = valid_hex32($id) ? Asset_host::get_name_by_id($security_report->ossim_conn, $id) : $ip; $datax[] = $hostname ? $hostname : $ip;
</tr> </table> </td> </tr> </table> <?php } elseif ($screen == "alarms" && Session::menu_perms("analysis-menu", "ReportsAlarmReport")) { // Alarms report $report_type = "alarm"; $security_report = new Security_report(); $interval = 60 * 60 * 24 * $range; # 1 month $date_from = GET('date_from') != "" ? GET('date_from') : strftime("%Y-%m-%d", time() - $interval); $date_to = GET('date_to') != "" ? GET('date_to') : strftime("%Y-%m-%d", time()); // Attacked host $list1 = $security_report->AttackHost("ip_dst", $NUM_HOSTS, $report_type, $date_from, $date_to); // Attacker host $list2 = $security_report->AttackHost("ip_src", $NUM_HOSTS, $report_type, $date_from, $date_to); // Ports $list3 = $security_report->Ports($NUM_HOSTS, $report_type, $date_from, $date_to); // Events $list4 = $security_report->Events($NUM_HOSTS, $report_type, $date_from, $date_to); ?> <table cellpadding='0' cellspacing='0' border='0' align="center" width='100%'> <tr> <td class="canvas"> <table cellpadding='0' cellspacing='0' border='0' width='100%'> <tr> <td height="3" colspan="11" bgcolor="#A1A1A1"></td> </tr> <tr>