function getPropertyImage($property) { $icons = array("software" => "software", "operating-system" => "host_os", "cpu" => "cpu", "services" => "ports", "memory" => "ram", "department" => "host_group", "macaddress" => "mac", "workgroup" => "net_group", "role" => "server_role", "property" => "notebook", "nagios_ok" => "tick", "nagios_ko" => "cross", "acl" => "acl", "storage" => "storage", "route" => "route"); $property = strtolower($property); $icon = empty($icons[$property]) ? "folder" : $icons[$property]; $icon .= ".png"; if (preg_match("/^OS\\=/i", $property)) { $os_icon = Host_os::get_os_pixmap_nodb($property, "..", true); if ($os_icon != "") { $icon = $os_icon; } } return $icon; }
function jgraph_attack_graph($target, $hosts, $type = "Bar3D", $width = 450, $height = 250) { global $security_report; global $datapath; global $base_dir; if (!strcmp($target, "ip_src")) { if (!($fp = @fopen("{$base_dir}/tmp/ip_src.xml", "w"))) { print "Error: <b>{$datapath}</b> directory must exists and be <br/>\n"; print "writable by the user the webserver runs as"; exit; } } else { if (!($fp = @fopen("{$base_dir}/tmp/ip_dst.xml", "w"))) { print "Error: <b>{$datapath}</b> directory must exists and be <br/>\n"; print "writable by the user the webserver runs as"; exit; } } fwrite($fp, "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" . "<CategoryDataset>\n <Series name=\"{$target}\">\n"); $list = $security_report->AttackHost($target, $hosts); foreach ($list as $l) { $ip = $l[0]; $occurrences = $l[1]; $hostname = Host::ip2hostname($security_report->ossim_conn, $ip); $os_pixmap = Host_os::get_os_pixmap($security_report->ossim_conn, $ip); if (strlen($hostname) > MAX_HOSTNAME_LEN) { $hostname = $ip; } fwrite($fp, " <Item>\n <Key>{$hostname}</Key>\n <Value>{$occurrences}</Value>\n </Item>\n"); } fwrite($fp, " </Series>\n</CategoryDataset>\n\n"); fclose($fp); echo "\n<applet archive=\"../java/jcommon-0.9.5.jar,../java/jfreechart-0.9.20.jar,../java/jossim-graph.jar\" code=\"net.ossim.graph.applet.OssimGraphApplet\" width=\"{$width}\" height=\"{$height}\" alt=\"You should see an applet, not this text.\">\n <param name=\"graphType\" value=\"{$type}\">"; if (!strcmp($target, "ip_src")) { echo " <param name=\"xmlDataUrl\" value=\"{$datapath}/ip_src.xml\">"; } else { echo " <param name=\"xmlDataUrl\" value=\"{$datapath}/ip_dst.xml\">"; } echo "\n <param name=\"alpha\" value=\"0.42f\">\n <param name=\"legend\" value=\"false\">\n <param name=\"tooltips\" value=\"false\">\n <param name=\"orientation\" value=\"HORIZONTAL\">\n</applet>\n"; }
?> </td> <td style="padding-left:3px;padding-right:3px" class="center nobborder"> <?php $acid_link = Util::get_acid_events_link($since, $date, "time_d"); echo "\n <a href=\"{$acid_link}\">\n <font color=\"black\">{$date}</font></a>\n "; ?> </td> <?php $src_link = "../forensics/base_stat_ipaddr.php?clear_allcriteria=1&ip={$src_ip}&hmenu=Forensics&smenu=Forensics"; $dst_link = "../forensics/base_stat_ipaddr.php?clear_allcriteria=1&ip={$dst_ip}&hmenu=Forensics&smenu=Forensics"; $src_name = $no_resolv ? $src_ip : Host::ip2hostname($conn, $src_ip); $dst_name = $no_resolv ? $dst_ip : Host::ip2hostname($conn, $dst_ip); $src_img = Host_os::get_os_pixmap($conn, $src_ip); $dst_img = Host_os::get_os_pixmap($conn, $dst_ip); $src_country = strtolower(geoip_country_code_by_addr($gi, $src_ip)); $src_country_name = geoip_country_name_by_addr($gi, $src_ip); $src_country_img = "<img src=\"/ossim/pixmaps/flags/" . $src_country . ".png\" title=\"" . $src_country_name . "\">"; $dst_country = strtolower(geoip_country_code_by_addr($gi, $dst_ip)); $dst_country_name = geoip_country_name_by_addr($gi, $dst_ip); $dst_country_img = "<img src=\"/ossim/pixmaps/flags/" . $dst_country . ".png\" title=\"" . $dst_country_name . "\">"; ?> <!-- src & dst hosts --> <td nowrap style="text-align:center;padding-left:3px;padding-right:3px" class="nobborder"> <div id="<?php echo $src_ip; ?> ;<?php echo $src_name; ?>
if ($fd = @fopen("{$ntop_link}/{$host}.html", "r")) { while (!feof($fd)) { $line = fgets($fd, 1024); /* * search for Sessions section */ if (eregi(">Active.*Sessions<", $line)) { $found = 1; } /* * begin to print at the begin of <table>... */ if ($found && eregi('<table', $line)) { $show = 1; $hostname = Host::ip2hostname($conn, $host); $os_pixmap = Host_os::get_os_pixmap($conn, $host); if (strcmp($hostname, $host)) { $hostname .= " ({$host})"; } echo "<HTML>\n <HEAD>\n <TITLE> \nEOF; \n echo gettext(\"Active TCP Sessions\");\necho <<<EOF\n </TITLE>\n <LINK REL=stylesheet HREF=\"{$ntop_link}/style.css\" type=\"text/css\">\n </HEAD>\n <BODY BGCOLOR=\"#FFFFFF\" LINK=blue VLINK=blue>\n <H2 align=\"center\">\n <a href=\"../report/index.php?section=usage&host={$host}\">{$hostname}</a>\n {$os_pixmap}\n </H2>\n<CENTER>"; } /* * </table> found, session section finished, stop printing */ if ($found && eregi('</table', $line)) { $show = 0; $found = 0; echo <<<EOF </CENTER> </TABLE> <BR/>
$host_list = Host::get_list($conn, $search, "ORDER BY {$order} {$limit}"); if ($host_list[0]) { $total = $host_list[0]->get_foundrows(); if ($total == 0) { $total = count($host_list); } } else { $total = 0; } $xml .= "<rows>\n"; $xml .= "<page>{$page}</page>\n"; $xml .= "<total>{$total}</total>\n"; foreach ($host_list as $host) { $ip = $host->get_ip(); $xml .= "<row id='{$ip}'>"; $name = $host->get_imgtag() . " <a style='font-weight:bold;' href=\"./modifyhostform.php?ip=" . urlencode($ip) . "\">" . $host->get_hostname() . "</a> " . Host_os::get_os_pixmap($conn, $ip); $xml .= "<cell><![CDATA[" . $name . "]]></cell>"; $xml .= "<cell><![CDATA[" . $ip . "]]></cell>"; $fqdns = $host->get_fqdns(); if ($fqdns == "") { $fqdns = " "; } $xml .= "<cell><![CDATA[" . utf8_encode($fqdns) . "]]></cell>"; $desc = $host->get_descr(); if ($desc == "") { $desc = " "; } $xml .= "<cell><![CDATA[" . utf8_encode($desc) . "]]></cell>"; $xml .= "<cell><![CDATA[" . $host->get_asset() . "]]></cell>"; $sensors = ""; if ($sensor_list = $host->get_sensors($conn)) {
function ip_max_occurrences($target, $date_from, $date_to) { global $NUM_HOSTS; global $security_report; global $report_type; /* ossim framework conf */ $conf = $GLOBALS["CONF"]; $acid_link = $conf->get_conf("acid_link"); $ossim_link = $conf->get_conf("ossim_link"); $acid_prefix = $conf->get_conf("event_viewer"); $report_graph_type = $conf->get_conf("report_graph_type"); if (!strcmp($target, "ip_src")) { if ($report_type == "alarm") { $target = "src_ip"; } $title = _("Attacker hosts"); } elseif (!strcmp($target, "ip_dst")) { if ($report_type == "alarm") { $target = "dst_ip"; } $title = _("Attacked hosts"); } $list = $security_report->AttackHost($security_report->ossim_conn, $target, $NUM_HOSTS, $report_type, $date_from, $date_to); if (count($list) == 0) { echo "<table align='center' class='nobborder'><tr><td class='nobborder'>" . _("No data available") . "</td></tr></table></body></html>"; exit(0); } ?> <table align="center" width="750" cellpadding="0" cellspacing="0" class="noborder"> <tr><td class="headerpr"><?php echo _("Top"); echo " {$NUM_HOSTS} {$title}"; ?> </td></tr> </table> <table align="center" width="750"> <tr><td style="padding-top:15px;" valign="top" class="nobborder"> <table align="center"> <tr> <th> <?php echo gettext("Host"); ?> </th> <th> <?php echo gettext("Occurrences"); ?> </th> </tr> <?php foreach ($list as $l) { $ip = $l[0]; $occurrences = number_format($l[1], 0, ",", "."); $hostname = Host::ip2hostname($security_report->ossim_conn, $ip); $os_pixmap = Host_os::get_os_pixmap($security_report->ossim_conn, $ip); if ($report_type == "alarm") { if ($target == "src_ip") { $link = "{$ossim_link}/control_panel/alarm_console.php?src_ip=" . $ip; } elseif ($target == "dst_ip") { $link = "{$ossim_link}/control_panel/alarm_console.php?dst_ip=" . $ip; } else { $link = "{$ossim_link}/control_panel/alarm_console.php?src_ip=" . $ip . "&dst_ip=" . $ip; } } else { $link = "{$acid_link}/" . $acid_prefix . "_stat_alerts.php?&" . "num_result_rows=-1&" . "submit=Query+DB&" . "current_view=-1&" . "ip_addr[0][1]={$target}&" . "ip_addr[0][2]==&" . "ip_addr[0][3]={$ip}&" . "ip_addr_cnt=1&" . "sort_order=time_d"; } ?> <tr> <td><div id="<?php echo $ip; ?> ;<?php echo $hostname; ?> " class="HostReportMenu" style="display:inline"> <a title="<?php echo $ip; ?> " href="<?php echo $link; ?> "><?php echo $hostname; ?> </a></div> <?php echo $os_pixmap; ?> </td> <td><?php echo $occurrences; ?> </td> </tr> <?php } ?> </table> </td> <td valign="top" class="nobborder"> <?php if ($report_graph_type == "applets") { jgraph_attack_graph($target, $NUM_HOSTS); } else { ?> <img src="graphs/attack_graph.php?target=<?php echo $target; ?> &hosts=<?php echo $NUM_HOSTS; ?> &type=<?php echo $report_type; ?> &date_from=<?php echo urlencode($date_from); ?> &date_to=<?php echo urlencode($date_to); ?> " alt="attack_graph"/> <?php } ?> </td> </tr> </table> <?php }
$s_asset_src = array_key_exists($s_src_ip, $assets) ? $assets[$s_src_ip] : $default_asset; $s_asset_dst = array_key_exists($s_dst_ip, $assets) ? $assets[$s_dst_ip] : $default_asset; /* $s_src_port = Port::port2service($conn, $s_src_port); $s_dst_port = Port::port2service($conn, $s_dst_port); */ $s_src_link = "../report/index.php?host={$s_src_ip}§ion=events"; $src_title = gettext("Src Asset:") . " <b>{$s_asset_src}</b><br>IP: <b>{$s_src_ip}</b>"; $s_dst_link = "../report/index.php?host={$s_dst_ip}§ion=events"; $dst_title = gettext("Dst Asset:") . " <b>{$s_asset_dst}</b><br>IP: <b>{$s_dst_ip}</b>"; $s_src_name = $no_resolv ? $s_src_ip : Host::ip2hostname($conn, $s_src_ip); $s_dst_name = $no_resolv ? $s_dst_ip : Host::ip2hostname($conn, $s_dst_ip); // $s_src_name = $s_src_ip; // $s_dst_name = $s_dst_ip; $s_src_img = str_replace("\"", "'", Host_os::get_os_pixmap($conn, $s_src_ip)); $s_dst_img = str_replace("\"", "'", Host_os::get_os_pixmap($conn, $s_dst_ip)); $src_country = strtolower(geoip_country_code_by_addr($gi, $s_src_ip)); $src_country_img = $src_country ? "<img src='/ossim/pixmaps/flags/" . $src_country . ".png'>" : ""; $dst_country = strtolower(geoip_country_code_by_addr($gi, $s_dst_ip)); $dst_country_img = $dst_country ? "<img src='/ossim/pixmaps/flags/" . $dst_country . ".png'>" : ""; $source_link = "<a href='" . $s_src_link . "' title='" . $s_src_ip . "' >" . $s_src_name . "</a>:" . $s_src_port . " {$s_src_img} {$src_country_img}"; $source_balloon = "<div class='balloon'>" . $source_link . "<span class='tooltip'><span class='top'></span><span class='middle ne11'>{$src_title}</span><span class='bottom'></span></span></div>"; $dest_link = "<a href='" . $s_dst_link . "' title='" . $s_dst_ip . "' >" . $s_dst_name . "</a>:" . $s_dst_port . " {$s_dst_img} {$dst_country_img}"; $dest_balloon = "<div class='balloon'>" . $dest_link . "<span class='tooltip'><span class='top'></span><span class='middle ne11'>{$dst_title}</span><span class='bottom'></span></span></div>"; // $selection_array[$group_id][$child_number] = $s_backlog_id . "-" . $s_event_id; $s_sid_name = ""; if ($s_plugin_sid_list = Plugin_sid::get_list($conn, "WHERE plugin_id = {$s_id} AND sid = {$s_sid}")) { $s_sid_name = $s_plugin_sid_list[0]->get_name(); $s_sid_priority = $s_plugin_sid_list[0]->get_priority(); } else { $s_sid_name = "Unknown (id={$s_id} sid={$s_sid})";
$agentless_list = Agentless::get_list($conn, $extra); if (!empty($agentless_list)) { $key = array_keys($agentless_list); $total = $agentless_list[$key[0]]->get_foundrows(); if ($total == 0) { $total = count($agentless_list); } } else { $total = 0; } $xml .= "<rows>\n"; $xml .= "<page>{$page}</page>\n"; $xml .= "<total>{$total}</total>\n"; foreach ($agentless_list as $host) { $ip = $host->get_ip(); $hostname = "<a style='font-weight:bold;' href='./al_modifyform.php?ip=" . urlencode($ip) . "'>" . $host->get_hostname() . "</a>" . Host_os::get_os_pixmap($conn, $ip); $user = $host->get_user(); if ($host->get_status() == 0) { $status = "<img src='../pixmaps/tables/cross.png' alt='" . _("Disabled") . "' title='" . _("Disabled") . "'/>"; } else { if ($host->get_status() == 1) { $status = "<img src='../pixmaps/tables/tick.png' alt='" . _("Enabled") . "' title='" . _("Enabled") . "'/>"; } else { $status = "<img src='../pixmaps/tables/exclamation.png' alt='" . _("Not configured") . "' title='" . _("Not configured") . "'/>"; } } $desc = $host->get_descr() == '' ? " " : Util::htmlentities($host->get_descr()); $xml .= "<row id='{$ip}'>"; $xml .= "<cell><![CDATA[" . $hostname . "]]></cell>"; $xml .= "<cell><![CDATA[" . $ip . "]]></cell>"; $xml .= "<cell><![CDATA[" . $user . "]]></cell>";
function query_inventory($value) { require_once 'ossim_db.inc'; // Database Object $db = new ossim_db(); $conn = $db->connect(); $date_from = $_SESSION['inventory_search']['date_from'] != "" ? $_SESSION['inventory_search']['date_from'] : "1700-01-01"; $date_to = $_SESSION['inventory_search']['date_to'] != "" ? $_SESSION['inventory_search']['date_to'] : "3000-01-01"; $value = str_replace("/", "\\/", $value); $error = ""; $matches = array(); $ips = array(); // OS $allips = array(); $sql = "SELECT DISTINCT ip FROM host_os"; if (!($rs =& $conn->Execute($sql))) { $error = _("Error in Query: {$sql}"); } else { while (!$rs->EOF) { $allips[] = $rs->fields['ip']; $rs->MoveNext(); } } foreach ($allips as $ip) { /* $anom0os = $anom1os = ""; $sql2 = "SELECT os FROM host_os WHERE os LIKE '%$value%' AND ip=$ip AND anom=0 AND date >= '$date_from' AND date <= '$date_to' ORDER BY date DESC LIMIT 1"; if (!$rs = & $conn->Execute($sql2, $params)) { $error = _("Error in Query: $sql2"); } else { while (!$rs->EOF) { $anom0os = $rs->fields['os']; $rs->MoveNext(); } } $sql2 = "SELECT os FROM host_os WHERE os LIKE '%$value%' AND ip=$ip AND anom=1 AND date >= '$date_from' AND date <= '$date_to' ORDER BY date DESC LIMIT 1"; if (!$rs = & $conn->Execute($sql2, $params)) { $error = _("Error in Query: $sql2"); } else { while (!$rs->EOF) { $anom1os = $rs->fields['os']; $rs->MoveNext(); } } if ($anom0os != "") $matches[$anom0os][] = long2ip($ip); // Add IP to list elseif ($anom1os != "") $matches[$anom1os][] = long2ip($ip); */ $ret = Host_os::get_ip_data($conn, long2ip($ip)); $matches[$ret['os']][] = long2ip($ip); } // Services $allips = array(); $sql = "SELECT DISTINCT ip FROM host_services"; if (!($rs =& $conn->Execute($sql))) { $error = _("Error in Query: {$sql}"); } else { while (!$rs->EOF) { $allips[] = $rs->fields['ip']; $rs->MoveNext(); } } foreach ($allips as $ip) { $anom0serv = $anom1serv = ""; $sql2 = "SELECT service FROM host_services WHERE service LIKE '%{$value}%' AND ip={$ip} AND anom=0 AND date >= '{$date_from}' AND date <= '{$date_to}' ORDER BY date DESC LIMIT 1"; if (!($rs =& $conn->Execute($sql2, $params))) { $error = _("Error in Query: {$sql2}"); } else { while (!$rs->EOF) { $anom0serv = $rs->fields['service']; $rs->MoveNext(); } //if ($ip == 3232235781) return array(1,"matches IP $anom0serv"); } $sql2 = "SELECT service FROM host_services WHERE service LIKE '%{$value}%' AND ip={$ip} AND anom=1 ORDER BY date AND date >= '{$date_from}' AND date <= '{$date_to}' DESC LIMIT 1"; if (!($rs =& $conn->Execute($sql2, $params))) { $error = _("Error in Query: {$sql2}"); } else { while (!$rs->EOF) { $anom1serv = $rs->fields['service']; $rs->MoveNext(); } } if ($anom0serv != "") { $matches[$anom0serv][] = long2ip($ip); } elseif ($anom1serv != "") { $matches[$anom1serv][] = long2ip($ip); } } foreach ($matches as $os_service => $ips_arr) { //echo "found $os_service<br>"; //return array(1,"matches ".implode(",",array_keys($matches))); if (preg_match("/{$value}/i", $os_service)) { $ips = $ips_arr; } } if ($error != "") { return array(1, $error); } else { return array(0, $ips); } }
<tr> <td style="height:106px" align="center"> <div id="graph2" style="text-align:center;margin:0px;height:104px;width:98%"></div> </td> </tr> <script language="javascript" type="text/javascript"> $( function () { $.plot($("#graph2"), [ <?php $i = 0; foreach ($list2 as $l) { $ip = $l[0]; $occurrences = Util::number_format_locale($l[1], 0); $hostname = Host::ip2hostname($conn, $ip); $os_pixmap = Host_os::get_os_pixmap($conn, $ip); $label = str_replace("'", "\\'", "[<b>{$occurrences}</b>] {$hostname} {$os_pixmap}"); //if (strlen($label)>31) $label = substr($label, 0, 30).".."; ?> <?php echo $i++ == 0 ? "" : ","; ?> { label: '<?php echo $label; ?> ', data: <?php echo $l[1]; ?> } <?php }
?> </td> <?php if ($ex_os) { ?> <td colspan="1"> </td> <td colspan="1"> </td> <td colspan="1"> </td> <?php } ?> </tr> <?php if ($ex_os == $anom_os["ip"] && $ex_oss == $anom_os["sensor"]) { if ($anom_os_ip_list = Host_os::get_anom_ip_list($conn, $ex_os, $ex_oss)) { foreach ($anom_os_ip_list as $anom_os_ip) { ?> <tr bgcolor="#EFEFEF"> <td> </td> <td> <A HREF="<?php echo Sensor::get_sensor_link($conn, $anom_os_ip["ip"]) . "/" . $anom_os_ip["ip"] . ".html"; ?> " target="_blank" title="<?php echo $anom_os_ip["ip"]; ?> "> <?php echo Host::ip2hostname($conn, $anom_os_ip["ip"]);
echo $host; ?> </b></td> </tr> <?php if ($os = Host_os::get_ip_data($conn, $host)) { ?> <tr> <th> <?php echo gettext("Operating System"); ?> </th> <td> <?php echo $os["os"]; echo Host_os::get_os_pixmap($conn, $host); ?> </td> </tr> <?php } ?> <?php if ($mac = Host_mac::get_ip_data($conn, $host)) { ?> <tr> <th>MAC</th> <td><?php echo $mac["mac"]; ?>
<th>Ip</th> <td><strong><?php echo $host; ?> </strong></td> </tr> <?php if ($os = Host_os::get_ip_data($conn, $host)) { ?> <tr> <th><?php echo _("OS"); ?> </th> <td><?php echo $os["os"] . Host_os::get_os_pixmap($conn, $host); ?> </td> </tr> <?php } if ($mac = Host_mac::get_ip_data($conn, $host)) { ?> <tr> <th>MAC</th> <td><?php echo $mac["mac"]; ?> </td> </tr> <?php
<!-- C & A levels for each IP --> <tr> <td align="center"> <a href="../report/index.php?host=<?php echo $ip; ?> §ion=metrics" title="<?php echo $ip; ?> "><?php echo $hostname; ?> </a> <?php echo Host_os::get_os_pixmap($conn, $ip); ?> </td> <td align="center"> <a href="<?php echo "../control_panel/show_image.php?range=day&ip={$ip}&what=compromise&start=N-1D&type=host&zoom=1"; ?> " target="main"> <img src="../pixmaps/graph.gif" border="0"/> </a> </td> <td class="left"> <?php if ($compromise <= $threshold_c) { ?> <img src="../pixmaps/solid-blue.jpg" height="12"
$title = Util::htmlentities($title) . " <font style=\"font-weight:normal;font-size:80%\">(" . count($hg) . " " . _("hosts") . ")</font>"; $tooltip = $os; $li = "key:'os_{$os}', url:'OS:{$os}', icon:'{$pix}', isLazy:true, title:'{$title}', tooltip:'{$tooltip}'"; $buffer .= ($j > $from ? "," : "") . "{ {$li} }\n"; } $j++; } if ($j > $to) { $li = "key:'os', page:'{$nextpage}', isFolder:true, isLazy:true, icon:'../../pixmaps/theme/host_os.png', title:'" . _("next") . " {$maxresults} " . _("OS") . "'"; $buffer .= ",{ {$li} }\n"; } $buffer .= "]"; } } else { if (preg_match("/os_(.*)/", $key, $found)) { if ($hg_list = Host_os::get_os_list($conn, $ossim_hosts, $filter)) { $html = ""; $k = 0; $length_hn = 20; $buffer .= "["; foreach ($hg_list[$found[1]] as $ip => $host_name) { if ($k >= $from && $k < $to) { $host_key = utf8_encode($key . $k); $host_name = $host_name == $ip || $host_name == '' ? "" : utf8_encode($host_name); $aux_hname = strlen($host_name) > $length_hn ? substr($host_name, 0, $length_hn) . "..." : $host_name; $title = $host_name == "" ? $ip : "{$ip} <font style=\"font-size:80%\">(" . Util::htmlentities($aux_hname) . ")</font>"; $tooltip = $host_name == "" ? $ip : $ip . " (" . Util::htmlentities($host_name) . ")"; $html .= "{ key:'{$host_key}', url:'{$ip}', icon:'../../pixmaps/theme/host.png', title:'{$title}', tooltip:'{$tooltip}'},\n"; } $k++; }
$scantype = gettext("None"); if ($scan_list = Host_scan::get_list($conn, "WHERE host_ip = inet_aton('{$ip}')")) { $scantype = ""; foreach ($scan_list as $scan) { $id = $scan->get_plugin_id(); $plugin_name = ""; if ($plugin_list = Plugin::get_list($conn, "WHERE id = {$id}")) { $plugin_name .= $plugin_list[0]->get_name(); $scantype .= ucfirst($plugin_name) . "<br>"; } else { $scantype .= "{$id}<BR>"; } } } $xml .= "<cell><![CDATA[" . $scantype . "]]></cell>"; if ($os_data = Host_os::get_ip_data($conn, $host->get_ip())) { $os = $os_data["os"]; $host_os = $os . " " . Host_os::get_os_pixmap_nodb($os); } else { $host_os = ""; } $xml .= "<cell><![CDATA[" . $host_os . "]]></cell>"; $xml .= "</row>\n"; } $xml .= "</rows>\n"; echo $xml; $db->close($conn); ?>
die(ossim_error()); } Host_os::ack_ign($conn, $ip, $date, $sensor, "ack"); } elseif (preg_match("/^ignore/i", $ip)) { $ip = ereg_replace("ignore", "", $ip); $ip = ereg_replace("_", ".", $ip); $sensor = ereg_replace("_", ".", $sensor); $date = ereg_replace("_", " ", $date); ossim_valid($ip, OSS_IP_ADDR, 'illegal:' . _("ip")); ossim_valid($sensor, OSS_IP_ADDR, 'illegal:' . _("Sensor")); ossim_valid($date, OSS_ALPHA, OSS_PUNC, OSS_SPACE, 'illegal:' . _("Date")); if (ossim_error()) { die(ossim_error()); } print _("Ignore") . ": {$ip} {$date} {$sensor}<br>"; Host_os::ack_ign($conn, $ip, $date, $sensor, "ignore"); } } $db->close($conn); ?> <p> <?php echo gettext("Successfully Acked/Deleted"); ?> </p> <?php $location = "{$back}"; sleep(2); echo "<script>\n///history.go(-1);\nwindow.location='{$location}';\n</script>\n"; ?>
echo $host_os["old_date"]; ?> " value="<?php echo "ignore" . $host_os["ip"]; ?> " <?php if (strtolower($host_os["os"]) == strtolower($host_os["old_os"])) { echo "disabled"; } ?> > </td> </tr> <?php if ($ex_os == $host_os["ip"] && $ex_oss == $host_os["sensor"]) { if ($host_os_ip_list = Host_os::get_ip_list($conn, $host_os["ip"], $host_os["sensor"])) { foreach ($host_os_ip_list as $host_os_ip) { $os_main_ip = $previous_main_ip = ""; list($os_main_ip, ) = split(" ", strtolower($host_os_ip["os"]), 2); list($previous_main_ip, ) = split(" ", strtolower($host_os_ip["old_os"]), 2); $delta = Util::date_diff($host_os_ip["date"], $host_os_ip["old_date"], 'yMdhms'); if ($delta == "00:00:00") { $delta = "-"; } ?> <tr<?php if ($os_main_ip != $previous_main_ip) { echo ' bgcolor="#eac3c3"'; } elseif (strtolower($host_os_ip["os"]) != strtolower($host_os_ip["old_os"])) { echo ' bgcolor="#e4e3a5"'; } else {
<tr> <td bgcolor="<?php echo $bgcolor; ?> "><a href="host_report.php?host=<?php echo $h->ip; ?> " class="HostReportMenu" id="<?php echo $h->ip; ?> ;<?php echo $h->hostname; ?> "><?php echo $h->hostname . " " . Host_os::get_os_pixmap($conn, $h->ip); ?> </a> </td> <td bgcolor="<?php echo $bgcolor; ?> "><a href="host_report.php?host=<?php echo $h->ip; ?> " class="HostReportMenu" id="<?php echo $h->ip; ?> ;<?php echo $h->hostname; ?>