diff options
Diffstat (limited to 'config/snort')
-rw-r--r-- | config/snort/javascript/row_helper.js | 28 | ||||
-rw-r--r-- | config/snort/snort.inc | 3 | ||||
-rw-r--r-- | config/snort/snort_interfaces_whitelist_edit.php | 29 |
3 files changed, 39 insertions, 21 deletions
diff --git a/config/snort/javascript/row_helper.js b/config/snort/javascript/row_helper.js index d8b4ffb4..255154f7 100644 --- a/config/snort/javascript/row_helper.js +++ b/config/snort/javascript/row_helper.js @@ -1,14 +1,22 @@ +/*
+
+for the snort package sept01,2010
+TODO: redo code myself.......
+
+*/
+
+
// Global Variables
-var rowname = new Array(4999);
-var rowtype = new Array(4999);
-var newrow = new Array(4999);
-var rowsize = new Array(4999);
+var rowname = new Array(500);
+var rowtype = new Array(500);
+var newrow = new Array(500);
+var rowsize = new Array(500);
-for (i = 0; i < 4999; i++) {
+for (i = 0; i < 500; i++) {
rowname[i] = '';
rowtype[i] = '';
newrow[i] = '';
- rowsize[i] = '30';
+ rowsize[i] = '25';
}
var field_counter_js = 0;
@@ -22,14 +30,13 @@ var addRowTo = (function() { d = document;
tbody = d.getElementById(tableId).getElementsByTagName("tbody").item(0);
tr = d.createElement("tr");
+ totalrows++;
for (i = 0; i < field_counter_js; i++) {
td = d.createElement("td");
if(rowtype[i] == 'textbox') {
- td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><input size='" + rowsize[i] + "' class='formfld unknown' name='" + rowname[i] + totalrows + "' id='" + rowname[i] + totalrows + "'></input> ";
+ td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><input size='" + rowsize[i] + "' name='" + rowname[i] + totalrows + "'></input> ";
} else if(rowtype[i] == 'select') {
- td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><select size='1' name='" + rowname[i] + totalrows + "'><option value=\"32\" selected>32</option><option value=\"31\" >31</option><option value=\"30\" >30</option><option value=\"29\" >29</option><option value=\"28\" >28</option><option value=\"27\" >27</option><option value=\"26\" >26</option><option value=\"25\" >25</option><option value=\"24\" >24</option><option value=\"23\" >23</option><option value=\"22\" >22</option><option value=\"21\" >21</option><option value=\"20\" >20</option><option value=\"19\" >19</option><option value=\"18\" >18</option><option value=\"17\" >17</option><option value=\"16\" >16</option><option value=\"15\" >15</option><option value=\"14\" >14</option><option value=\"13\" >13</option><option value=\"12\" >12</option><option value=\"11\" >11</option><option value=\"10\" >10</option><option value=\"9\" >9</option><option value=\"8\" >8</option><option value=\"7\" >7</option><option value=\"6\" >6</option><option value=\"5\" >5</option><option value=\"4\" >4</option><option value=\"3\" >3</option><option value=\"2\" >2</option><option value=\"1\" >1</option></select> ";
- } else if(rowtype[i] == 'select_source') {
- td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><select size='1' name='" + rowname[i] + totalrows + "'><option value=\"32\" selected>32</option><option value=\"31\" >31</option><option value=\"30\" >30</option><option value=\"29\" >29</option><option value=\"28\" >28</option><option value=\"27\" >27</option><option value=\"26\" >26</option><option value=\"25\" >25</option><option value=\"24\" >24</option><option value=\"23\" >23</option><option value=\"22\" >22</option><option value=\"21\" >21</option><option value=\"20\" >20</option><option value=\"19\" >19</option><option value=\"18\" >18</option><option value=\"17\" >17</option><option value=\"16\" >16</option><option value=\"15\" >15</option><option value=\"14\" >14</option><option value=\"13\" >13</option><option value=\"12\" >12</option><option value=\"11\" >11</option><option value=\"10\" >10</option><option value=\"9\" >9</option><option value=\"8\" >8</option><option value=\"7\" >7</option><option value=\"6\" >6</option><option value=\"5\" >5</option><option value=\"4\" >4</option><option value=\"3\" >3</option><option value=\"2\" >2</option><option value=\"1\" >1</option></select> ";
+ td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><select size='" + rowsize[i] + "' name='" + rowname[i] + totalrows + "'><option value=\"32\" selected>32</option><option value=\"31\" >31</option><option value=\"30\" >30</option><option value=\"29\" >29</option><option value=\"28\" >28</option><option value=\"27\" >27</option><option value=\"26\" >26</option><option value=\"25\" >25</option><option value=\"24\" >24</option><option value=\"23\" >23</option><option value=\"22\" >22</option><option value=\"21\" >21</option><option value=\"20\" >20</option><option value=\"19\" >19</option><option value=\"18\" >18</option><option value=\"17\" >17</option><option value=\"16\" >16</option><option value=\"15\" >15</option><option value=\"14\" >14</option><option value=\"13\" >13</option><option value=\"12\" >12</option><option value=\"11\" >11</option><option value=\"10\" >10</option><option value=\"9\" >9</option><option value=\"8\" >8</option><option value=\"7\" >7</option><option value=\"6\" >6</option><option value=\"5\" >5</option><option value=\"4\" >4</option><option value=\"3\" >3</option><option value=\"2\" >2</option><option value=\"1\" >1</option></select> ";
} else {
td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><input type='checkbox' name='" + rowname[i] + totalrows + "'></input> ";
}
@@ -41,7 +48,6 @@ var addRowTo = (function() { td.innerHTML = '<input type="image" src="/themes/' + theme + '/images/icons/icon_x.gif" onclick="removeRow(this); return false;" value="Delete">';
tr.appendChild(td);
tbody.appendChild(tr);
- totalrows++;
});
})();
diff --git a/config/snort/snort.inc b/config/snort/snort.inc index b5f93472..0094cff3 100644 --- a/config/snort/snort.inc +++ b/config/snort/snort.inc @@ -1837,10 +1837,9 @@ snort_rules_up_deinstall_cron(""); conf_mount_rw(); exec('rm -rf /usr/local/www/snort'); - exec('rm -rf /usr/local/pkg/snort'); exec('rm -rf /usr/local/lib/snort/'); exec('rm -rf /var/log/snort/'); - exec('rm -rf /usr/local/pkg/snort*'); + exec('rm -rf /usr/local/pkg/snort'); conf_mount_ro(); diff --git a/config/snort/snort_interfaces_whitelist_edit.php b/config/snort/snort_interfaces_whitelist_edit.php index 4056f992..5ccc9965 100644 --- a/config/snort/snort_interfaces_whitelist_edit.php +++ b/config/snort/snort_interfaces_whitelist_edit.php @@ -105,7 +105,7 @@ if (isset($id) && $a_whitelist[$id]) { if ($_POST['apply']) { if (file_exists("$d_snort_whitelist_dirty_path")) { - + conf_mount_rw(); write_config(); sync_snort_package_config(); @@ -119,6 +119,8 @@ if (isset($id) && $a_whitelist[$id]) { if ($_POST['submit']) { + conf_mount_rw(); + unset($input_errors); $pconfig = $_POST; @@ -259,7 +261,7 @@ echo $snort_general_css; <div class="body2"> -<script type="text/javascript" src="./javascript/row_helper.js"></script> +<script type="text/javascript" src="/snort/javascript/row_helper.js"></script> <input type='hidden' name='address_type' value='textbox' /> <script type="text/javascript"> @@ -354,6 +356,12 @@ echo $snort_general_css; <tr> <td width="22%" valign="top" class="vncell2">List Type</td> <td width="78%" class="vtable"> + + <div style="padding:5px; margin-top: 16px; margin-bottom: 16px; border:1px dashed #ff3333; background-color: #eee; color: #000; font-size: 8pt;" id="itemhelp"> + <strong>WHITELIST:</strong> This list specifies addresses that Snort Package should not block.<br><br> + <strong>NETLIST:</strong> This list is for defining addresses as $HOME_NET or $EXTERNAL_NET in the snort.conf file. + </div> + <select name="snortlisttype" class="formfld" id="snortlisttype"> <?php $interfaces4 = array('whitelist' => 'WHITELIST', 'netlist' => 'NETLIST'); @@ -362,9 +370,10 @@ echo $snort_general_css; <?=htmlspecialchars($ifacename4);?> </option> <?php endforeach; ?> - </select><br> - <span class="vexpl">Choose the type of list you will like see in your Interface Edit Tab. Hint: Best pratice is to test every list you make. - </span> <span class="red">Note:</span> NETLIST's are only for defining snort.conf's external or home NETS.</td> + </select> + <span class="vexpl"> + Choose the type of list you will like see in your <span class="red">Interface Edit Tab</span>. + </span></td> </tr> <tr> <td colspan="2" valign="top" class="listtopic">Add auto generated ips.</td> @@ -424,8 +433,10 @@ echo $snort_general_css; <tbody> <tr> <td colspan="4"> - <div style="padding:5px; margin-top: 16px; margin-bottom: 16px; border:1px dashed #000066; background-color: #ffffff; color: #000000; font-size: 8pt;" id="itemhelp"> - Enter only ips and CIDRs, do not enter CIDRs for whitelists. Example: 192.168.4.1 or 192.168.4.0/24</div> + <div style="padding:5px; margin-top: 16px; margin-bottom: 16px; border:1px dashed #ff3333; background-color: #eee; color: #000; font-size: 8pt;" id="itemhelp"> + For <strong>WHITELIST's</strong> enter <strong>ONLY IPs not CIDRs</strong>. Example: 192.168.4.1<br><br> + For <strong>NETLIST's</strong> you may enter <strong>IPs and CIDRs</strong>. Example: 192.168.4.1 or 192.168.4.0/24 + </div> </td> </tr> <tr> @@ -487,10 +498,12 @@ echo $snort_general_css; <script type="text/javascript"> /* row and col adjust when you add extra entries */ - field_counter_js = 2; + + field_counter_js = 3; rows = 1; totalrows = <?php echo $counter; ?>; loaded = <?php echo $counter; ?>; + </script> </div> |