Esempio n. 1
0
     $no_ip = false;
 }
 qroPrintEntryHeader($i);
 /* Generating checkbox value -- nikns */
 $addr_type == SOURCE_IP ? $src_ip = $currentIP : ($dst_ip = $currentIP);
 $tmp_rowid = $src_ip . "_" . $dst_ip . "_" . $ctx;
 echo '    <TD><INPUT TYPE="checkbox" NAME="action_chk_lst[' . $i . ']" VALUE="' . $tmp_rowid . '">';
 echo '    <INPUT TYPE="hidden" NAME="action_lst[' . $i . ']" VALUE="' . $tmp_rowid . '"></TD>';
 /* Check for a NULL IP which indicates an event (e.g. portscan)
  * which has no IP
  */
 if ($no_ip) {
     qroPrintEntry(gettext("unknown"));
     qroPrintEntry(gettext("N/A"), "center", "middle");
 } else {
     $geo_info = Asset_host::get_extended_location($_conn, $geoloc, $currentIP);
     if ($geo_info['html_icon'] != '') {
         $country_img = $geo_info['html_icon'] . ' ';
         $slnk = $current_url . preg_replace("/.*src\\='\\/ossim([^']+)'.*/", "\\1", $country_img);
     } else {
         $country_img = "";
         $slnk = "";
     }
     $div = '<div id="' . $currentIP . ';' . $currentIP . ';' . $host_id . '" ctx="' . (Session::show_entities() ? $ctx : Session::get_default_ctx()) . '" class="HostReportMenu" style="padding:0px 0px 0px 25px">';
     //'.getrepbgcolor($prio,1).'
     $bdiv = '</div>';
     qroPrintEntry($div . $country_img . "&nbsp;" . BuildAddressLink($currentIP, 32) . $currentIP . '</A>&nbsp;' . $bdiv, 'left', '', 'nowrap');
     qroPrintEntry(getrepimg($prio, $rel, $act, $currentIP), "center", "middle");
 }
 if ($resolve_IP == 1) {
     qroPrintEntry('&nbsp;&nbsp;' . baseGetHostByAddr($currentIP, $ctx, $db) . '&nbsp;&nbsp;');
 //&amp;layer4=' . IPProto2str($proto);
 $tmp_rowid = $sip . "_" . $dip . "_" . $proto;
 //echo '    <TD><INPUT TYPE="checkbox" NAME="action_chk_lst[' . $i . ']" VALUE="' . $tmp_rowid . '"></TD>';
 //echo '        <INPUT TYPE="hidden" NAME="action_lst[' . $i . ']" VALUE="' . $tmp_rowid . '">';
 echo "<td></td>";
 $geo_info = Asset_host::get_extended_location($_conn, $geoloc, $ip_sip);
 if ($geo_info['html_icon'] != '') {
     $s_country_img = $geo_info['html_icon'] . ' ';
     $slnk = $current_url . preg_replace("/.*src\\='\\/ossim([^']+)'.*/", "\\1", $s_country_img);
 } else {
     $s_country_img = "";
     $slnk = "";
 }
 $div1 = '<div id="' . $ip_sip . ';' . $ip_sip . ';' . $src_host . '" ctx="' . $ctx . '" class="HostReportMenu">';
 $bdiv1 = '</div>';
 $geo_info = Asset_host::get_extended_location($_conn, $geoloc, $ip_dip);
 if ($geo_info['html_icon'] != "") {
     $d_country_img = $geo_info['html_icon'] . " ";
     $dlnk = $current_url . preg_replace("/.*src\\='\\/ossim([^']+)'.*/", "\\1", $d_country_img);
 } else {
     $d_country_img = "";
     $dlnk = "";
 }
 $div2 = '<div id="' . $ip_dip . ';' . $ip_dip . ';' . $dst_host . '" ctx="' . $ctx . '" class="HostReportMenu">';
 $bdiv2 = '</div>';
 if ($fqdn == "yes") {
     qroPrintEntry('<FONT>' . $sip_fqdn . '</FONT>');
 }
 qroPrintEntry($div1 . $s_country_img . BuildAddressLink($ip_sip, 32) . $ip_sip . '</A>' . $bdiv1, "", "", "nowrap");
 qroPrintEntry('<img src="images/dash.png" border="0">');
 qroPrintEntry($div2 . $d_country_img . BuildAddressLink($ip_dip, 32) . $ip_dip . '</A>' . $bdiv2, "", "", "nowrap");
Esempio n. 3
0
$dst_loc = preg_match("/data-title\\s*=\\s*'([^\\d]+)'/", $dst_img, $matches) ? $dst_img . ' <a target="_blank" href="' . $gmaps_url . '">' . $matches[1] . '</a>' : '';
$ip_dst_data = (preg_match("/data-title\\s*=\\s*'\\d+/", $dst_img) ? $dst_img . ' ' : ' ') . ($myrow2['dst_host'] != '' ? '<A HREF="#" data-url="' . Menu::get_menu_url(AV_MAIN_PATH . '/av_asset/common/views/detail.php?asset_id=' . $myrow2['dst_host'], 'environment', 'assets', 'assets') . '">' : '<A HREF="#" data-url="' . AV_MAIN_PATH . '/forensics/base_stat_ipaddr.php?ip=' . $current_dip . '&amp;netmask=32">') . $dip_aux . ($current_dip == $dip_aux ? '' : ' [' . $current_dip . ']');
$reptooltip_dst = getreptooltip($idm_data["rep_prio_dst"], $idm_data["rep_rel_dst"], $idm_data["rep_act_dst"], $current_dip);
// Destination Map
$dst_latitude = $dst_longitude = 0;
if (valid_hex32($myrow2['dst_host'])) {
    if ($dst_obj = Asset_host::get_object($_conn, $myrow2['dst_host'])) {
        $coordinates = $dst_obj->get_location();
        if (floatval($coordinates['lat']) != 0) {
            $dst_latitude = floatval($coordinates['lat']);
        }
        if (floatval($coordinates['lon']) != 0) {
            $dst_longitude = floatval($coordinates['lon']);
        }
        if (empty($dst_loc)) {
            $dst_location = Asset_host::get_extended_location($_conn, $geoloc, $current_dip, $myrow2['dst_host']);
            if ($dst_location['country']['code']) {
                $dst_loc = '<img src="../pixmaps/flags/' . $dst_location['country']['code'] . '.png"/> <a target="_blank" href="' . $gmaps_url . '">' . $dst_location['country']['name'] . '</a>';
            }
        }
    }
}
if (!$dst_latitude && !$dst_longitude) {
    $record = $geoloc->get_location_from_file($current_dip);
    if ($record->latitude != 0 && $record->longitude != 0) {
        $dst_latitude = $record->latitude;
        $dst_longitude = $record->longitude;
    }
    if (empty($dst_loc) && $record->country_name != '') {
        $dst_loc = '<img src="../pixmaps/flags/' . strtolower($record->country_code) . '.png"/> <a target="_blank" href="' . $gmaps_url . '">' . $record->country_name . '</a>';
    }