INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 POSSIBILITY OF SUCH DAMAGE.
*/
require_once "guiconfig.inc";
require_once "/usr/local/pkg/snort/snort_new.inc";
require_once "/usr/local/pkg/snort/snort_gui.inc";
//Set no caching
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-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
// set page vars
$generalSettings = snortSql_fetchAllSettings('snortDB', 'SnortSettings', 'id', '1');
$snortdownload_off = $generalSettings['snortdownload'] == 'off' ? 'checked' : '';
$snortdownload_on = $generalSettings['snortdownload'] == 'on' ? 'checked' : '';
$oinkmastercode = $generalSettings['oinkmastercode'];
$emergingthreatsdownload_off = $generalSettings['emergingthreatsdownload'] == 'off' ? 'checked' : '';
$emergingthreatsdownload_basic = $generalSettings['emergingthreatsdownload'] == 'basic' ? 'checked' : '';
$emergingthreatsdownload_pro = $generalSettings['emergingthreatsdownload'] == 'pro' ? 'checked' : '';
$emergingthreatscode = $generalSettings['emergingthreatscode'];
$updaterules = $generalSettings['updaterules'];
$rm_blocked = $generalSettings['rm_blocked'];
$snortloglimit_off = $generalSettings['snortloglimit'] == 'off' ? 'checked' : '';
$snortloglimit_on = $generalSettings['snortloglimit'] == 'on' ? 'checked' : '';
$snortloglimitsize = $generalSettings['snortloglimitsize'];
$snortalertlogtype = $generalSettings['snortalertlogtype'];
$forcekeepsettings_on = $generalSettings['forcekeepsettings'] == 'on' ? 'checked' : '';
$snortlogCurrentDSKsize = round(exec('df -k /var | grep -v "Filesystem" | awk \'{print $4}\'') / 1024);
Пример #2
0
//Set no caching
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-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
// set page vars
$uuid = $_GET['uuid'];
if (isset($_POST['uuid'])) {
    $uuid = $_POST['uuid'];
}
if ($uuid == '') {
    echo 'error: no uuid';
    exit(0);
}
$a_list = snortSql_fetchAllSettings('snortDB', 'SnortIfaces', 'uuid', $uuid);
if (!is_array($a_list)) {
    $a_list = array();
}
$pgtitle = "Snort: Interface: Barnyard2 Edit";
include "/usr/local/pkg/snort/snort_head.inc";
?>


<!-- START page custom script -->
<script language="JavaScript">

// start a jQuery sand box
jQuery(document).ready(function() { 

	// START disable option for snort_interfaces_edit.php
if (isset($_GET['rdbuuid'])) {
    $rdbuuid = $_GET['rdbuuid'];
} else {
    $ruledbname_pre1 = snortSql_fetchAllSettings('snortDB', 'SnortIfaces', 'uuid', $uuid);
    $rdbuuid = $ruledbname_pre1['ruledbname'];
}
//$a_list = snortSql_fetchAllSettings('snortDBrules', 'SnortIfaces', 'uuid', $uuid);
// list rules in the default dir
$filterDirList = array();
$filterDirList = snortScanDirFilter('/usr/local/etc/snort/snortDBrules/DB/' . $rdbuuid . '/rules', '\\.rules');
// list rules in db that are on in a array
$listOnRules = array();
$listOnRules = snortSql_fetchAllSettings('snortDBrules', 'SnortRuleSetsIps', 'rdbuuid', $rdbuuid);
// list rules in db that are on in a array
$listGenRules = array();
$listGenRules = snortSql_fetchAllSettings('snortDBrules', 'SnortruleGenIps', 'rdbuuid', $rdbuuid);
if (!empty($listOnRules)) {
    foreach ($listOnRules as $val2) {
        if ($val2['enable'] == 'on') {
            $rulesetOn[] = $val2['rulesetname'];
        }
    }
    unset($listOnRules);
}
$pgtitle = "Services: Snort: Ruleset Ips";
include "/usr/local/pkg/snort/snort_head.inc";
?>



Пример #4
0
 function RMlistDelRowFunc()
 {
     $rm_row_list = snortSql_fetchAllSettings($_POST['RMlistDB'], $_POST['RMlistTable'], 'uuid', $_POST['RMlistUuid']);
     // list rules in the default dir
     if ($_POST['RMlistTable'] == 'SnortIfaces') {
         $snortRuleDir = '/usr/local/etc/snort/sn_' . $_POST['RMlistUuid'];
         exec('/bin/rm -r ' . $snortRuleDir);
     }
     // rm ruledb and files
     if ($_POST['RMlistTable'] == 'Snortrules') {
         // remove db tables vals
         snortSql_updatelistDelete($_POST['RMlistDB'], 'SnortruleSets', 'rdbuuid', $_POST['RMlistUuid']);
         snortSql_updatelistDelete($_POST['RMlistDB'], 'SnortruleSigs', 'rdbuuid', $_POST['RMlistUuid']);
         snortSql_updatelistDelete($_POST['RMlistDB'], 'SnortruleSigsIps', 'rdbuuid', $_POST['RMlistUuid']);
         snortSql_updatelistDelete($_POST['RMlistDB'], 'SnortruleSetsIps', 'rdbuuid', $_POST['RMlistUuid']);
         snortSql_updatelistDelete($_POST['RMlistDB'], 'SnortruleGenIps', 'rdbuuid', $_POST['RMlistUuid']);
         // remove dir
         $snortRuleDir = "/usr/local/etc/snort/snortDBrules/DB/{$_POST['RMlistUuid']}";
         exec('/bin/rm -r ' . $snortRuleDir);
     }
     if ($_POST['RMlistTable'] == 'SnortWhitelist') {
         snortSql_updatelistDelete($_POST['RMlistDB'], 'SnortWhitelistips', 'filename', $rm_row_list['filename']);
     }
     snortJsonReturnCode(snortSql_updatelistDelete($_POST['RMlistDB'], $_POST['RMlistTable'], 'uuid', $_POST['RMlistUuid']));
 }
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
$a_rules = array();
$a_rules = snortSql_fetchAllSettings('snortDBrules', 'Snortrules', 'All', '');
if (!is_array($a_rules)) {
    $a_rules = array();
}
if ($a_rules == 'Error') {
    echo 'Error';
    exit(0);
}
// list rules in db that are on in a array
$listOnRules = array();
$listOnRules = snortSql_fetchAllSettings('snortDB', 'SnortIfaces', 'All', '');
$listUsedRules = array();
foreach ($listOnRules as $listOnRule) {
    $listUsedRules[] = $listOnRule['ruledbname'];
}
unset($listOnRules);
$pgtitle = "Services: Snort: Rules";
include "/usr/local/pkg/snort/snort_head.inc";
?>
	
	
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">

<!-- loading msg -->
<div id="loadingWaiting">
	<div class="snortModal" style="top: 200px; left: 700px;">
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-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
// set page vars
$uuid = $_GET['uuid'];
if (isset($_POST['uuid'])) {
    $uuid = $_POST['uuid'];
}
if ($uuid == '') {
    echo 'error: no uuid';
    exit(0);
}
$a_list = snortSql_fetchAllSettings('snortDB', 'SnortIfaces', 'uuid', $uuid);
$a_rules = snortSql_fetchAllSettings('snortDBrules', 'Snortrules', 'All', '');
if (!is_array($a_list)) {
    $a_list = array();
}
$a_whitelist = snortSql_fetchAllWhitelistTypes('SnortWhitelist', 'SnortWhitelistips');
if (!is_array($a_whitelist)) {
    $a_whitelist = array();
}
$a_suppresslist = snortSql_fetchAllWhitelistTypes('SnortSuppress', '');
if (!is_array($a_suppresslist)) {
    $a_suppresslist = array();
}
$pgtitle = "Services: Snort: Interface Edit:";
include "/usr/local/pkg/snort/snort_head.inc";
?>
require_once "/usr/local/pkg/snort/snort_new.inc";
require_once "/usr/local/pkg/snort/snort_gui.inc";
//Set no caching
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-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
if (isset($_GET['rdbuuid'])) {
    $rdbuuid = $_GET['rdbuuid'];
} else {
    $ruledbname_pre1 = snortSql_fetchAllSettings('snortDB', 'SnortIfaces', 'uuid', $uuid);
    $rdbuuid = $ruledbname_pre1['ruledbname'];
}
if ($rdbuuid !== 'default') {
    $a_list = snortSql_fetchAllSettings('snortDBrules', 'Snortrules', 'uuid', $rdbuuid);
    // $a_list returns empty use defaults
    if ($a_list == '') {
        $a_list = array('id' => '', 'date' => date(U), 'uuid' => $rdbuuid, 'ruledbname' => '', 'description' => '');
    }
}
if ($rdbuuid === 'default') {
    // $a_list returns empty use defaults
    if ($a_list == '') {
        $a_list = array('id' => '1', 'date' => date(U), 'uuid' => $rdbuuid, 'ruledbname' => 'default', 'description' => 'Default database');
    }
}
if (!empty($a_list['id'])) {
    $disabled = 'disabled="disabled"';
} else {
    $disabled = '';
Пример #8
0
if (isset($_GET['uuid'])) {
    $uuid = $_GET['uuid'];
}
if (isset($_GET['rdbuuid'])) {
    $rdbuuid = $_GET['rdbuuid'];
} else {
    $ruledbname_pre1 = snortSql_fetchAllSettings('snortDB', 'SnortIfaces', 'uuid', $uuid);
    $rdbuuid = $ruledbname_pre1['ruledbname'];
}
//$a_list = snortSql_fetchAllSettings('snortDBrules', 'SnortIfaces', 'uuid', $uuid);
// list rules in the default dir
$filterDirList = array();
$filterDirList = snortScanDirFilter('/usr/local/etc/snort/snortDBrules/DB/' . $rdbuuid . '/rules', '\\.rules');
// list rules in db that are on in a array
$listOnRules = array();
$listOnRules = snortSql_fetchAllSettings('snortDBrules', 'SnortRuleSets', 'rdbuuid', $rdbuuid);
if (!empty($listOnRules)) {
    foreach ($listOnRules as $val2) {
        if ($val2['enable'] == 'on') {
            $rulesetOn[] = $val2['rulesetname'];
        }
    }
    unset($listOnRules);
}
$pgtitle = "Snort: Interface Rule Categories";
include "/usr/local/pkg/snort/snort_head.inc";
?>



//Set no caching
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-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
// set page vars
$uuid = $_GET['uuid'];
if (isset($_POST['uuid'])) {
    $uuid = $_POST['uuid'];
}
if ($uuid == '') {
    echo 'error: no uuid';
    exit(0);
}
$a_list = snortSql_fetchAllSettings('snortDB', 'SnortSuppress', 'uuid', $uuid);
// $a_list returns empty use defaults
if ($a_list == '') {
    $a_list = array('id' => '', 'date' => date(U), 'uuid' => $uuid, 'filename' => '', 'description' => '', 'suppresspassthru' => '');
}
$pgtitle = 'Services: Snort: Suppression: Edit';
include '/usr/local/pkg/snort/snort_head.inc';
?>
		
	
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">

<!-- loading msg -->
<div id="loadingWaiting">
	<div class="snortModal" style="top: 200px; left: 700px;">
		<div class="snortModalTop">
Пример #10
0
if (empty($rdbuuid)) {
    echo 'ERROR: Missing RDBUUID';
    exit;
}
if (isset($_GET['rulefilename'])) {
    $rulefilename = $_GET['rulefilename'];
} else {
    echo 'ERROR: Missing rulefilename';
    exit;
}
// get default settings
$listGenRules = array();
$listGenRules = snortSql_fetchAllSettings('snortDBrules', 'SnortruleGenIps', 'rdbuuid', $rdbuuid);
// get sigs in db
$listSigRules = array();
$listSigRules = snortSql_fetchAllSettings('snortDBrules', 'SnortruleSigsIps', 'rdbuuid', $rdbuuid);
// if $listGenRules empty list defaults
if (empty($listGenRules)) {
    $listGenRules[0] = array('id' => 1, 'rdbuuid' => $_POST['rdbuuid'], 'enable' => 'on', 'who' => 'src', 'timeamount' => 15, 'timetype' => 'minutes');
}
$pgtitle = "Services: Snort: Ruleset Ips:";
include "/usr/local/pkg/snort/snort_head.inc";
?>

<body link="#0000CC" vlink="#0000CC" alink="#0000CC">

<div id="loadingWaiting">
  <p class="loadingWaitingMessage"><img src="./images/loading.gif" /> <br>Please Wait...</p>
</div>

<?php 
//Set no caching
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-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
//$GLOBALS['csrf']['rewrite-js'] = false;
$uuid = $_GET['uuid'];
if (isset($_POST['uuid'])) {
    $uuid = $_POST['uuid'];
}
if ($uuid == '') {
    echo 'error: no uuid';
    exit(0);
}
$a_list = snortSql_fetchAllSettings('snortDB', 'SnortWhitelist', 'uuid', $uuid);
// $a_list returns empty use defaults
if ($a_list == '') {
    $a_list = array('id' => '', 'date' => date(U), 'uuid' => $uuid, 'filename' => '', 'snortlisttype' => 'whitelist', 'description' => '', 'wanips' => 'on', 'wangateips' => 'on', 'wandnsips' => 'on', 'vips' => 'on', 'vpnips' => 'on');
}
$listFilename = $a_list['filename'];
$a_list['list'] = snortSql_fetchAllSettingsList('SnortWhitelistips', $listFilename);
$wanips_chk = $a_list['wanips'];
$wanips_on = $wanips_chk == 'on' ? 'checked' : '';
$wangateips_chk = $a_list['wangateips'];
$wangateips_on = $wangateips_chk == 'on' ? 'checked' : '';
$wandnsips_chk = $a_list['wandnsips'];
$wandnsips_on = $wandnsips_chk == 'on' ? 'checked' : '';
$vips_chk = $a_list['vips'];
$vips_on = $vips_chk == 'on' ? 'checked' : '';
$vpnips_chk = $a_list['vpnips'];