Example #1
0
<?php

require_once 'classes/Session.inc';
require_once 'classes/Security.inc';
require_once 'classes/Util.inc';
require_once 'sensor_filter.php';
if ($_SESSION['menu_opc'] == 'Detection' && $_SESSION['menu_sopc'] == 'HIDS') {
    $m_perms = array("MenuEvents", "MenuEvents");
    $sm_perms = array("EventsHids", "EventsHidsConfig");
    if (!Session::menu_perms($m_perms, $sm_perms)) {
        Session::unallowed_section(null, 'noback', $m_perms[0], $sm_perms[0]);
    }
} else {
    if (!Session::menu_perms("MenuControlPanel", "ControlPanelExecutive")) {
        Session::unallowed_section(null, 'noback', "MenuControlPanel", "ControlPanelExecutive");
    }
}
session_write_close();
function SIEM_trends($h = 24)
{
    global $tz;
    $tzc = Util::get_tzc($tz);
    $data = array();
    require_once 'ossim_db.inc';
    $db = new ossim_db();
    $dbconn = $db->snort_connect();
    $sensor_where = make_sensor_filter($dbconn);
    $sqlgraph = "SELECT COUNT(acid_event.sid) as num_events, hour(convert_tz(timestamp,'+00:00','{$tzc}')) as intervalo, day(convert_tz(timestamp,'+00:00','{$tzc}')) as suf FROM acid_event WHERE timestamp BETWEEN '" . gmdate("Y-m-d H:i:s", gmdate("U") - 3600 * $h) . "' AND '" . gmdate("Y-m-d H:i:s") . "' {$sensor_where} GROUP BY suf,intervalo";
    //print_r($sqlgraph);
    if (!($rg =& $dbconn->Execute($sqlgraph))) {
        print $dbconn->ErrorMsg();
Example #2
0
* along with this package; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
* MA  02110-1301  USA
*
*
* On Debian GNU/Linux systems, the complete text of the GNU General
* Public License can be found in `/usr/share/common-licenses/GPL-2'.
*
* Otherwise you can read it here: http://www.gnu.org/licenses/gpl-2.0.txt
*
*/
require_once 'av_init.php';
$m_perms = array('dashboard-menu', 'analysis-menu');
$sm_perms = array('ControlPanelMetrics', 'EventsForensics');
if (!Session::menu_perms($m_perms, $sm_perms)) {
    Session::unallowed_section(FALSE);
}
/*
 This will show errors (both PHP Errors and those detected in the code)
 as graphics, so they can be read.
*/
function mydie($errno, $errstr = '', $errfile = '', $errline = '')
{
    global $conf;
    $jpgraph = $conf->get_conf('jpgraph_path');
    include_once "{$jpgraph}/jpgraph.php";
    $err = $errstr ? $errstr : $errno;
    if ($errfile) {
        switch ($errno) {
            case 1:
                $errprefix = 'Error';
Example #3
0
*
* You should have received a copy of the GNU General Public License
* along with this package; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
* MA  02110-1301  USA
*
*
* On Debian GNU/Linux systems, the complete text of the GNU General
* Public License can be found in `/usr/share/common-licenses/GPL-2'.
*
* Otherwise you can read it here: http://www.gnu.org/licenses/gpl-2.0.txt
*
*/
require_once 'av_init.php';
if (!Session::am_i_admin()) {
    Session::unallowed_section(null, FALSE);
    exit;
}
set_time_limit(0);
ignore_user_abort(TRUE);
ob_implicit_flush(TRUE);
$version = GET('version');
$type = GET('type');
$force = GET('force');
ossim_valid($version, OSS_DIGIT, OSS_LETTER, OSS_PUNC, OSS_NULLABLE, 'illegal:' . _("Version"));
ossim_valid($type, OSS_ALPHA, OSS_SCORE, OSS_NULLABLE, 'illegal:' . _("Type"));
ossim_valid($force, OSS_ALPHA, OSS_NULLABLE, 'illegal:' . _("Force"));
if (ossim_error()) {
    die(ossim_error());
}
?>
Example #4
0
*   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
*   MA  02110-1301  USA
*
*
* On Debian GNU/Linux systems, the complete text of the GNU General
* Public License can be found in `/usr/share/common-licenses/GPL-2'.
*
* Otherwise you can read it here: http://www.gnu.org/licenses/gpl-2.0.txt
****************************************************************************/
require_once 'classes/Session.inc';
require_once 'conf/_conf.php';
require_once 'utils.php';
$m_perms = array("MenuEvents", "MenuEvents");
$sm_perms = array("EventsHids", "EventsHidsConfig");
if (!Session::menu_perms($m_perms, $sm_perms)) {
    Session::unallowed_section(null, 'noback', $m_perms[0], $sm_perms[0]);
}
$error = false;
if (!file_exists($agent_conf)) {
    $result = test_agents();
    if ($result !== true) {
        $error = true;
    }
}
?>



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
* along with this package; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
* MA  02110-1301  USA
*
*
* On Debian GNU/Linux systems, the complete text of the GNU General
* Public License can be found in `/usr/share/common-licenses/GPL-2'.
*
* Otherwise you can read it here: http://www.gnu.org/licenses/gpl-2.0.txt
*
*/
require_once 'av_init.php';
Session::logcheck("analysis-menu", "IncidentsIncidents");
//Check permissions
if (!Session::menu_perms("analysis-menu", "IncidentsOpen")) {
    Session::unallowed_section();
    exit;
}
$upload_dir = '/usr/share/ossim/www/uploads/';
$prefix = POST('prefix');
ossim_valid($prefix, OSS_DIGIT, 'illegal:' . _("Prefix"));
if (ossim_error()) {
    die(ossim_error());
}
if ($_FILES['imageName']['tmp_name'] != "") {
    if (!preg_match("/^[a-zA-Z0-9\\-\\_\\s]+\\.(gif|jpg|png|jpeg)\$/i", $_FILES['imageName']['name']) || !preg_match("/image\\//", $_FILES["imageName"]["type"])) {
        echo '<div class="error_msg_container"><h3>ERROR: Your image was not one of the accepted formats (gif, jpg, png), please try again.</h3></div>';
        unlink($_FILES['imageName']['tmp_name']);
        exit;
    } else {
        $figure_name = $prefix . "_" . preg_replace("/[\\s\t\\/\\'\"]/", "_", $_FILES['imageName']['name']);
Example #6
0
* You should have received a copy of the GNU General Public License
* along with this package; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
* MA  02110-1301  USA
*
*
* On Debian GNU/Linux systems, the complete text of the GNU General
* Public License can be found in `/usr/share/common-licenses/GPL-2'.
*
* Otherwise you can read it here: http://www.gnu.org/licenses/gpl-2.0.txt
*
*/
require_once 'av_init.php';
Session::logcheck('analysis-menu', 'EventsForensics');
if (!Session::is_pro()) {
    Session::unallowed_section(NULL, 'noback');
}
// load column layout
require_once '../conf/layout.php';
$category = "policy";
$name_layout = "databases_layout";
$layout = load_layout($name_layout, $category);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title> <?php 
echo gettext("OSSIM Framework");
?>
 </title>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
Example #7
0
*
* You should have received a copy of the GNU General Public License
* along with this package; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
* MA  02110-1301  USA
*
*
* On Debian GNU/Linux systems, the complete text of the GNU General
* Public License can be found in `/usr/share/common-licenses/GPL-2'.
*
* Otherwise you can read it here: http://www.gnu.org/licenses/gpl-2.0.txt
*
*/
require_once 'av_init.php';
if (!Session::am_i_admin()) {
    Session::unallowed_section(null, 'noback');
}
$validate = array("locations_id" => array("validation" => "OSS_HEX, OSS_NULLABLE", "e_message" => 'illegal:' . _("ID")), "ctx" => array("validation" => "OSS_HEX, OSS_NULLABLE", "e_message" => 'illegal:' . _("CTX")), "l_name" => array("validation" => "OSS_ALPHA, OSS_SPACE, OSS_SCORE, OSS_DOT", "e_message" => 'illegal:' . _("Name")), "desc" => array("validation" => "OSS_TEXT, OSS_NULLABLE", "e_message" => 'illegal:' . _("Description")), "search_location" => array("validation" => "OSS_TEXT", "e_message" => 'illegal:' . _("Location")), "latitude" => array("validation" => "OSS_DIGIT, '\\.\\-', OSS_NULLABLE", "e_message" => 'illegal:' . _("Latitude")), "longitude" => array("validation" => "OSS_DIGIT, '\\.\\-', OSS_NULLABLE", "e_message" => 'illegal:' . _("Longitude")), "country" => array("validation" => "OSS_LETTER, OSS_NULLABLE", "e_message" => 'illegal:' . _("Country")), "sensor_list" => array("validation" => "OSS_HEX, OSS_NULLABLE", "e_message" => 'illegal:' . _("Sensor List")));
if (GET('ajax_validation') == TRUE) {
    $data['status'] = 'OK';
    $validation_errors = validate_form_fields('GET', $validate);
    if (is_array($validation_errors) && !empty($validation_errors)) {
        $data['status'] = 'error';
        $data['data'] = $validation_errors;
    }
    echo json_encode($data);
    exit;
}
$validation_errors = validate_form_fields('POST', $validate);
if (POST('ajax_validation_all') == TRUE) {
    if (is_array($validation_errors) && !empty($validation_errors)) {
Example #8
0
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
* MA  02110-1301  USA
*
*
* On Debian GNU/Linux systems, the complete text of the GNU General
* Public License can be found in `/usr/share/common-licenses/GPL-2'.
*
* Otherwise you can read it here: http://www.gnu.org/licenses/gpl-2.0.txt
*
*/
require_once 'av_init.php';
require_once 'sensor_filter.php';
$m_perms = array("dashboard-menu", "analysis-menu", "analysis-menu");
$sm_perms = array("ControlPanelExecutive", "IncidentsIncidents", "IncidentsReport");
if (!Session::menu_perms($m_perms, $sm_perms)) {
    Session::unallowed_section(false);
}
$type = GET("type");
ossim_valid($type, 'ticketsByPriority', 'ticketsClosedByMonth', 'ticketResolutionTime', 'openedTicketsByUser', 'ticketStatus', 'ticketTypes', 'ticketTags', 'ticketsByTypePerMonth', 'illegal:' . _("Type"));
ossim_valid($_GET['legend'], OSS_ALPHA, OSS_NULLABLE, 'illegal:' . _("Legend"));
ossim_valid($_GET['height'], OSS_DIGIT, OSS_NULLABLE, 'illegal:' . _("Height"));
if (ossim_error()) {
    die(ossim_error());
}
$data = null;
$links = '';
$h = !empty($_GET['height']) ? GET('height') : 250;
// Graph Height
$db = new ossim_db();
$conn = $db->connect();
$user = Session::get_session_user();
Example #9
0
*
* You should have received a copy of the GNU General Public License
* along with this package; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
* MA  02110-1301  USA
*
*
* On Debian GNU/Linux systems, the complete text of the GNU General
* Public License can be found in `/usr/share/common-licenses/GPL-2'.
*
* Otherwise you can read it here: http://www.gnu.org/licenses/gpl-2.0.txt
*
*/
require_once 'av_init.php';
if (!Session::menu_perms("analysis-menu", "IncidentsTypes") && !Session::am_i_admin()) {
    Session::unallowed_section(null);
}
Session::logcheck("analysis-menu", "IncidentsTypes");
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<title> <?php 
echo gettext("OSSIM Framework");
?>
 </title>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
	<meta http-equiv="Pragma" content="no-cache"/>
	<script type="text/javascript" src="../js/jquery.min.js"></script>
	<script type="text/javascript" src="../js/jquery-ui.min.js"></script>
Example #10
0
*
* On Debian GNU/Linux systems, the complete text of the GNU General
* Public License can be found in `/usr/share/common-licenses/GPL-2'.
*
* Otherwise you can read it here: http://www.gnu.org/licenses/gpl-2.0.txt
*
*/
require_once 'av_init.php';
require_once 'sensor_filter.php';
$m_perms = array('dashboard-menu', 'environment-menu', 'environment-menu');
$sm_perms = array('ControlPanelExecutive', 'EventsHids', 'EventsHidsConfig');
if (Session::menu_perms($m_perms, $sm_perms) == FALSE) {
    if (Session::menu_perms($m_perms[0], $sm_perms[0]) == FALSE) {
        Session::unallowed_section(NULL, 'noback', $m_perms[0], $sm_perms[0]);
    } else {
        Session::unallowed_section(NULL, 'noback', $m_perms[1], $sm_perms[1]);
    }
}
$nodata_text = _('No events found');
$db = new ossim_db(TRUE);
$conn = $db->connect();
session_write_close();
$data = '';
$urls = '';
$colors = '"#E9967A","#9BC3CF"';
$range = 604800;
//24*60*60*7 --> Week
$h = 250;
// Graph Height
$f_url = "../forensics/base_qry_main.php?clear_allcriteria=1&time_range=week&time[0][0]=+&time[0][1]=>%3D&time[0][2]=" . gmdate("m", $timetz - $range) . "&time[0][3]=" . gmdate("d", $timetz - $range) . "&time[0][4]=" . gmdate("Y", $timetz - $range) . "&time[0][5]=&time[0][6]=&time[0][7]=&time[0][8]=+&time[0][9]=+&submit=Query+DB&num_result_rows=-1&time_cnt=1&sort_order=time_d";
$tz = Util::get_timezone();
Example #11
0
*
* Otherwise you can read it here: http://www.gnu.org/licenses/gpl-2.0.txt
*
*/
require_once 'av_init.php';
Session::logcheck("analysis-menu", "IncidentsTags");
function display_errors($info_error)
{
    $errors = implode("</div><div style='padding-top: 3px;'>", $info_error);
    $error_msg = "<div>" . _("The following errors occurred:") . "</div><div style='padding-left: 15px;'><div>{$errors}</div></div>";
    $config_nt = array('content' => $error_msg, 'options' => array('type' => 'nf_error', 'cancel_button' => FALSE), 'style' => 'width: 90%; margin: 20px auto; padding: 10px 0px; text-align: left; font-style: italic');
    $nt = new Notification('nt_1', $config_nt);
    return $nt->show(FALSE);
}
if (!Session::menu_perms("analysis-menu", "IncidentsTags") && !Session::am_i_admin()) {
    Session::unallowed_section(NULL);
}
// Avoid the browser resubmit POST data stuff
if (GET('redirect')) {
    header('Location: ' . $_SERVER['SCRIPT_NAME']);
    exit;
}
$db = new ossim_db();
$conn = $db->connect();
$tag = new Incident_tag($conn);
$parameters = NULL;
$info_error = NULL;
$error = FALSE;
$action = $parameters['action'] = GET('action') ? GET('action') : 'list';
$id = $parameters['id'] = GET('id');
if ($action == 'mod1step' && is_numeric($id)) {
Example #12
0
*   along with this package; if not, write to the Free Software
*   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
*   MA  02110-1301  USA
*
*
* On Debian GNU/Linux systems, the complete text of the GNU General
* Public License can be found in `/usr/share/common-licenses/GPL-2'.
*
* Otherwise you can read it here: http://www.gnu.org/licenses/gpl-2.0.txt
****************************************************************************/
require_once 'classes/Session.inc';
require_once 'classes/Xml_parser.inc';
require_once 'conf/_conf.php';
require_once 'utils.php';
if (!Session::menu_perms("MenuEvents", "EventsHidsConfig")) {
    Session::unallowed_section(null, 'noback', "MenuEvents", "EventsHidsConfig");
}
$filename = $rules_file . $editable_files[0];
$error = false;
$error_conf = null;
$_SESSION["_current_file"] = $editable_files[0];
if (file_exists($filename)) {
    $result = test_conf();
    if ($result !== true) {
        $error = true;
        $link_txt = _("Configuration error in file") . " " . basename($ossec_conf) . " " . _("and/or") . " " . $editable_files[0];
        $info_conf = "<span style='font-weight: bold;'>{$link_txt}<a onclick=\"\$('#msg_errors').toggle();\"> [" . _("View errors") . "]</a><br/></span>";
        $info_conf .= "<div id='msg_errors'>{$result}</div>";
        $error_conf = "<div id='parse_errors' class='oss_error'>{$info_conf}</div>";
    } else {
        $file_xml = @file_get_contents($filename, false);
Example #13
0
$hmenu = array("MonitorsInventory");
$m_perms = array("MenuMonitors", "MenuPolicy");
$sm_perms = array("MonitorsInventory", "ReportsOCSInventory");
Session::logcheck($m_perms, $sm_perms);
$conf = $GLOBALS["CONF"];
$version = $conf->get_conf("ossim_server_version", FALSE);
$opensource = !preg_match("/pro|demo/i", $version) ? true : false;
$withusers = intval(GET('users'));
$withsiemcomponents = intval(GET('siem'));
$realtime = intval(GET('realtime'));
$onlyinventory = intval(GET('onlyinventory'));
$_SESSION["_with_users"] = $withusers;
$_SESSION["_with_siem_components"] = $withsiemcomponents;
$_SESSION["_real_time"] = $realtime;
if ($opensource) {
    Session::unallowed_section(null, false);
    exit;
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>
		<title> <?php 
echo _("OSSIM Framework") . " - " . _("Asset Structure");
?>
</title>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
		<meta http-equiv="Pragma" content="no-cache"/>
		<link rel="stylesheet" type="text/css" href="../style/style.css"/>
		<link rel="stylesheet" type="text/css" href="../style/greybox.css"/>