diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/snort/snort.inc | 12 | ||||
-rw-r--r-- | config/snort/snort.xml | 2 | ||||
-rw-r--r-- | config/snort/snort_rules.php | 8 | ||||
-rw-r--r-- | config/snort/snort_rules_edit.php | 73 |
4 files changed, 39 insertions, 56 deletions
diff --git a/config/snort/snort.inc b/config/snort/snort.inc index 82cfcfd6..e8eaec44 100644 --- a/config/snort/snort.inc +++ b/config/snort/snort.inc @@ -37,7 +37,7 @@ require_once("functions.inc"); require_once("filter.inc"); /* package version */ -$snort_package_version = 'Snort 2.8.6.1 pkg v. 2.0'; +$snort_package_version = 'Snort 2.9.0.5 pkg v. 2.0'; /* Allow additional execution time 0 = no limit. */ ini_set('max_execution_time', '9999'); @@ -55,13 +55,11 @@ if (intval($config['version']) > 6) else $snort_pfsense_basever = 'yes'; -$snort_freebsd_ver = php_uname("r"); -$snort_freebsd_ver = $snort_freebsd_ver[0]; /* find out what arch where in x86 , x64 */ $snort_arch_ck = php_uname("m"); if ($snort_arch_ck == 'i386') $snort_arch = 'x86'; -else if ($snort_arch_ck = "amd64") +else if ($snort_arch_ck == "amd64") $snort_arch = 'x64'; else $snort_arch = "Unknown"; @@ -482,7 +480,7 @@ function post_delete_logs() function snort_postinstall() { - global $config, $g, $snort_pfsense_basever, $snort_arch, $snort_freebsd_ver; + global $config, $g, $snort_pfsense_basever, $snort_arch; /* snort -> advanced features */ if (is_array($config['installedpackages']['snortglobal'])) { @@ -596,9 +594,9 @@ function snort_postinstall() exec('/usr/bin/fetch -o /usr/local/bin/barnyard2 http://www.pfsense.com/packages/config/snort/bin/7.3.x86/barnyard2'); else if ($snort_pfsense_basever == 'no') { if ($snort_arch == 'x64') - exec("/usr/bin/fetch -o /usr/local/bin/barnyard2 http://files.pfsense.org/packages/amd64/{$snort_freebsd_ver}/All/barnyard2"); + exec("/usr/bin/fetch -o /usr/local/bin/barnyard2 http://files.pfsense.org/packages/amd64/8/All/barnyard2"); else - exec("/usr/bin/fetch -o /usr/local/bin/barnyard2 http://files.pfsense.org/packages/{$snort_freebsd_ver}/All/barnyard2"); + exec("/usr/bin/fetch -o /usr/local/bin/barnyard2 http://files.pfsense.org/packages/8/All/barnyard2"); exec('/bin/chmod 0755 /usr/local/bin/barnyard2'); } update_output_window(gettext("Finnished Installing Barnyard2...")); diff --git a/config/snort/snort.xml b/config/snort/snort.xml index 9d14c9ec..fe6a9ace 100644 --- a/config/snort/snort.xml +++ b/config/snort/snort.xml @@ -47,7 +47,7 @@ <faq>Currently there are no FAQ items provided.</faq> <name>Snort</name> <version>2.8.6</version> - <title>Services:2.8.6 pkg v. 1.30</title> + <title>Services:2.9.0.5 pkg v. 2.0</title> <include_file>/usr/local/pkg/snort/snort.inc</include_file> <menu> <name>Snort</name> diff --git a/config/snort/snort_rules.php b/config/snort/snort_rules.php index 3975fd2c..75233529 100644 --- a/config/snort/snort_rules.php +++ b/config/snort/snort_rules.php @@ -43,6 +43,10 @@ $a_nat = &$config['installedpackages']['snortglobal']['rule']; $id = $_GET['id']; if (isset($_POST['id'])) $id = $_POST['id']; +if (is_null($id)) { + header("Location: /snort/snort_interfaces.php"); + exit; +} if (isset($id) && $a_nat[$id]) { $pconfig['enable'] = $a_nat[$id]['enable']; @@ -185,8 +189,8 @@ if ($_GET['openruleset'] != '' && $_GET['ids'] != '') { } */ -//$ruledir = "/usr/local/etc/snort/snort_{$iface_uuid}_{$if_real}/rules/"; -$ruledir = "/usr/local/etc/snort/rules/"; +$ruledir = "/usr/local/etc/snort/snort_{$iface_uuid}_{$if_real}/rules/"; +//$ruledir = "/usr/local/etc/snort/rules/"; $dh = opendir($ruledir); while (false !== ($filename = readdir($dh))) { diff --git a/config/snort/snort_rules_edit.php b/config/snort/snort_rules_edit.php index bac04f68..666147dc 100644 --- a/config/snort/snort_rules_edit.php +++ b/config/snort/snort_rules_edit.php @@ -1,6 +1,6 @@ <?php /* - system_edit.php + snort_rules_edit.php Copyright (C) 2004, 2005 Scott Ullrich Copyright (C) 2011 Ermal Luci All rights reserved. @@ -44,8 +44,6 @@ require_once("/usr/local/pkg/snort/snort_gui.inc"); if (!is_array($config['installedpackages']['snortglobal']['rule'])) { $config['installedpackages']['snortglobal']['rule'] = array(); } - -//nat_rules_sort(); $a_nat = &$config['installedpackages']['snortglobal']['rule']; $id = $_GET['id']; @@ -64,8 +62,13 @@ if (isset($id) && $a_nat[$id]) { //get rule id $lineid = $_GET['ids']; +if (isset($_POST['ids'])) + $lineid = $_POST['ids']; $file = $_GET['openruleset']; +if (isset($_POST['openruleset'])) + $file = $_POST['openruleset']; + //read file into string, and get filesize also chk for empty files if (filesize($file) > 0 ) { $contents2 = file_get_contents($file); @@ -80,23 +83,16 @@ $delimiter = "\n"; $splitcontents = explode($delimiter, $contents2); if ($_POST) { - if($_POST['highlight'] <> "") { - if($_POST['highlight'] == "yes" or - $_POST['highlight'] == "enabled") { - $highlight = "yes"; - } else { - $highlight = "no"; - } - } else { - $highlight = "no"; - } + $highlight = "no"; + if($_POST['highlight'] == "yes") + $highlight = "yes"; - if($_POST['rows'] <> "") + if ($_POST['rows'] <> "") $rows = $_POST['rows']; else $rows = 1; - if($_POST['cols'] <> "") + if ($_POST['cols'] <> "") $cols = $_POST['cols']; else $cols = 66; @@ -125,17 +121,19 @@ $pgtitle = array(gettext("Advanced"), gettext("File Editor")); <body link="#000000" vlink="#000000" alink="#000000"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> - <tr> - <td class="tabcont"> - <form action="snort_rules_edit.php?id=<?=$id; ?>&openruleset=<?=$file; ?>&ids=<?=$ids; ?>" method="post"> +<tr> + <td class="tabcont"> + <form action="snort_rules_edit.php?id=<?=$id; ?>&openruleset=<?=$file; ?>&ids=<?=$ids; ?>" method="post"> + + <?php if ($savemsg) print_info_box($savemsg); ?> - <?php if ($savemsg) print_info_box($savemsg); - if ($file != '/usr/local/etc/snort/snort_update.log'): - ?> <table width="100%" cellpadding="9" cellspacing="9" bgcolor="#eeeeee"> <tr> <td> <input name="save" type="submit" class="formbtn" id="save" value="save" /> + <input type='hidden' name='id' value='<?=$id;?>' /> + <input type='hidden' name='ids' value='<?=$ids;?>' /> + <input type='hidden' name='openruleset' value='<?=$file;?>' /> <input type="button" class="formbtn" value="Cancel" onclick="window.close()"> <hr noshade="noshade" /> Disable original rule :<br/> @@ -146,37 +144,20 @@ $pgtitle = array(gettext("Advanced"), gettext("File Editor")); <label for="highlighting_disabled"> <?=gettext("Disabled");?></label> </td> </tr> - </table> - <table width="100%"> <tr> <td valign="top" class="label"> - <div style="background: #eeeeee;" id="textareaitem"> - <!-- NOTE: The opening *and* the closing textarea tag must be on the same line. --> - <textarea wrap="off" style="width: 98%; margin: 7px;" class="<?=$language;?>:showcolumns" rows="<?=$rows;?>" cols="<?=$cols;?>" name="code"> - <?=$tempstring;?> </textarea> - </div> + <div style="background: #eeeeee;" id="textareaitem"><!-- NOTE: The opening *and* the closing textarea tag must be on the same line. --> + <textarea + wrap="off" style="width: 98%; margin: 7px;" + class="<?php echo $language; ?>:showcolumns" rows="33" + cols="<?=$cols;?>" name="code"><?=$contents2;?></textarea> + </div> </td> </tr> </table> - <?php endif; ?> - <table width='100%'> - <tr> - <td valign="top" class="label"> - <div style="background: #eeeeee;" id="textareaitem"><!-- NOTE: The opening *and* the closing textarea tag must be on the same line. --> - <textarea - <? if ($file != '/usr/local/etc/snort/snort_update.log') { echo 'disabled'; } ?> - wrap="off" style="width: 98%; margin: 7px;" - class="<?php echo $language; ?>:showcolumns" rows="33" - cols="<?=$cols;?>" name="code2"><?=$contents2;?></textarea> - </div> - </td> - </tr> - </table> - <? echo "$file\n"; ?></td> - </tr> + </td> +</tr> </table> - <?php include("fend.inc");?> - </body> </html> |