예제 #1
0
require_once 'ossim_db.inc';
require_once 'ossim_conf.inc';
include "functions.php";
$new = GET('new') == "1" ? 1 : 0;
$ip = GET('ip');
ossim_valid($ip, OSS_IP_ADDR, OSS_NULLABLE, 'illegal:' . _("ip"));
if (ossim_error()) {
    die(ossim_error());
}
// Database Object
$db = new ossim_db();
$conn = $db->connect();
$net_search = Net::GetClosestNet($conn, $ip, 1);
// Get Networks
list($_sensors, $_hosts) = Host::get_ips_and_hostname($conn, true);
$_nets = Net::get_all($conn, true);
$networks = $hosts = "";
foreach ($_nets as $_net) {
    $networks .= '{ txt:"' . $_net->get_name() . ' [' . $_net->get_ips() . ']", id: "' . $_net->get_ips() . '" },';
}
foreach ($_hosts as $_ip => $_hostname) {
    if ($_hostname != $_ip) {
        $hosts .= '{ txt:"' . $_ip . ' [' . $_hostname . ']", id: "' . $_ip . '" },';
    } else {
        $hosts .= '{ txt:"' . $_ip . '", id: "' . $_ip . '" },';
    }
}
// Get Services and OS
$inventory = "";
$query = "(SELECT DISTINCT os as element FROM host_os ORDER BY os) UNION (SELECT DISTINCT service as element FROM host_services ORDER BY service)";
if (!($rs =& $conn->Execute($query, $params))) {
예제 #2
0
* Classes list:
*/
require_once 'classes/Security.inc';
require_once 'classes/Session.inc';
require_once 'languages.inc';
Session::logcheck("MenuConfiguration", "ConfigurationUsers");
?>

<?php 
require_once 'ossim_acl.inc';
require_once 'ossim_db.inc';
require_once 'classes/Net.inc';
require_once 'classes/Sensor.inc';
$db = new ossim_db();
$conn = $db->connect();
$net_list = Net::get_all($conn);
$sensor_list = Sensor::get_all($conn, "ORDER BY name ASC");
$pass_length_min = $conf->get_conf("pass_length_min", FALSE) ? $conf->get_conf("pass_length_min", FALSE) : 7;
$pass_length_max = $conf->get_conf("pass_length_max", FALSE) ? $conf->get_conf("pass_length_max", FALSE) : 255;
if ($pass_length_max < $pass_length_min || $pass_length_max < 1) {
    $pass_length_max = 255;
}
?>
<!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"/>
예제 #3
0
* Otherwise you can read it here: http://www.gnu.org/licenses/gpl-2.0.txt
****************************************************************************/
require_once 'classes/Session.inc';
//Session::logcheck("MenuPolicy", "PolicyHosts");
require_once 'classes/Security.inc';
require_once 'ossim_db.inc';
require_once 'classes/Net.inc';
$ip = GET('ip');
if ($ip != "") {
    ossim_valid($ip, OSS_IP_ADDR, OSS_NULLABLE, 'illegal:' . _("ip"));
    if (ossim_error()) {
        //die(ossim_error());
        $conf = $GLOBALS["CONF"];
        $threshold = $conf->get_conf("threshold");
        echo "2;" . $threshold . ";" . $threshold;
        exit;
    }
    $db = new ossim_db();
    $conn = $db->connect();
    $nets = Net::get_all($conn);
    foreach ($nets as $net) {
        if (Net::is_ip_in_cache_cidr($conn, $ip, $net->get_ips())) {
            echo $net->get_asset() . ";" . $net->get_threshold_c() . ";" . $net->get_threshold_a();
            exit;
        }
    }
    echo "0";
    $db->close($conn);
} else {
    echo "0";
}