• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP ossim_db类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中ossim_db的典型用法代码示例。如果您正苦于以下问题:PHP ossim_db类的具体用法?PHP ossim_db怎么用?PHP ossim_db使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了ossim_db类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: load_layout

function load_layout($name_layout, $category = 'policy')
{
    $db = new ossim_db();
    $conn = $db->connect();
    $config = new User_config($conn);
    $login = Session::get_session_user();
    $data = $config->get($login, $name_layout, 'php', $category);
    return $data == null ? array() : $data;
}
开发者ID:jhbsz,项目名称:ossimTest,代码行数:9,代码来源:layout.php


示例2: end_upgrade

 function end_upgrade()
 {
     require_once 'ossim_db.inc';
     $dbsock = new ossim_db();
     $db = $dbsock->connect();
     $configxml = "/etc/ossim/server/config.xml";
     $name = "Not found";
     // Check server name
     if (file_exists($configxml)) {
         $lines = file($configxml);
         foreach ($lines as $line) {
             if (preg_match("/\\<server.*name=\"([^\"]+)\"/", $line, $found)) {
                 $name = $found[1];
             }
         }
     }
     // Search in DB for name
     $sql = "SELECT * FROM server_role WHERE name=\"{$name}\"";
     if (!($rs = $db->Execute($sql))) {
         print $db->ErrorMsg();
     } elseif (!$rs->EOF) {
         // Found -> Update
         $correlate = $rs->fields['correlate'] ? "yes" : "no";
         $cross_correlate = $rs->fields['cross_correlate'] ? "yes" : "no";
         $store = $rs->fields['store'] ? "yes" : "no";
         $qualify = $rs->fields['qualify'] ? "yes" : "no";
         $resend_alarm = $rs->fields['resend_alarm'] ? "yes" : "no";
         $resend_event = $rs->fields['resend_event'] ? "yes" : "no";
         $sign = $rs->fields['sign'] ? "yes" : "no";
         $sem = $rs->fields['sem'] ? "yes" : "no";
         $sim = $rs->fields['sim'] ? "yes" : "no";
         $alarms_to_syslog = $rs->fields['alarms_to_syslog'] ? "yes" : "no";
         require_once 'classes/Config.inc';
         $conf = new Config();
         $conf->update("server_correlate", $correlate);
         $conf->update("server_cross_correlate", $cross_correlate);
         $conf->update("server_store", $store);
         $conf->update("server_qualify", $qualify);
         $conf->update("server_forward_alarm", $resend_alarm);
         $conf->update("server_forward_event", $resend_event);
         $conf->update("server_sign", $sign);
         $conf->update("server_sem", $sem);
         $conf->update("server_sim", $sim);
         $conf->update("server_alarms_to_syslog", $alarms_to_syslog);
     }
     exec("sudo /etc/init.d/ossim-server restart");
     //
     // Reload ACLS
     //
     $this->reload_acls();
     return true;
 }
开发者ID:jhbsz,项目名称:ossimTest,代码行数:52,代码来源:2.2.php


示例3: check_phpgacl_install

function check_phpgacl_install()
{
    global $gacl;
    $db_table_prefix = $gacl->_db_table_prefix;
    require_once "ossim_db.inc";
    $db = new ossim_db();
    if (!($conn = $db->phpgacl_connect())) {
        echo "<p align=\"center\">\n                <b>Can't connect to OSSIM acl database (phpgacl)</b><br/>\n                Check for phpgacl values at framework configuration\n                </p>";
        exit;
    }
    $query1 = OssimQuery("SELECT * FROM acl");
    $query2 = OssimQuery("SELECT * FROM " . $db_table_prefix . "_acl");
    if (!$conn->Execute($query1) and !$conn->Execute($query2)) {
        echo "\n        <p align=\"center\"><b>You need to configure phpGACL</b><br/>\n        Remember to setup the database connection at phpGACL config files!\n        <br/>\n        Click <a href=\"/phpgacl/setup.php\">here</a> to enter setup\n        </p>\n            ";
        exit;
    }
    $db->close($conn);
}
开发者ID:jhbsz,项目名称:ossimTest,代码行数:18,代码来源:login.php


示例4: get_report_uuid

function get_report_uuid()
{
    require_once 'classes/Session.inc';
    $uuid = Session::get_secure_id();
    $url = null;
    if (empty($uuid)) {
        $db = new ossim_db();
        $dbconn = $db->connect();
        $user = Session::get_session_user();
        $query = 'SELECT * FROM `users` WHERE login="' . $user . '"';
        $result = $dbconn->Execute($query);
        if (is_array($result->fields) && !empty($result->fields)) {
            $pass = $result->fields["pass"];
            $uuid = sha1($user . "#" . $pass);
        } else {
            $uuid = false;
        }
    }
    return $uuid;
}
开发者ID:jhbsz,项目名称:ossimTest,代码行数:20,代码来源:deleteuser.php


示例5: get_user_icon

function get_user_icon($login, $pro)
{
    ${$pixmaps} = '../pixmaps/user-green.png';
    $db = new ossim_db();
    $conn = $db->connect();
    $user = Session::get_list($conn, "WHERE login='{$login}'");
    if ($pro) {
        // Pro-version
        if ($login == ACL_DEFAULT_OSSIM_ADMIN || $user[0]->get_is_admin()) {
            $pixmaps = '../pixmaps/user-gadmin.png';
        } elseif (Acl::is_proadmin($conn, $user[0]->get_login())) {
            $pixmaps = '../pixmaps/user-business.png';
        }
    } else {
        // Open Source
        if ($login == ACL_DEFAULT_OSSIM_ADMIN || $user[0]->get_is_admin()) {
            $pixmaps = "../pixmaps/user-gadmin.png";
        }
    }
    $db->close();
    return $pixmaps;
}
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:22,代码来源:opened_sessions.php


示例6: SIEM_trends_week

function SIEM_trends_week($param = '')
{
    global $tz;
    $tzc = Util::get_tzc($tz);
    $data = array();
    $plugins = '';
    $plugins_sql = '';
    $db = new ossim_db(TRUE);
    $dbconn = $db->connect();
    $_asset_where = make_asset_filter();
    $asset_where = $_asset_where[1];
    $sensor_where = make_ctx_filter() . $asset_where;
    $tax_join = '';
    if (preg_match("/taxonomy\\=(.+)/", $param, $found)) {
        if ($found[1] == 'honeypot') {
            $tax_join = 'alienvault.plugin_sid p, ';
            $tax_where = 'AND acid_event.plugin_id = p.plugin_id AND acid_event.plugin_sid = p.sid AND p.category_id = 19';
        }
        $param = '';
    } elseif ($param == 'ossec%') {
        $plugins_sql = 'AND acid_event.plugin_id between ' . OSSEC_MIN_PLUGIN_ID . ' AND ' . OSSEC_MAX_PLUGIN_ID;
        $plugins = OSSEC_MIN_PLUGIN_ID . '-' . OSSEC_MAX_PLUGIN_ID;
    }
    $sqlgraph = "SELECT SUM(acid_event.cnt) as num_events, day(convert_tz(timestamp,'+00:00','{$tzc}')) AS intervalo, monthname(convert_tz(timestamp,'+00:00','{$tzc}')) AS suf \n        FROM {$tax_join} alienvault_siem.ac_acid_event acid_event\n        WHERE timestamp BETWEEN '" . gmdate("Y-m-d 00:00:00", gmdate("U") - 604800) . "' AND '" . gmdate("Y-m-d 23:59:59") . "' {$plugins_sql} {$sensor_where} {$tax_where} \n        GROUP BY suf, intervalo \n        ORDER BY suf, intervalo";
    $rg = $dbconn->CacheExecute($sqlgraph);
    if (!$rg) {
        Av_exception::write_log(Av_exception::DB_ERROR, $dbconn->ErrorMsg());
    } else {
        while (!$rg->EOF) {
            $hours = $rg->fields['intervalo'] . ' ' . substr($rg->fields['suf'], 0, 3);
            $data[$hours] = $rg->fields['num_events'];
            $rg->MoveNext();
        }
    }
    $db->close();
    return $param != '' ? array($data, $plugins) : $data;
}
开发者ID:jackpf,项目名称:ossim-arc,代码行数:37,代码来源:event_trends.php


示例7: get_user_icon

function get_user_icon($login, $pro)
{
    require_once 'ossim_db.inc';
    $db = new ossim_db();
    $dbconn = $db->connect();
    $user = Session::get_list($dbconn, "WHERE login='{$login}'");
    if ($pro) {
        // Pro-version
        if ($login == ACL_DEFAULT_OSSIM_ADMIN || $user[0]->get_is_admin()) {
            return "../pixmaps/user-gadmin.png";
        } elseif (Acl::is_proadmin($dbconn, $user[0]->get_login())) {
            return "../pixmaps/user-business.png";
        } else {
            return "../pixmaps/user-green.png";
        }
    } else {
        // Opensource
        if ($login == ACL_DEFAULT_OSSIM_ADMIN || $user[0]->get_is_admin()) {
            return "../pixmaps/user-gadmin.png";
        } else {
            return "../pixmaps/user-green.png";
        }
    }
}
开发者ID:jhbsz,项目名称:ossimTest,代码行数:24,代码来源:opened_sessions.php


示例8: CONCAT

*
*/
require_once 'av_init.php';
if (Session::menu_perms("report-menu", "ReportsReportServer")) {
    include_once 'updateBd.php';
    require_once 'common.php';
    include 'general.php';
    /*
     * PCI Version, if 3.0 then this variable is predefined in PCI-DSS3.php
     * The code is shared with this only diference
     */
    $pci_version = $pci_version != '' ? $pci_version : '';
    $sql_year = "STR_TO_DATE( CONCAT( a.year, '-', a.month, '-', a.day ) , '%Y-%m-%d' ) >= '{$date_from}' AND STR_TO_DATE( CONCAT( a.year, '-', a.month, '-', a.day ) , '%Y-%m-%d' ) <= '{$date_to}'";
    //create
    require_once 'ossim_db.inc';
    $db1 = new ossim_db();
    $conn1 = $db1->connect();
    // Check if PCI database exists
    if (!pci_database_available($conn1, "PCI{$pci_version}")) {
        $htmlPdfReport->pageBreak();
        $htmlPdfReport->setBookmark($title);
        $htmlPdfReport->set($htmlPdfReport->newTitle($title, "", "", null));
        $htmlPdfReport->set('<table align="center" width="750" cellpadding="0" cellspacing="0"><tr><td>' . _('Database not found') . ': PCI' . $pci_version . '</td></tr></table><br/><br/>');
        $db1->close();
    } else {
        tmp_insert($conn1, "PCI{$pci_version}.R01_FW_Config");
        tmp_insert($conn1, "PCI{$pci_version}.R02_Vendor_default");
        tmp_insert($conn1, "PCI{$pci_version}.R03_Stored_cardholder");
        tmp_insert($conn1, "PCI{$pci_version}.R04_Data_encryption");
        tmp_insert($conn1, "PCI{$pci_version}.R05_Antivirus");
        tmp_insert($conn1, "PCI{$pci_version}.R06_System_app");
开发者ID:jackpf,项目名称:ossim-arc,代码行数:31,代码来源:PCI-DSS.php


示例9: SendHeader


//.........这里部分代码省略.........
                 send($(this).val(), $('#interface option:selected').text());
             });
             
             <?php 
    if (isset($_POST['ip'])) {
        ?>
                 send('<?php 
        echo Util::htmlentities($_POST['ip']);
        ?>
', $('#interface option:selected').text());
                 <?php 
    }
    ?>
             // ************

             $('.scriptinfo').tipTip({
                 defaultPosition: "down",
                 content: function (e) {
                    
                    var ip_data = $(this).attr('data-title');
                        ip_data = ip_data.split('-');
                    
                    $.ajax({
                        url: '../alarm/alarm_netlookup.php?ip=' + ip_data[0],
                        success: function (response) {
                          e.content.html(response); // the var e is the callback function data (see above)
                        }
                    });
                    return '<?php 
    echo _("Searching") . "...";
    ?>
'; // We temporary show a Please wait text until the ajax success callback is called.
                 }
              });
  			
			$(".repinfo").tipTip({
				defaultPosition: 'left',
				content: function (e) { 
					return $(this).attr('txt');
				}
			});  
                
			$('#filter').on('keyup', function(e){
                $(this).val(function(i, val) {
					return val.replace(/[\t\r\b]/g, '');
				});
			});
										  
			<?php 
    if (GET('ip') != "") {
        ?>
				$("#process_button").click();
				<?php 
    }
    ?>
			
		}

		function lastsessions() {
			$('#modeselect0').click();
			$("#listN option[value='3']").attr('selected', 'selected');
			$("#process_button").click();
		}
		
		function launch(val,order) {
			$('#modeselect1').click();
			$("#TopN option[value='0']").attr('selected', 'selected');
			$("#StatTypeSelector option[value='"+val+"']").attr('selected', 'selected');
			$("#statorder option[value='"+order+"']").attr('selected', 'selected');
			$("#process_button").click();
		}
		
		function remote_interface(ip) {
			$("#FlowProcessingForm").attr("action", "menu.php");
			$("#FlowProcessingForm").attr("target", "menu_nfsen");
			$("#FlowProcessingForm").append("<input type='hidden' name='process' value='Process' />");
			$("#FlowProcessingForm").append("<input type='hidden' name='ip' value='"+ip+"' />");
			$("#FlowProcessingForm").submit();
		}
		
		function clean_remote_data() {
			$("#FlowProcessingForm").removeAttr("target");
			$("#FlowProcessingForm").attr("action", $("#FlowProcessingForm").attr("laction")); // set the local action
		}
	</script>	
</head>

<body>

<?php 
    $db_aux = new ossim_db();
    $conn_aux = $db_aux->connect();
    $aux_ri_interfaces = Remote_interface::get_list($conn_aux, "WHERE status = 1");
    $ri_list = $aux_ri_interfaces[0];
    $ri_total = $aux_ri_interfaces[1];
    $db_aux->close();
    if (Session::am_i_admin() && count($ri_total) > 0) {
        include 'menu.php';
    }
}
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:101,代码来源:nfsen.php


示例10: header

header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
require_once 'av_init.php';
Session::logcheck("analysis-menu", "EventsForensics");
$search = trim(GET('q'));
$max = intval(GET('limit'));
if (!$max) {
    $max = 50;
}
ossim_valid($search, OSS_NULLABLE, OSS_NOECHARS, OSS_ALPHA, OSS_SCORE, OSS_PUNC, 'illegal:' . _("search"));
if (ossim_error()) {
    die;
}
$db = new ossim_db(TRUE);
if (is_array($_SESSION['server']) && $_SESSION['server'][0] != '') {
    $conn = $db->custom_connect($_SESSION["server"][0], $_SESSION["server"][2], $_SESSION["server"][3]);
} else {
    $conn = $db->connect();
}
$params = array();
$filter = '';
if (!empty($search)) {
    $filter = 'WHERE INET6_NTOA(device_ip) LIKE CONCAT("%",?,"%")';
    $params[] = $search;
}
$query = "SELECT DISTINCT INET6_NTOA(device_ip) as ip FROM alienvault_siem.device {$filter}";
$rs = $conn->Execute($query, $params);
if ($rs) {
    while (!$rs->EOF) {
开发者ID:jackpf,项目名称:ossim-arc,代码行数:31,代码来源:base_devices.php


示例11: SIEM_trends_hids

function SIEM_trends_hids($agent_ip)
{
    include_once '../panel/sensor_filter.php';
    require_once 'classes/Plugin.inc';
    require_once 'classes/Util.inc';
    require_once 'ossim_db.inc';
    $tz = Util::get_timezone();
    $tzc = Util::get_tzc($tz);
    $data = array();
    $plugins = $plugins_sql = "";
    $db = new ossim_db();
    $dbconn = $db->connect();
    $sensor_where = make_sensor_filter($dbconn);
    // Ossec filter
    $oss_p_id_name = Plugin::get_id_and_name($dbconn, "WHERE name LIKE 'ossec%'");
    $plugins = implode(",", array_flip($oss_p_id_name));
    $plugins_sql = "AND acid_event.plugin_id in ({$plugins})";
    // Agent ip filter
    $agent_where = make_sid_filter($dbconn, $agent_ip);
    if ($agent_where == "") {
        $agent_where = "0";
    }
    $sqlgraph = "SELECT COUNT(acid_event.sid) as num_events, day(convert_tz(timestamp,'+00:00','{$tzc}')) as intervalo, monthname(convert_tz(timestamp,'+00:00','{$tzc}')) as suf FROM snort.acid_event LEFT JOIN ossim.plugin ON acid_event.plugin_id=plugin.id WHERE sid in ({$agent_where}) AND timestamp BETWEEN '" . gmdate("Y-m-d 00:00:00", gmdate("U") - 604800) . "' AND '" . gmdate("Y-m-d 23:59:59") . "' {$plugins_sql} {$sensor_where} GROUP BY suf,intervalo ORDER BY suf,intervalo";
    //print $sqlgraph;
    if (!($rg =& $dbconn->Execute($sqlgraph))) {
        return false;
    } else {
        while (!$rg->EOF) {
            $hours = $rg->fields["intervalo"] . " " . substr($rg->fields["suf"], 0, 3);
            $data[$hours] = $rg->fields["num_events"];
            $rg->MoveNext();
        }
    }
    $db->close($dbconn);
    return $data;
}
开发者ID:jhbsz,项目名称:ossimTest,代码行数:36,代码来源:utils.php


示例12: PrintPredefinedViews

function PrintPredefinedViews()
{
    global $opensource;
    $current_str = $_SESSION['current_cview'] != "default" && $_SESSION['current_cview'] != "" ? Util::htmlentities($_SESSION['current_cview']) : _("Default");
    // Get default view
    require_once "ossim_conf.inc";
    $conf = $GLOBALS["CONF"];
    $idm_enabled = $conf->get_conf("enable_idm") == 1 && Session::is_pro() ? true : false;
    $login = Session::get_session_user();
    $db_aux = new ossim_db(true);
    $conn_aux = $db_aux->connect();
    $config = new User_config($conn_aux);
    $default_view = $config->get($login, 'custom_view_default', 'php', "siem") != "" ? $config->get($login, 'custom_view_default', 'php', "siem") : ($idm_enabled ? 'IDM' : 'default');
    $db_aux->close($conn_aux);
    ?>
    <button id="views_link" class="button av_b_secondary">
        <?php 
    echo _('Change View');
    ?>
 &nbsp;&#x25be;
    </button>

    <div id="custom_views" class="dropdown dropdown-secondary dropdown-close dropdown-tip dropdown-anchor-right dropdown-scrolling" style='display:none'>
        <ul id="custom_views_ul" class="dropdown-menu">
            <?php 
    if (Session::am_i_admin()) {
        ?>
            <li><a href="#" onclick="GB_show('<?php 
        echo _("Edit Current View");
        ?>
','/forensics/custom_view_edit.php?edit=1',480,700);$('#custom_views').hide();return false"><?php 
        echo _("Edit Current View");
        ?>
&nbsp;</a></li>
            <li><a href="#" onclick="GB_show('<?php 
        echo _("Create new custom view");
        ?>
','/forensics/custom_view_edit.php',480,700);$('#custom_views').hide();return false"><?php 
        echo _("Create New View");
        ?>
&nbsp;</a></li>
            <?php 
    }
    foreach ($_SESSION['views'] as $name => $attr) {
        $dname = $name == "default" ? "Default" : $name;
        $selected = $_SESSION['current_cview'] == $name ? "&#x25BA;&nbsp;" : "";
        ?>
                <li><a href="#" onclick="change_view('<?php 
        echo Util::htmlentities($name);
        ?>
');$('#custom_views').hide()"><?php 
        echo $selected . Util::htmlentities($dname);
        ?>
&nbsp;</a></li>
            <?php 
    }
    ?>
        </ul>
    </div>

    <?php 
}
开发者ID:jackpf,项目名称:ossim-arc,代码行数:62,代码来源:base_output_html.inc.php


示例13: ossim_db

*
*
* 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", "ControlPanelAlarms");
$vars = $_SESSION['_kdb_alarm_vars'];
$plugin_id = $_SESSION['_kdb_alarm_pid'];
$plugin_sid = $_SESSION['_kdb_alarm_psid'];
$docs = 0;
if ($plugin_id != '' && $plugin_sid != '') {
    $db_kdb = new ossim_db();
    $conn_kdb = $db_kdb->connect();
    //Taxonomy
    $ptype = Product_type::get_product_type_by_plugin($conn_kdb, $plugin_id);
    $cat = Category::get_category_subcategory_by_plugin($conn_kdb, $plugin_id, $plugin_sid);
    $keyname = (empty($ptype['id']) ? 0 : $ptype['id']) . "##" . (empty($cat['cid']) ? 0 : $cat['cid']) . "##" . (empty($cat['scid']) ? 0 : $cat['scid']);
    $repository_list['taxonomy'] = Repository::get_repository_linked($conn_kdb, $keyname, 'taxonomy');
    //Directive
    if ($plugin_id == '1505') {
        $repository_list['directive'] = Repository::get_linked_by_directive($conn_kdb, $plugin_sid);
    }
    //Plugin SID
    $keyname = "{$plugin_sid}##{$plugin_id}";
    $repository_list['plugin_sid'] = Repository::get_repository_linked($conn_kdb, $keyname, 'plugin_sid');
    $docs = count($repository_list['directive']) + count($repository_list['plugin_sid']) + count($repository_list['taxonomy']);
    $db_kdb->close($conn_kdb);
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:31,代码来源:kdb.php


示例14: GetOssimNetworkGroups

function GetOssimNetworkGroups()
{
    require_once "classes/Net_group.inc";
    require_once 'ossim_db.inc';
    $db = new ossim_db();
    $conn = $db->connect();
    $pg = array();
    $groups = Net_group::get_list($conn, "", " ORDER BY name");
    foreach ($groups as $ng) {
        $pg[] = $ng->get_name();
    }
    $conn->disconnect();
    return $pg;
}
开发者ID:jhbsz,项目名称:ossimTest,代码行数:14,代码来源:base_common.php


示例15: query_inventory

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);
    }
//.........这里部分代码省略.........
开发者ID:jhbsz,项目名称:ossimTest,代码行数:101,代码来源:functions.php


示例16: ossim_db

/*                                                         */
/* This program is intended for use in an authorized       */
/* manner only, and the author can not be held liable for  */
/* anything done with this program, code, or items         */
/* discovered with this program's use.                     */
/***********************************************************/
require_once 'av_init.php';
require_once 'functions.inc';
require_once 'config.php';
require_once 'ossim_sql.inc';
Session::logcheck("environment-menu", "EventsVulnerabilities");
$conf = $GLOBALS["CONF"];
$version = $conf->get_conf("ossim_server_version");
$nessus_path = $conf->get_conf("nessus_path");
$pro = Session::is_pro();
$db = new ossim_db();
$dbconn = $db->connect();
$dbconn->SetFetchMode(ADODB_FETCH_BOTH);
$getParams = array("disp", "item", "page", "delete", "prefs", "uid", "sid", "op", "confirm", "preenable", "bEnable");
$postParams = array("disp", "saveplugins", "page", "delete", "prefs", "uid", "sid", "op", "sname", "sdescription", "sautoenable", "item", "AllPlugins", "NonDoS", "DisableAll", "submit", "fam", "cloneid", "stype", "importplugins", "tracker", "preenable", "bEnable", "user", "entity");
switch ($_SERVER['REQUEST_METHOD']) {
    case "GET":
        foreach ($getParams as $gp) {
            if (isset($_GET[$gp])) {
                ${$gp} = Util::htmlentities(escape_sql(trim(GET($gp)), $dbconn), ENT_QUOTES);
            } else {
                ${$gp} = "";
            }
        }
        $submit = "";
        $AllPlugins = "";
开发者ID:jackpf,项目名称:ossim-arc,代码行数:31,代码来源:settings.php


示例17: GET

*
* Otherwise you can read it here: http://www.gnu.org/licenses/gpl-2.0.txt
*
*/
require_once 'av_init.php';
Session::logcheck("environment-menu", "ReportsWireless");
require_once 'Wireless.inc';
$order = GET('order');
$si = intval(GET('index'));
$sensors = isset($_SESSION['sensors'][$si]) ? $_SESSION['sensors'][$si] : "";
ossim_valid($order, OSS_ALPHA, OSS_NULLABLE, 'illegal: order');
ossim_valid($sensors, OSS_ALPHA, OSS_PUNC, 'illegal: sensors');
if (ossim_error()) {
    die(ossim_error());
}
$db = new ossim_db();
$conn = $db->snort_connect();
?>
<table class="table_data" id="results">
	<thead>
        <tr>
            <th style='width:250px;'><?php 
echo _("Signature");
?>
</th>
            <th><?php 
echo _("Total #");
?>
</th>
            <th><?php 
echo _("Wireless IDS<br/>Sensor");
开发者ID:jackpf,项目名称:ossim-arc,代码行数:31,代码来源:events.php


示例18: end_upgrade

 function end_upgrade($logfile)
 {
     $conn = new ossim_db();
     $db = $conn->connect();
     //
     // PROPERTIES
     //
     $properties = array();
     $db->StartTrans();
     $rs = $db->Execute("SELECT hex(host_id) as id,property_ref,last_modified,source_id,value,extra,tzone FROM alienvault.host_properties WHERE property_ref>0");
     while (!$rs->EOF) {
         $properties[] = $rs->fields;
         $rs->MoveNext();
     }
     $db->Execute("DELETE FROM alienvault.host_properties");
     @file_put_contents($logfile, $db->ErrorMsg(), FILE_APPEND);
     foreach ($properties as $prop) {
         $values = json_decode($prop['value'], true);
         $sql = "INSERT IGNORE INTO alienvault.host_properties (host_id, property_ref, last_modified, source_id, value, extra, tzone) VALUES (UNHEX(?), ? ,? ,? ,? ,? ,?)";
         if (json_last_error() === JSON_ERROR_NONE && is_array($values)) {
             foreach ($values as $value) {
                 if ($prop['property_ref'] == 3) {
                     $value = preg_replace("/\\b(\\w+)\\s+\\1\\b/i", "\$1", preg_replace("/(.*?):(.*)/", "\$1 \$2", $value));
                 } elseif ($prop['property_ref'] == 8) {
                     $value = preg_replace("/\\|/", "@", $value);
                 }
                 $params = array($prop['id'], $prop['property_ref'], $prop['last_modified'], $prop['source_id'], $value, $prop['extra'], $prop['tzone']);
                 $db->Execute($sql, $params);
                 @file_put_contents($logfile, $db->ErrorMsg(), FILE_APPEND);
                 if ($prop['property_ref'] == 3) {
                     break;
                     // Only the first OS
                 }
             }
         } else {
             if ($prop['property_ref'] == 3) {
                 $prop['value'] = preg_replace("/\\b(\\w+)\\s+\\1\\b/i", "\$1", preg_replace("/(.*?):(.*)/", "\$1 \$2", $prop['value']));
             } elseif ($prop['property_ref'] == 8) {
                 $prop['value'] = preg_replace("/\\|/", "@", $prop['value']);
             }
             $params = array($prop['id'], $prop['property_ref'], $prop['last_modified'], $prop['source_id'], $prop['value'], $prop['extra'], $prop['tzone']);
             $db->Execute($sql, $params);
             @file_put_contents($logfile, $db->ErrorMsg(), FILE_APPEND);
         }
     }
     if (!$db->CompleteTrans()) {
         @file_put_contents($logfile, $db->ErrorMsg(), FILE_APPEND);
         return 1;
     }
     $db->Execute("DELETE FROM alienvault.host_properties WHERE value like 'unknown%'");
     @file_put_contents($logfile, $db->ErrorMsg(), FILE_APPEND);
     // HOST SOFTWARE CPE
     $cpes = array();
     $db->StartTrans();
     $rs = $db->Execute("SELECT DISTINCT cpe FROM host_software");
     while (!$rs->EOF) {
         $cpes[] = $rs->fields['cpe'];
         $rs->MoveNext();
     }
     foreach ($cpes as $cpe) {
         $params = array(Asset_host_software::get_software_name_by_cpe($db, $cpe), $cpe);
         $db->Execute("UPDATE host_software SET banner=? WHERE cpe=?", $params);
         @file_put_contents($logfile, $db->ErrorMsg(), FILE_APPEND);
     }
     if (!$db->CompleteTrans()) {
         @file_put_contents($logfile, $db->ErrorMsg(), FILE_APPEND);
         return 1;
     }
     //
     // VULN_JOB_ASSET
     //
     $jobs = array();
     $db->StartTrans();
     $rs = $db->Execute("SELECT id,meth_TARGET FROM alienvault.vuln_job_schedule");
     while (!$rs->EOF) {
         $jobs[] = array('id' => $rs->fields['id'], 'targets' => explode("\n", $rs->fields['meth_TARGET']));
         $rs->MoveNext();
     }
     foreach ($jobs as $job) {
         $db->Execute("DELETE FROM alienvault.vuln_job_assets WHERE job_id=? AND job_type=0", array($job['id']));
         @file_put_contents($logfile, $db->ErrorMsg(), FILE_APPEND);
         foreach ($job['targets'] as $target) {
             if (preg_match("/(.*)#(.*)/", $target, $matches)) {
                 // ADD ASSET_ID
                 $sql = "INSERT IGNORE INTO alienvault.vuln_job_assets (job_id, job_type, asset_id) VALUES (?, 0, UNHEX(?))";
                 $params = array($job['id'], $matches[1]);
                 $db->Execute($sql, $params);
                 @file_put_contents($logfile, $db->ErrorMsg(), FILE_APPEND);
                 if (preg_match("/\\/\\d+/", $matches[2])) {
                     // NETWORK MEMBERS
                     $sql = "INSERT IGNORE INTO alienvault.vuln_job_assets (job_id, job_type, asset_id) SELECT ?, 0, host_id FROM host_net_reference WHERE net_id=UNHEX(?)";
                     $params = array($job['id'], $matches[1]);
                     $db->Execute($sql, $params);
                     @file_put_contents($logfile, $db->ErrorMsg(), FILE_APPEND);
                 }
             }
         }
     }
     if (!$db->CompleteTrans()) {
         @file_put_contents($logfile, $db->ErrorMsg(), FILE_APPEND);
//.........这里部分代码省略.........
开发者ID:jackpf,项目名称:ossim-arc,代码行数:101,代码来源:5.0.0.php


示例19: ossim_db

}
if ($mode == 'init') {
    ?>
    <script type="text/javascript"> 
        parent.$("#pbar").progressBar(0);    
    </script> 
    <?php 
} else {
    ?>
    <script type="text/javascript">    
        parent.$("#pbar").progressBar();    
    </script> 
    <?php 
}
// Get networks and already hosts
$db = new ossim_db();
$conn_aux = $db->connect();
list($nets, $total) = Asset_net::get_list($conn_aux);
$i = 1;
// Search new hosts by networks
foreach ($nets as $net) {
    session_write_close();
    usleep(500000);
    ob_flush();
    ?>
        	
    <script type="text/javascript">
        parent.$("#pbar").progressBar(<?php 
    echo floor($i * 100 / $total);
    ?>
);
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:31,代码来源:import_all_hosts_from_siem_ajax.php


示例20: get_report_data

function get_report_data($id = NULL)
{
    $conf = $GLOBALS['CONF'];
    $conf = !$conf ? new Ossim_conf() : $conf;
    $y = strftime('%Y', time() - 24 * 60 * 60 * 30);
    $m = strftime('%m', time() - 24 * 60 * 60 * 30);
    $d = strftime('%d', time() - 24 * 60 * 60 * 30);
    $reports['asset_report'] = array('report_name' => _('Asset Details'), 'report_id' => 'asset_report', 'type' => 'external', 'link_id' => 'link_ar_asset', 'link' => '', 'parameters' => array(array('name' => _('Host Name/IP/Network'), 'id' => 'ar_asset', 'type' => 'asset', 'default_value' => '')), 'access' => Session::menu_perms('environment-menu', 'PolicyHosts') || Session::menu_perms('environment-menu', 'PolicyNetworks'), 'send_by_email' => 0);
    $status_values = array('All' => array('text' => _('All')), 'Open' => array('text' => _('Open')), 'Assigned' => array('text' => _('Assigned')), 'Studying' => array('text' => _('Studying')), 'Waiting' => array('text' => _('Waiting')), 'Testing' => array('text' => _('Testing')), 'Closed' => array('text' => _('Closed')));
    $types_values = array('ALL' => array('text' => _('ALL')), 'Expansion Virus' => array('text' => _('Expansion Virus')), 'Corporative Nets Attack' => array('text' => _('Corporative Nets Attack')), 'Policy Violation' => array('text' => _('Policy Violation')), 'Security Weakness' => array('text' => _('Security Weakness')), 'Net Performance' => array('text' => _('Net Performance')), 'Applications and Systems Failures' => array('text' => _('Applications and Systems Failures')), 'Anomalies' => array('text' => _('Anomalies')), 'Vulnerability' => array('text' => _('Vulnerability')));
    $priority_values = array('High' => _('High'), 'Medium' => _('Medium'), 'Low' => _('Low'));
    $reports['tickets_report'] = array('report_name' => _('Tickets Report'), 'report_id' => 'tickets_report', 'type' => 'pdf', 'subreports' => array('title_page' => array('id' => 'title_page', 'name' => _('Title Page'), 'report_file' => 'os_reports/Common/titlepage.php'), 'alarm' => array('id' => 'alarm', 'name' => _('Alarm'), 'report_file' => 'os_reports/Tickets/Alarm.php'), 'event' => arr 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP outerReadBase类代码示例发布时间:2022-05-23
下一篇:
PHP oseRegistry类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap