From 1b105aedad724692d68e2f60062981452df662f5 Mon Sep 17 00:00:00 2001 From: robiscool Date: Sun, 13 Dec 2009 19:11:48 -0800 Subject: snort-dev, add deinstall code, code to load fast ip lists 2000,000 ips will load now --- config/snort-dev/snort.inc | 35 +++++++++++++++++++---------------- config/snort-dev/snort_blocked.php | 14 +++++++++----- 2 files changed, 28 insertions(+), 21 deletions(-) diff --git a/config/snort-dev/snort.inc b/config/snort-dev/snort.inc index 26bdee7d..5b4b8fed 100644 --- a/config/snort-dev/snort.inc +++ b/config/snort-dev/snort.inc @@ -877,28 +877,31 @@ function snort_deinstall() $x=0; foreach($config['cron']['item'] as $item) { - if (strstr($item['command'], "snort2c")) - { - $is_installed = true; - break; - } + if (strstr($item['command'], "snort2c")) + { + $is_installed = true; + break; + } - $x++; + $x++; + } - if($is_installed == true) + if($is_installed == true) + { + if($x > 0) { - if($x > 0) - { - unset($config['cron']['item'][$x]); - write_config(); - conf_mount_rw(); - } - configure_cron(); + unset($config['cron']['item'][$x]); + write_config(); + conf_mount_rw(); } - } - conf_mount_ro(); + + configure_cron(); + + } + conf_mount_ro(); } + function snort_rules_up_deinstall_cron($should_install) { global $config, $g; diff --git a/config/snort-dev/snort_blocked.php b/config/snort-dev/snort_blocked.php index f4de6e0d..694f76c5 100644 --- a/config/snort-dev/snort_blocked.php +++ b/config/snort-dev/snort_blocked.php @@ -81,9 +81,12 @@ include("head.inc"); /tmp/snort_block.cache'); + sleep(3); + $ips_array = file('/tmp/snort_block.cache'); // $ips_array = split("\n", $ips); $counter = 0; foreach($ips_array as $ip) { @@ -97,7 +100,7 @@ include("head.inc"); $alert_description = ""; echo "\n"; echo "\n"; - echo "\n\"Delete\""; + echo "\n\"Delete\""; echo "\n {$ww_ip}"; echo "\n {$alert_description}"; echo "\n"; @@ -126,7 +129,7 @@ include("head.inc"); \ No newline at end of file -- cgit v1.2.3