From f09e61c1a2282088cbbd4133f013a439ea6876b9 Mon Sep 17 00:00:00 2001 From: BBcan177 Date: Sat, 19 Dec 2015 14:23:14 -0500 Subject: Update pfblockerng.inc * Fix 'Match Outbound' rule variable name * Remove duplicate Alexa variable as its already in pfb_global() * Determine if a DNSBL background reload is running before updating DNSBL * Change "${cmd}" variable name to "{$cmd}" --- config/pfblockerng/pfblockerng.inc | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'config') diff --git a/config/pfblockerng/pfblockerng.inc b/config/pfblockerng/pfblockerng.inc index 7bfc6f0e..afd7a0ce 100644 --- a/config/pfblockerng/pfblockerng.inc +++ b/config/pfblockerng/pfblockerng.inc @@ -1075,7 +1075,7 @@ function find_reported_header($ip, $pfbfolder, $exclude=FALSE) { // Query for any active pfBlockerNG CRON jobs exec('/bin/ps -wax', $result_cron); - if (preg_grep("/pfblockerng[.]php\s+?(cron|update)/", $result_cron)) { + if (preg_grep("/pfblockerng[.]php\s+?(cron|update|updatednsbl)/", $result_cron)) { return array('updating..', 'CRON Task'); } return array('', 'no match', FALSE); @@ -1532,7 +1532,7 @@ function pfb_firewall_rule($action, $pfb_alias, $vtype='', $pfb_log, $adest='', $rule['log'] = ''; } $rule['created'] = array('time' => (int)microtime(true), 'username' => 'Auto'); - $rule['match_outbound'][] = $rule; + $pfb['match_outbound'][] = $rule; if ($action != 'Match_Both') { break; } @@ -1860,7 +1860,6 @@ function sync_package_pfblockerng($cron='') { $pfb['dnsbl_iface'] = $pfb['dnsblconfig']['dnsbl_interface']?: 'lan'; // VIP Local Interface setting $pfb['dnsbl_ip'] = $pfb['dnsblconfig']['action'] ?: 'Disabled'; // Enable/Disable IP blocking from DNSBL lists $pfb['dnsbl_rule'] = $pfb['dnsblconfig']['pfb_dnsbl_rule'] ?: 'Disabled'; // Auto create a Floating Pass Rule for other Lan subnets - $pfb['dnsbl_alexa'] = $pfb['dnsblconfig']['alexa_enable'] ?: 'Disabled'; // Enable Alexa whitelist $pfb['dnsbl_alexa_cnt'] = $pfb['dnsblconfig']['alexa_count'] ?: '1000'; // Alexa whitelist domain setting $pfb['dnsbl_alexa_inc'] = $pfb['dnsblconfig']['alexa_inclusion'] ?: ''; // Alexa TLDs inclusions for whitelisting @@ -2163,8 +2162,8 @@ function sync_package_pfblockerng($cron='') { } } - $pfb['remove'] = FALSE; // Flag to execute pfctl and rules ordering or reload of DNSBL domains - $pfb['summary'] = FALSE; // Execute final summary as a list was removed + $pfb['remove'] = FALSE; // Flag to execute pfctl and rules ordering or reload of DNSBL domains + $pfb['summary'] = FALSE; // Execute final summary as a list was removed // Process to remove lists from Masterfile/DB folder if they do not exist if (isset($pfb['existing'])) { @@ -2214,7 +2213,7 @@ function sync_package_pfblockerng($cron='') { // Query for any active pfBlockerNG CRON jobs $result_cron = array(); exec('/bin/ps -wax', $result_cron); - if (preg_grep("/pfblockerng[.]php\s+?(cron|update)/", $result_cron)) { + if (preg_grep("/pfblockerng[.]php\s+?(cron|update|updatednsbl)/", $result_cron)) { $log = "\n ** DNSBL Reload Terminated due to active pfBlockerNG cron process\n"; pfb_logger("{$log}", 1); } else { @@ -2223,7 +2222,7 @@ function sync_package_pfblockerng($cron='') { // Clear any existing pfBlockerNG Cron Jobs to avoid collision install_cron_job('pfblockerng.php cron', false); $cmd = "/usr/local/bin/php /usr/local/www/pfblockerng/pfblockerng.php"; - mwexec_bg("${cmd} updatednsbl >> {$pfb['log']} 2>&1"); + mwexec_bg("{$cmd} updatednsbl >> {$pfb['log']} 2>&1"); } } } @@ -2304,6 +2303,15 @@ function sync_package_pfblockerng($cron='') { pfb_logger("{$log}", 1); $dnsbl_error = TRUE; } + + // Determine if a DNSBL Reload is running + $result_cron = array(); + exec('/bin/ps -wax', $result_cron); + if (preg_grep("/pfblockerng[.]php\s+?(updatednsbl)/", $result_cron)) { + $log = "\n ** DNSBL Update Terminated due to active pfBlockerNG cron process\n"; + pfb_logger("{$log}", 1); + $dnsbl_error = TRUE; + } } if ($pfb['dnsbl'] == 'on' && !$pfb['save'] && !$dnsbl_error) { @@ -4780,4 +4788,4 @@ function pfblockerng_do_xmlrpc_sync($sync_to_ip, $port, $protocol, $username, $p } return $success; } -?> \ No newline at end of file +?> -- cgit v1.2.3 From bc1b9d29a3a38331d13bdb4830e2d3005138ec1c Mon Sep 17 00:00:00 2001 From: BBcan177 Date: Sat, 19 Dec 2015 14:26:31 -0500 Subject: Update pfblockerng_install.inc * Add $pfb['ccdir'] explicitly due to file caching issue. --- config/pfblockerng/pfblockerng_install.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/pfblockerng/pfblockerng_install.inc b/config/pfblockerng/pfblockerng_install.inc index 54d0c374..93599821 100644 --- a/config/pfblockerng/pfblockerng_install.inc +++ b/config/pfblockerng/pfblockerng_install.inc @@ -62,7 +62,8 @@ if ($pfs_version == '2.2') { } else { $pfb['prefix'] = '/usr/local'; } -$pfb['geoipshare'] = "{$pfb['prefix']}/share/GeoIP"; +$pfb['geoipshare'] = "{$pfb['prefix']}/share/GeoIP"; +$pfb['ccdir'] = "{$pfb['prefix']}/share/GeoIP/cc"; $pfb['maxmind'][0]['url'] = 'http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz'; $pfb['maxmind'][0]['file_dwn'] = 'GeoIP.dat.gz'; -- cgit v1.2.3 From 8255a0f1a740cb76934afa704c07d9268bfdbb3e Mon Sep 17 00:00:00 2001 From: BBcan177 Date: Sat, 19 Dec 2015 14:31:09 -0500 Subject: Update pfblockerng_threats.php * Fix dShield URL * Add tcpiputils to DNSBL Domain threat lookup --- config/pfblockerng/pfblockerng_threats.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'config') diff --git a/config/pfblockerng/pfblockerng_threats.php b/config/pfblockerng/pfblockerng_threats.php index d02d100f..d1411ea8 100644 --- a/config/pfblockerng/pfblockerng_threats.php +++ b/config/pfblockerng/pfblockerng_threats.php @@ -92,7 +92,7 @@ include('fbegin.inc');

- +

@@ -126,6 +126,8 @@ include('fbegin.inc');

+ + @@ -139,4 +141,4 @@ include('fbegin.inc'); - \ No newline at end of file + -- cgit v1.2.3 From 0ee88ec87e2cb940c1b023a0fb62eda8d4fae1ee Mon Sep 17 00:00:00 2001 From: BBcan177 Date: Sat, 19 Dec 2015 14:35:48 -0500 Subject: Update pfblockerng_update.php * Add Header() * Improve query for active pfBNG running tasks --- config/pfblockerng/pfblockerng_update.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'config') diff --git a/config/pfblockerng/pfblockerng_update.php b/config/pfblockerng/pfblockerng_update.php index 8a04f843..a723dd5b 100644 --- a/config/pfblockerng/pfblockerng_update.php +++ b/config/pfblockerng/pfblockerng_update.php @@ -81,8 +81,9 @@ function pfb_cron_update($type) { // Query for any active pfBlockerNG CRON jobs exec('/bin/ps -wx', $result_cron); - if (preg_grep("/pfblockerng[.]php\s+?(cron|update)/", $result_cron)) { + if (preg_grep("/pfblockerng[.]php\s+?(cron|update|updatednsbl)/", $result_cron)) { pfbupdate_status(gettext("Force {$type} Terminated - Failed due to Active Running Task. Click 'View' for running process")); + header('Location: /pfblockerng/pfblockerng_update.php'); exit; } @@ -254,7 +255,7 @@ include_once('fbegin.inc'); // Query for any active pfBlockerNG CRON jobs exec('/bin/ps -wax', $result_cron); - if (preg_grep("/pfblockerng[.]php\s+?(cron|update)/", $result_cron)) { + if (preg_grep("/pfblockerng[.]php\s+?(cron|update|updatednsbl)/", $result_cron)) { echo "   Active pfBlockerNG CRON Job  "; echo " - \ No newline at end of file + -- cgit v1.2.3 From 3c86965fa2d4fbb088808beea4530c262b1efe2e Mon Sep 17 00:00:00 2001 From: BBcan177 Date: Sat, 19 Dec 2015 14:43:21 -0500 Subject: Update pfblockerng.xml * Add log size settings (5000 & 10000 lines) for limited storage installations. * Add Paypal link --- config/pfblockerng/pfblockerng.xml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'config') diff --git a/config/pfblockerng/pfblockerng.xml b/config/pfblockerng/pfblockerng.xml index 9e371e9b..6c5a8048 100644 --- a/config/pfblockerng/pfblockerng.xml +++ b/config/pfblockerng/pfblockerng.xml @@ -418,6 +418,8 @@ select + + @@ -560,8 +562,9 @@ Support info - - If you like this package, please support the developer @ BBCan177@gmail.com.]]> + + If you like this package, please support the developer. Paypal accepted.]]> @@ -592,4 +595,4 @@ sync_package_pfblockerng(); ]]> - \ No newline at end of file + -- cgit v1.2.3 From f343fd52a36c92347e3c352f0576c419779a43a8 Mon Sep 17 00:00:00 2001 From: BBcan177 Date: Sat, 19 Dec 2015 14:45:22 -0500 Subject: Update pfblockerng_dnsbl_lists.xml * Remove extra whitespace --- config/pfblockerng/pfblockerng_dnsbl_lists.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'config') diff --git a/config/pfblockerng/pfblockerng_dnsbl_lists.xml b/config/pfblockerng/pfblockerng_dnsbl_lists.xml index e07ee0c1..0b94eaab 100644 --- a/config/pfblockerng/pfblockerng_dnsbl_lists.xml +++ b/config/pfblockerng/pfblockerng_dnsbl_lists.xml @@ -291,7 +291,7 @@ custom
Enter one   'Domain Name'   per line

- You may use "#" after any Domain name to add comments. example ( ads.google.com # Block Google Ads )
+ You may use "#" after any Domain name to add comments. example (ads.google.com # Block Google Ads)
This List is stored as 'Base64' format in the config.xml file.]]>
textarea @@ -330,4 +330,4 @@ sync_package_pfblockerng(); ]]> - \ No newline at end of file + -- cgit v1.2.3 From 450fe0330b2d466de0b5feb60844c66d3cf060bf Mon Sep 17 00:00:00 2001 From: BBcan177 Date: Sat, 19 Dec 2015 14:53:23 -0500 Subject: Update pfblockerng.xml Bump version --- config/pfblockerng/pfblockerng.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/pfblockerng/pfblockerng.xml b/config/pfblockerng/pfblockerng.xml index 6c5a8048..6c590213 100644 --- a/config/pfblockerng/pfblockerng.xml +++ b/config/pfblockerng/pfblockerng.xml @@ -48,7 +48,7 @@ Describe your package requirements here Currently there are no FAQ items provided. pfblockerng - 2.0.3 + 2.0.4 pfBlockerNG: General Settings /usr/local/pkg/pfblockerng/pfblockerng.inc pfBlockerNG: Save General Settings -- cgit v1.2.3 From 47649151b8856ede50c22f4d1f7f26e8866c5e69 Mon Sep 17 00:00:00 2001 From: BBcan177 Date: Sun, 20 Dec 2015 15:51:37 -0500 Subject: Update pfblockerng.inc * Mod to DNSBL Reload (Background function call) --- config/pfblockerng/pfblockerng.inc | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'config') diff --git a/config/pfblockerng/pfblockerng.inc b/config/pfblockerng/pfblockerng.inc index afd7a0ce..4ec46d85 100644 --- a/config/pfblockerng/pfblockerng.inc +++ b/config/pfblockerng/pfblockerng.inc @@ -1784,6 +1784,7 @@ function sync_package_pfblockerng($cron='') { // Reloads existing lists without downloading new lists when defined 'on' $pfb['reuse'] = $pfb['config']['pfb_reuse']; $pfb['reuse_dnsbl'] = ''; + $pfb['updatednsbl'] = FALSE; // Set flag to allow DNSBL Reload, only when called via background cmd. // Define update process (update or reload) switch ($cron) { @@ -1801,6 +1802,7 @@ function sync_package_pfblockerng($cron='') { case 'updatednsbl': $pfb['reuse'] = ''; $pfb['reuse_dnsbl'] = 'on'; + $pfb['updatednsbl'] = TRUE; break; case 'updateip': $pfb['reuse'] = 'on'; @@ -2304,13 +2306,15 @@ function sync_package_pfblockerng($cron='') { $dnsbl_error = TRUE; } - // Determine if a DNSBL Reload is running - $result_cron = array(); - exec('/bin/ps -wax', $result_cron); - if (preg_grep("/pfblockerng[.]php\s+?(updatednsbl)/", $result_cron)) { - $log = "\n ** DNSBL Update Terminated due to active pfBlockerNG cron process\n"; - pfb_logger("{$log}", 1); - $dnsbl_error = TRUE; + if (!$pfb['updatednsbl']) { + // Determine if a DNSBL Reload is running + $result_cron = array(); + exec('/bin/ps -wax', $result_cron); + if (preg_grep("/pfblockerng[.]php\s+?(updatednsbl)/", $result_cron)) { + $log = "\n ** DNSBL Reload Terminated due to active pfBlockerNG cron process\n"; + pfb_logger("{$log}", 1); + $dnsbl_error = TRUE; + } } } -- cgit v1.2.3