diff options
author | Renato Botelho <renato@netgate.com> | 2015-11-23 13:47:41 -0200 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2015-11-23 13:47:41 -0200 |
commit | a4bfe620fc804676b3b40dccb5683d99adb75bda (patch) | |
tree | 1197fbb1b112cb618371185bf5c65b73ccbb09b8 /config/pfblockerng/pfblockerng.inc | |
parent | 11ff96371de9923bce3ebbca594831cf8f2452f7 (diff) | |
parent | 337ef782341114a805fcb290126daf30645877f5 (diff) | |
download | pfsense-packages-a4bfe620fc804676b3b40dccb5683d99adb75bda.tar.gz pfsense-packages-a4bfe620fc804676b3b40dccb5683d99adb75bda.tar.bz2 pfsense-packages-a4bfe620fc804676b3b40dccb5683d99adb75bda.zip |
Merge pull request #1192 from BBcan177/pfBNG-11-22-15-1
Diffstat (limited to 'config/pfblockerng/pfblockerng.inc')
-rw-r--r-- | config/pfblockerng/pfblockerng.inc | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/config/pfblockerng/pfblockerng.inc b/config/pfblockerng/pfblockerng.inc index f1242ca3..7ddbb565 100644 --- a/config/pfblockerng/pfblockerng.inc +++ b/config/pfblockerng/pfblockerng.inc @@ -1315,8 +1315,8 @@ function pfb_download_failure($alias, $header, $pfbfolder, $vtype, $list_url) { $log = " Local File Failure\n"; pfb_logger("{$log}", 2); } else { - // Determine if Firewall/IDS is blocking download. - $ip = @gethostbyname($host); + // Determine if Firewall/IPS/DNSBL is blocking download. + $ip = @gethostbyname($host['host']); if (!empty($ip)) { // Query Firewall aliastables @@ -1327,6 +1327,13 @@ function pfb_download_failure($alias, $header, $pfbfolder, $vtype, $list_url) { $pfbfound = TRUE; } + // Determine if Host is listed in DNSBL + if ($ip == $pfb['dnsbl_vip']) { + $log = " [ {$host['host']} ] Domain listed in DNSBL\n"; + pfb_logger("{$log}", 2); + $pfbfound = TRUE; + } + // Query Snort/Suricata snort2c IP block table $result = exec("{$pfb['pfctl']} -t snort2c -T show | {$pfb['grep']} {$ip} 2>&1"); if (!empty($result)) { @@ -2353,7 +2360,7 @@ function sync_package_pfblockerng($cron='') { } if (!empty($list['custom'])) { - $list['row'][] = array( 'header' => "{$list['aliasname']}_custom", + $list['row'][] = array( 'header' => preg_replace("/\W/", '', $list['aliasname']) . '_custom', 'custom' => $list['custom'], 'state' => 'Enabled', 'update' => $list['custom_update'], @@ -2426,9 +2433,9 @@ function sync_package_pfblockerng($cron='') { if (file_exists("{$pfbfolder}/{$header}.txt") && $pfbreuse == '') { if ($row['state'] == 'Hold') { - $log = "\n[ {$header} ]{$logtab} Static Hold [ NOW ]"; + $log = "\n[ {$header} ]{$logtab} static hold. [ NOW ]"; } else { - $log = "\n[ {$header} ]{$logtab} exists, Reloading [ NOW ]"; + $log = "\n[ {$header} ]{$logtab} exists. [ NOW ]"; } pfb_logger("{$log}", 1); @@ -3128,7 +3135,7 @@ function sync_package_pfblockerng($cron='') { if ($continent === $continent_ex && !empty($pfctlck) && file_exists("{$pfbfolder}/{$ccfile}.txt") && $pfb['reuse'] == '') { if (!$pfb['save']) { - $log = "\n[ {$pfb_alias}{$vtype} ]{$logtab} exists, Reloading [ NOW ]"; + $log = "\n[ {$pfb_alias}{$vtype} ]{$logtab} exists. [ NOW ]"; pfb_logger("{$log}", 1); } } else { @@ -3245,7 +3252,7 @@ function sync_package_pfblockerng($cron='') { } if (!empty($list['custom'])) { - $list['row'][] = array( 'header' => "{$list['aliasname']}_custom", + $list['row'][] = array( 'header' => preg_replace("/\W/", '', $list['aliasname']) . '_custom', 'custom' => $list['custom'], 'state' => 'Enabled', 'update' => $list['custom_update'], @@ -3300,9 +3307,9 @@ function sync_package_pfblockerng($cron='') { if (file_exists("{$pfbfolder}/{$header}.txt") && $pfbreuse == '') { if ($row['state'] == 'Hold') { - $log = "\n[ {$header} ]{$logtab} Static Hold [ NOW ]"; + $log = "\n[ {$header} ]{$logtab} static hold. [ NOW ]"; } else { - $log = "\n[ {$header} ]{$logtab} exists, Reloading [ NOW ]"; + $log = "\n[ {$header} ]{$logtab} exists. [ NOW ]"; } pfb_logger("{$log}", 1); } else { |