Пример #1
0
    $base_dir = $conf->get_conf("base_dir");
    if (!file_exists("{$base_dir}/tmp/{$backlog_id}.txt")) {
        $backlog_file = fopen("{$base_dir}/tmp/{$backlog_id}.txt", "w");
        if (!$backlog_file) {
            $have_scanmap = 0;
        }
    } else {
        $have_scanmap = 0;
    }
} else {
    $have_scanmap = 0;
}
// Timezone correction
$tz = Util::get_timezone();
$alarms_numbering = Alarm::get_alarms_numbering($conn, $backlog_id);
list($alarm_list, $total_events) = Alarm::get_events($conn, $backlog_id, $show_all, $event_id, $from, $max_events, $alarms_numbering);
$first_number = $event_id != "" ? $from > 0 ? $from - 1 : $from : get_first_number($from, $alarms_numbering, $alarm_list[0]->get_event_id());
if ($total_events > 0) {
    $count_events = $first_number;
    $count_alarms = 0;
    // obsolete
    foreach ($alarm_list as $alarm) {
        $id = $alarm->get_plugin_id();
        $sid = $alarm->get_plugin_sid();
        $backlog_id = $alarm->get_backlog_id();
        $risk = $alarm->get_risk();
        $snort_sid = $alarm->get_snort_sid();
        $snort_cid = $alarm->get_snort_cid();
        $sid_name = $alarm->get_sid_name();
        $sid_priority = $alarm->get_sid_priority();
        if ($sid_name == "") {
Пример #2
0
$have_scanmap = $conf->get_conf("have_scanmap3d");
if ($have_scanmap == 1 && $show_all) {
    // Generate scanmap datafile
    $base_dir = $conf->get_conf("base_dir");
    if (!file_exists("{$base_dir}/tmp/{$backlog_id}.txt")) {
        $backlog_file = fopen("{$base_dir}/tmp/{$backlog_id}.txt", "w");
        if (!$backlog_file) {
            $have_scanmap = 0;
        }
    } else {
        $have_scanmap = 0;
    }
} else {
    $have_scanmap = 0;
}
if ($alarm_list = Alarm::get_events($conn, $backlog_id, $show_all, $event_id)) {
    $count_events = 0;
    $count_alarms = 0;
    foreach ($alarm_list as $alarm) {
        $id = $alarm->get_plugin_id();
        $sid = $alarm->get_plugin_sid();
        $backlog_id = $alarm->get_backlog_id();
        $risk = $alarm->get_risk();
        $snort_sid = $alarm->get_snort_sid();
        $snort_cid = $alarm->get_snort_cid();
        /* get plugin_id and plugin_sid names */
        /*
        * never used?
        *
        $plugin_id_list = Plugin::get_list($conn, "WHERE id = $id");
        $id_name = $plugin_id_list[0]->get_name();