From 5287063d4ad240bb76ebafe716c762b005bdac6a Mon Sep 17 00:00:00 2001 From: bmeeks8 Date: Mon, 24 Feb 2014 20:40:46 -0500 Subject: Some bug fixes and replace $_GET with $_POST where possible. --- config/suricata/suricata_interfaces.php | 127 +++++++++++++----------------- config/suricata/suricata_logs_browser.php | 2 +- 2 files changed, 56 insertions(+), 73 deletions(-) (limited to 'config') diff --git a/config/suricata/suricata_interfaces.php b/config/suricata/suricata_interfaces.php index 364abe62..88b426ba 100644 --- a/config/suricata/suricata_interfaces.php +++ b/config/suricata/suricata_interfaces.php @@ -27,7 +27,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -$nocsrf = true; require_once("guiconfig.inc"); require_once("/usr/local/pkg/suricata/suricata.inc"); @@ -37,16 +36,17 @@ $suricatadir = SURICATADIR; $suricatalogdir = SURICATALOGDIR; $rcdir = RCFILEPREFIX; -$id = $_GET['id']; -if (isset($_POST['id'])) +if ($_POST['id'] && is_numeric($_POST['id'])) $id = $_POST['id']; +else + $id = ""; if (!is_array($config['installedpackages']['suricata']['rule'])) $config['installedpackages']['suricata']['rule'] = array(); $a_nat = &$config['installedpackages']['suricata']['rule']; $id_gen = count($config['installedpackages']['suricata']['rule']); -if (isset($_POST['del_x'])) { +if ($_POST['del_x']) { /* delete selected rules */ if (is_array($_POST['rule'])) { conf_mount_rw(); @@ -103,11 +103,10 @@ if (isset($_POST['del_x'])) { header("Location: /suricata/suricata_interfaces.php"); exit; } - } /* start/stop Barnyard2 */ -if ($_GET['act'] == 'bartoggle' && is_numeric($id)) { +if ($_POST['bartoggle'] && is_numeric($id)) { $suricatacfg = $config['installedpackages']['suricata']['rule'][$id]; $if_real = get_real_interface($suricatacfg['interface']); $if_friendly = convert_friendly_interface_to_friendly_descr($suricatacfg['interface']); @@ -127,7 +126,7 @@ if ($_GET['act'] == 'bartoggle' && is_numeric($id)) { } /* start/stop Suricata */ -if ($_GET['act'] == 'toggle' && is_numeric($id)) { +if ($_POST['toggle'] && is_numeric($id)) { $suricatacfg = $config['installedpackages']['suricata']['rule'][$id]; $if_real = get_real_interface($suricatacfg['interface']); $if_friendly = convert_friendly_interface_to_friendly_descr($suricatacfg['interface']); @@ -159,17 +158,14 @@ include_once("head.inc"); ?> -' . $pgtitle . '