From 893ca7808324f0b3fc25f9d0261d713828455e92 Mon Sep 17 00:00:00 2001 From: robiscool Date: Thu, 29 Apr 2010 11:56:05 -0700 Subject: snort, update download rules for ne version of snort, new version --- config/snort/snort_download_rules.php | 174 +++++++++++----------------------- 1 file changed, 55 insertions(+), 119 deletions(-) (limited to 'config/snort/snort_download_rules.php') diff --git a/config/snort/snort_download_rules.php b/config/snort/snort_download_rules.php index 6ba3c5df..2dd9a720 100644 --- a/config/snort/snort_download_rules.php +++ b/config/snort/snort_download_rules.php @@ -36,7 +36,7 @@ require_once("functions.inc"); require_once("service-utils.inc"); require_once("/usr/local/pkg/snort/snort.inc"); -$tmpfname = "/tmp/snort_rules_up"; +$tmpfname = "/usr/local/etc/snort/tmp/snort_rules_up"; $snortdir = "/usr/local/etc/snort"; $snortdir_wan = "/usr/local/etc/snort"; $snort_filename_md5 = "snortrules-snapshot-2.8.tar.gz.md5"; @@ -78,9 +78,7 @@ $emergingthreats = $config['installedpackages']['snortglobal']['emergingthreats' if (file_exists('/var/run/snort.conf.dirty')) { $snort_dirty_d = 'stop'; -} - - +} /* If no id show the user a button */ if ($id_d == "" || $snort_emrging_info == "stop" || $snort_oinkid_info == "stop" || $snort_dirty_d == 'stop') { @@ -317,9 +315,13 @@ setTimeout($.unblockUI, 2000); -'; - echo ""; - echo ""; - conf_mount_ro(); - exit(0); - } - } -} - -/* Copy renamed snort.org rules to snort dir */ -if ($snortdownload != "off") -{ - if ($snort_md5_check_ok != on) - { - if (file_exists("{$snortdir}/rules_bk/rules/Makefile.am")) - { - update_status(gettext("Copying renamed snort.org rules to snort directory...")); - exec("/bin/cp {$snortdir}/rules_bk/rules/* {$snortdir}/rules/"); - }else{ - update_status(gettext("The renamed snort.org rules do not exist...")); - update_output_window(gettext("Error copying config...")); - echo ' -'; - echo ""; - echo ""; - conf_mount_ro(); - exit(0); - } - } -} - -/* Copy configs to snort dir */ -if ($snortdownload != "off") -{ - if ($snort_md5_check_ok != on) - { - if (file_exists("{$snortdir}/etc/Makefile.am")) { - update_status(gettext("Copying configs to snort directory...")); - exec("/bin/cp {$snortdir}/etc/* {$snortdir}"); - exec("/bin/rm -r {$snortdir}/etc"); - }else{ - update_status(gettext("The snort config does not exist...")); - update_output_window(gettext("Error copying config...")); - echo ' -'; -echo ""; -echo ""; -conf_mount_ro(); - exit(0); - } - } -} - - /* Copy md5 sig to snort dir */ if ($snortdownload != "off") { @@ -1133,12 +1069,12 @@ if (!empty($config['installedpackages']['snortglobal']['rule'])) $config['installedpackages']['snortglobal']['last_rules_install'] = date("Y-M-jS-h:i-A"); /* remove old $tmpfname files */ -if (file_exists("{$tmpfname}")) +if (file_exists('/usr/local/etc/snort/tmp')) { update_status(gettext("Cleaning up...")); - exec("/bin/rm -r /tmp/snort_rules_up"); + exec("/bin/rm -r /usr/local/etc/snort/tmp/snort_rules_up"); sleep(2); - exec("/bin/rm -r {$snortdir}/rules_bk/rules/"); + exec("/bin/rm -r /usr/local/etc/snort/tmp/rules_bk"); apc_clear_cache(); } -- cgit v1.2.3