From 28b0b6863081839121a35f6fad8420ff035cdfa8 Mon Sep 17 00:00:00 2001 From: robiscool Date: Thu, 28 Jul 2011 11:47:04 -0700 Subject: snort-dev, redo ips tab, add js table scripts to ips tabs --- config/snort-dev/css/style_snort2.css | 37 ++++ config/snort-dev/snort_json_get.php | 2 +- config/snort-dev/snort_new.inc | 1 - config/snort-dev/snort_rules_ips.php | 360 +++++++++++++++++++++++++++++++++ config/snort-dev/snort_ruleset_ips.php | 291 -------------------------- 5 files changed, 398 insertions(+), 293 deletions(-) create mode 100644 config/snort-dev/snort_rules_ips.php delete mode 100644 config/snort-dev/snort_ruleset_ips.php diff --git a/config/snort-dev/css/style_snort2.css b/config/snort-dev/css/style_snort2.css index 56fcb833..942f3723 100644 --- a/config/snort-dev/css/style_snort2.css +++ b/config/snort-dev/css/style_snort2.css @@ -6,6 +6,43 @@ a { } */ +/* ips tab css */ + +.nextClickList { + margin-bottom: 5px; +} + +.nextClickListColorEven { + padding-top: 2px; + padding-bottom: 2px; + padding-left: 10px; + padding-right: 10px; + background-color: #ffffff; + font-size: 11px; + border-bottom-color: #999999; + border-bottom-width: 1px; + border-bottom-style: solid; + border-right-color: #999999; + border-right-width: 1px; + border-right-style: solid; +} + +.nextClickListColorOdd { + padding-top: 2px; + padding-bottom: 2px; + padding-left: 10px; + padding-right: 10px; + background-color: #eeeeee; + font-size: 11px; + border-bottom-color: #999999; + border-bottom-width: 1px; + border-bottom-style: solid; + border-right-color: #999999; + border-right-width: 1px; + border-right-style: solid; +} + + #right { position: relative; diff --git a/config/snort-dev/snort_json_get.php b/config/snort-dev/snort_json_get.php index 965ac4de..701e75ae 100644 --- a/config/snort-dev/snort_json_get.php +++ b/config/snort-dev/snort_json_get.php @@ -49,7 +49,7 @@ session_start(); // alwaya at the very top of a php page or "Cannot send session // get json blocls sids if ($_GET['snortsamjson'] == 1) { - exec('cat /usr/local/etc/snort/sn_6TPXv7a/rules/dbBlockSplit/splitSidblock' . $_GET['fileid'] . '.block', $output); + exec('cat /usr/local/etc/snort/sn_6TPXv7a/rules/dbBlockSplit/splitSidblock_' . $_GET['fileid'] . '.block', $output); echo $output[0]; } diff --git a/config/snort-dev/snort_new.inc b/config/snort-dev/snort_new.inc index bba9b93d..0f6a505f 100644 --- a/config/snort-dev/snort_new.inc +++ b/config/snort-dev/snort_new.inc @@ -51,7 +51,6 @@ if(isset($_POST['__csrf_magic'])) { require_once("config.inc"); require_once("functions.inc"); - // create and cp to tmp db dir if (!file_exists('/var/snort/')) { exec('/bin/mkdir -p /var/snort/'); diff --git a/config/snort-dev/snort_rules_ips.php b/config/snort-dev/snort_rules_ips.php new file mode 100644 index 00000000..a7c845da --- /dev/null +++ b/config/snort-dev/snort_rules_ips.php @@ -0,0 +1,360 @@ +. + Copyright (C) 2008-2009 Robert Zelaya. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + 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 page vars + +if (isset($_GET['uuid']) && isset($_GET['rdbuuid'])) { + echo 'Error: more than one uuid'; + exit(0); +} + +// set page vars +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']; +} + +if (empty($rdbuuid)) { + echo 'ERROR: Missing RDBUUID'; + exit; +} + +if (isset($_GET['rulefilename'])) { + $rulefilename = $_GET['rulefilename']; +}else{ + echo 'ERROR: Missing rulefilename'; + exit; +} + + $pgtitle = "Services: Snort: Ruleset Ips:"; + include("/usr/local/pkg/snort/snort_head.inc"); + +?> + + + +
+


Please Wait...

+
+ + + +
+ + + +
+ +
+
+ +
+ + + + + + + + +
+ + + +
+ + +
+ + + +
+ + + + + + + + + + + + + + + + + + +
   On   Sid   Source   Amount   DurationMessage
+
+ + + + +
+ + +
+ + + +
+
+ + + +
+ + + + + + + + + + diff --git a/config/snort-dev/snort_ruleset_ips.php b/config/snort-dev/snort_ruleset_ips.php deleted file mode 100644 index 18c49b35..00000000 --- a/config/snort-dev/snort_ruleset_ips.php +++ /dev/null @@ -1,291 +0,0 @@ -. - Copyright (C) 2008-2009 Robert Zelaya. - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - 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 page vars - -if (isset($_GET['uuid']) && isset($_GET['rdbuuid'])) { - echo 'Error: more than one uuid'; - exit(0); -} - -// set page vars -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', 'Snortrules', 'uuid', $uuid); - -// create dropdown list -function snortDropDownListJson($list, $setting) { - foreach ($list as $iday => $iday2) { - - echo "\n" . "'\' + "\n" +' . "\r"; - - } -} - - $countGetEnableSidArray = count($getEnableSid); - - $pgtitle = "Services: Snort: Ruleset Ips:"; - include("/usr/local/pkg/snort/snort_head.inc"); - -?> - - - -
-


Please Wait...

-
- - - -
- - - -
- -
-
- -
- - - - - - - - -
- - - -
- - -
- - - - - - - - - - -
- - - 1 - - 2 - - -
- - - - - - - - - - - - - - - - - - -
   On   Sid   Source   Amount   DurationMessage
-
- - - - -
- - -
- - - -
-
- - - -
- - - - - - - - - - -- cgit v1.2.3