Example #1
0
function UpdateWhoisCache($db)
{
    global $debug_mode, $whois_cache_lifetime;
    $cnt = 0;
    $ip_result = $db->baseExecute("SELECT DISTINCT ip_src FROM acid_event " . "LEFT JOIN acid_ip_cache ON ipc_ip = ip_src " . "WHERE ipc_whois IS NULL");
    while (($row = $ip_result->baseFetchRow()) != NULL) {
        //if ($debug_mode > 0) echo $row[0] . " - " . baseLong2IP($row[0]) . "<BR>";
        baseGetWhois(baseLong2IP($row[0]), $db, $whois_cache_lifetime);
        ++$cnt;
    }
    $ip_result->baseFreeRows();
    $ip_result = $db->baseExecute("SELECT DISTINCT ip_dst FROM acid_event " . "LEFT JOIN acid_ip_cache ON ipc_ip = ip_dst " . "WHERE ipc_whois IS NULL");
    while (($row = $ip_result->baseFetchRow()) != NULL) {
        //if ($debug_mode > 0) echo $row[0] . " - " . baseLong2IP($row[0]) . "<BR>";
        baseGetWhois(baseLong2IP($row[0]), $db, $whois_cache_lifetime);
        ++$cnt;
    }
    $ip_result->baseFreeRows();
    ErrorMessage(gettext("Added ") . $cnt . gettext(" hostnames to the Whois cache"));
}
Example #2
0
if ($num_dst_ip == 0) {
    echo '<TD ALIGN="center" bgcolor="#F2F2F2">' . $num_dst_ip . '</TD>';
} else {
    echo '<TD ALIGN="center" bgcolor="#F2F2F2"><A target="main" class="flnk" HREF="' . $tmp_dst_iplookup . '">' . $num_dst_ip . '</A></TD>';
}
echo '   <TD align="center" bgcolor="#F2F2F2">' . $start_time . '
         <TD align="center" bgcolor="#F2F2F2" valign="middle">' . $stop_time . '
       </TR>
      </TABLE></CENTER>';
if ($action == "events") {
    echo '<BR>
            <CENTER><P>';
    PrintEventsByIP($db, $ip);
    echo ' </CENTER>';
} else {
    if ($action == "whois") {
        echo "\n<B>" . gettext("Whois Information") . "</B>" . "<PRE>" . baseGetWhois($ip, $db, $whois_cache_lifetime) . "</PRE>";
    } else {
        if ($action == "portscan") {
            echo '<HR>
            <CENTER><P>';
            PrintPortscanEvents($db, $ip);
            echo ' </CENTER>';
        }
    }
}
echo "\n</FORM>\n";
PrintBASESubFooter();
$et->PrintTiming();
$db->baseClose();
echo "</body>\r\n</html>";