Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    PfBlockerNG

    Scheduled Pinned Locked Moved pfBlockerNG
    1.2k Posts 210 Posters 1.8m Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      pfsenseboonie
      last edited by

      @RonpfS:

      Seedbox … Dropbox, whatever rock you boat  :P

      Did you read the section in the picture.

      It tell you NOT to use pfBlockerNGSuppress Alias in FW rules  :o
      It tell you that suppression ONLY work for /32 or /24 networks.
      IBlock_BT_Hijack specify 162.125.0.0/16, so the "+" icon is not available in the Alerts Tab,
      Putting  162.125.17.0/24 and 162.125.32.0/24 in pfBlockerNGSuppress  is useless.

      So move the 2 networks to a new alias pfBlockerWhiteList
      Create a FW rule on LAN pass pfBlockerWhiteList
      or on the floating tab selecting all LANs interfaces

      Aha! Ok I have done this now.  But I am still blocked.
      So an extra question.
      You said set it up as pass outbound meaning the LAN sending to internet.

      From pfSense Point of view this is inbound right (packets flying off the network into pfsense)? So I have to re-set to direction=in?  I initially had it to direction=out and was still being blocked.

      I will monitor and see, but you can correct me if i am worng.

      Update
      –-------
      It seems the above in the case.  If I set direction=out, I can't ping dropbox network IPs.  When set to direction=in, I can.
      Have to wait and see now if it stays connected.

      Update 2

      Ok I think that sloved it thanks very much Ron.  I now know how to suppress an IP blocked by pfBNG.

      1 Reply Last reply Reply Quote 0
      • ?
        A Former User
        last edited by

        Whoa there pfsenseboonie, before you run off I am still confused. :o
        Not sure if you are blocking inbound direction with PFBlockerng but that would then make sense. ??? but wrong.
        If you are NOT running any open ports to services like a Web Server behind the firewall then you DO NOT need to block Inbound. The firewall is already by Default doing that. That would also probably explain the ping sent to Dropseed errr box whatever not getting back in to you. Really only need to block Outbound and save the firewall much needed processor resources for other tasks.
        RonpfS was correct in telling you to allow outbound.
        If you set only Outbound blocking and let the firewall default handle the inbound blocking it then makes sense to allow out to Dropbox so your machine will initiate the handshake with  dropbox and the firewall will allow the return response back in.
        Outbound is LAN to WEB…....Inbound is WEB to LAN  ;)  Keep it simple.

        1 Reply Last reply Reply Quote 0
        • P
          pfsenseboonie
          last edited by

          @webtyro:

          Not sure if you are blocking inbound direction with PFBlockerng but that would then make sense. ??? but wrong.
          If you are NOT running any open ports to services like a Web Server behind the firewall then you DO NOT need to block Inbound. The firewall is already by Default doing that. That would also probably explain the ping sent to Dropseed errr box whatever not getting back in to you. Really only need to block Outbound and save the firewall much needed processor resources for other tasks.

          Hey there,
          Yes thats correct I have open ports on the wan interface, so only blocking with pfBNG on those specific ports.

          1 Reply Last reply Reply Quote 0
          • ?
            A Former User
            last edited by

            Good. Was not sure.  ::) Late night, sleeping at the keyboard again.

            1 Reply Last reply Reply Quote 0
            • R
              rocket_raccoon
              last edited by

              @BBcan177

              Is it possible to add the country based easylist feeds like german easylist etc.?

              1 Reply Last reply Reply Quote 0
              • BBcan177B
                BBcan177 Moderator
                last edited by

                @rocket_raccoon:

                @BBcan177

                Is it possible to add the country based easylist feeds like german easylist etc.?

                Yes its something that I'd like to add when I find some time… :)

                The issue with EasyLists, is that only certain categories in the list can be used... If you can download that German Feed, and see which categories can be blocked that would be a good help... (Same applies for other Languages...)

                For EasyList, its only collecting 1.AdServers 2. AdServers Popup 3. Adult AdServers 4. Adult AdServer Popup categories...

                "Experience is something you don't get until just after you need it."

                Website: http://pfBlockerNG.com
                Twitter: @BBcan177  #pfBlockerNG
                Reddit: https://www.reddit.com/r/pfBlockerNG/new/

                1 Reply Last reply Reply Quote 0
                • G
                  Gradius
                  last edited by

                  I'm running the last 2.3 and getting a lot those errors:

                  FreeBSD 10.3-RELEASE #5 05adf0a(RELENG_2_3_0): Mon Apr 11 18:56:05 CDT 2016     root@ce23-i386-builder:/builder/pfsense-230/tmp/obj/builder/pfsense-230/tmp/FreeBSD-src/sys/pfSense
                  
                  Crash report details:
                  
                  PHP Errors:
                  [13-Apr-2016 14:00:00 America/Santiago] PHP Stack trace:
                  [13-Apr-2016 14:00:00 America/Santiago] PHP   1\. {main}() /usr/local/www/pfblockerng/pfblockerng.php:0
                  [13-Apr-2016 14:00:00 America/Santiago] PHP   2\. pfblockerng_sync_cron() /usr/local/www/pfblockerng/pfblockerng.php:94
                  [13-Apr-2016 14:00:00 America/Santiago] PHP   3\. sync_package_pfblockerng() /usr/local/www/pfblockerng/pfblockerng.php:387
                  
                  1 Reply Last reply Reply Quote 0
                  • BBcan177B
                    BBcan177 Moderator
                    last edited by

                    @Gradius:

                    I'm running the last 2.3 and getting a lot those errors:

                    Hi, Those errors don't point to the issue unfortunately… Could you take a look at the file  /tmp/PHP_errors.log and see if it shows any other clues?

                    It looks like the pfBlockerNG Cron task is being called, but there is no specific error indicated? Also take a look at the pfblockerng.log file around the timestamps of these errors, and see if they report any additional clues…

                    "Experience is something you don't get until just after you need it."

                    Website: http://pfBlockerNG.com
                    Twitter: @BBcan177  #pfBlockerNG
                    Reddit: https://www.reddit.com/r/pfBlockerNG/new/

                    1 Reply Last reply Reply Quote 0
                    • D
                      dstroot
                      last edited by

                      @BBcan177:

                      Yes the recent changes in pfense 2.3 from Lighttpd to NGINX broke the DNSBL feature… I will be submitting a PR to fix this up soon....

                      Any news on this front I upgraded to 2.3 and I think this blew up.  It came up without DNS working and I removed the DNSBL stuff to get a working config.  Reading the forum now for status.

                      Cheers!

                      1 Reply Last reply Reply Quote 0
                      • BBcan177B
                        BBcan177 Moderator
                        last edited by

                        @dstroot:

                        @BBcan177:

                        Yes the recent changes in pfense 2.3 from Lighttpd to NGINX broke the DNSBL feature… I will be submitting a PR to fix this up soon....

                        Any news on this front I upgraded to 2.3 and I think this blew up.  It came up without DNS working and I removed the DNSBL stuff to get a working config.  Reading the forum now for status.

                        Cheers!

                        Hey Dan, if I recall, you are using a Nano or Ramdisk correct?

                        If that is the case, when you did your update, Unbound had the Adv. Options with the "server:include: /var/unbound/pfb_dnsbl.conf" line but since the /var folder is wiped out, Unbound crashes due to this missing file.

                        You can run a "Force Update" in pfBNG to get it working again.

                        For others with this issue (Nano/RamDisk). Best to disable the pfBNG package before an Update or a configuration Restore (IE: Make sure the backup configuration has pfBNG disabled)

                        "Experience is something you don't get until just after you need it."

                        Website: http://pfBlockerNG.com
                        Twitter: @BBcan177  #pfBlockerNG
                        Reddit: https://www.reddit.com/r/pfBlockerNG/new/

                        1 Reply Last reply Reply Quote 0
                        • G
                          Gradius
                          last edited by

                          @BBcan177:

                          @Gradius:

                          I'm running the last 2.3 and getting a lot those errors:

                          Hi, Those errors don't point to the issue unfortunately… Could you take a look at the file  /tmp/PHP_errors.log and see if it shows any other clues?

                          It looks like the pfBlockerNG Cron task is being called, but there is no specific error indicated? Also take a look at the pfblockerng.log file around the timestamps of these errors, and see if they report any additional clues…

                          -rw-r--r--   1 root  wheel       0 Apr 14 12:26 PHP_errors.log
                          
                          ===[  DNSBL Process  ]================================================
                          
                          Warning: Invalid argument supplied for foreach() in /usr/local/pkg/pfblockerng/pfblockerng.inc on line 3057
                          
                          Call Stack:
                              0.0019     211244   1\. {main}() /usr/local/www/pfblockerng/pfblockerng.php:0
                              0.0902    6447240   2\. pfblockerng_sync_cron() /usr/local/www/pfblockerng/pfblockerng.php:94
                              0.0904    6450620   3\. sync_package_pfblockerng() /usr/local/www/pfblockerng/pfblockerng.php:387
                          
                          Clearing all DNSBL Feeds...  completed
                          Validating database... completed
                          Restarting Unbound ... completed
                          DNSBL update [ 0 ]... completed
                          ------------------------------------------
                          
                          1 Reply Last reply Reply Quote 0
                          • G
                            Gradius
                            last edited by

                            Part of coding apoint the error:

                            		// Save alias statistics to file (Remove any feeds that are not referenced)
                            		$handle = @fopen("{$pfb['dnsbl_info']}", 'w');
                            		fwrite($handle, "# Keeping this file open in a file editor will interrupt DNSBL!\n");
                            

                            foreach ($dnsbl_info as $alias) {

                            		if (in_array($alias[0], $alias_dnsbl_all)) {
                            				fputcsv($handle, $alias);
                            			}
                            		}
                            		@fclose($handle);
                            
                            1 Reply Last reply Reply Quote 0
                            • BBcan177B
                              BBcan177 Moderator
                              last edited by

                              @Gradius:

                              Warning: Invalid argument supplied for foreach() in /usr/local/pkg/pfblockerng/pfblockerng.inc on line 3057

                              Clearing all DNSBL Feeds…  completed
                              Validating database... completed
                              Restarting Unbound ... completed
                              DNSBL update [ 0 ]… completed

                              Does DNSBL have any defined Feeds? Its showing as "0"?  If you don't use DNSBL, then disable it, or add some Feeds…

                              However, to fix this issue, will need to add two lines of code as indicated in Red below. I didn't adjust the line spacing, to make it easier for you to add in these two lines... Will get this added to the next Pull Request...

                              // Save alias statistics to file (Remove any feeds that are not referenced)
                                              $handle = @fopen("{$pfb['dnsbl_info']}", 'w');
                                              fwrite($handle, "# Keeping this file open in a file editor will interrupt DNSBL!\n");
                                              if (!empty($dnsbl_info)) {
                                              foreach ($dnsbl_info as $alias) {
                                                      if (in_array($alias[0], $alias_dnsbl_all)) {
                                                              fputcsv($handle, $alias);
                                                      }
                                              }
                                              }
                                              @fclose($handle);

                              "Experience is something you don't get until just after you need it."

                              Website: http://pfBlockerNG.com
                              Twitter: @BBcan177  #pfBlockerNG
                              Reddit: https://www.reddit.com/r/pfBlockerNG/new/

                              1 Reply Last reply Reply Quote 0
                              • G
                                Gradius
                                last edited by

                                Fixed.

                                Thanks

                                1 Reply Last reply Reply Quote 0
                                • K
                                  KnowledgeAddict
                                  last edited by

                                  What up, @BBcan177!

                                  Long-time lurker, first-time poster. I think I've discovered a bug in your otherwise fantastic piece of software. I'm on the latest versions of everything and have DNSBL up and running smoothly. I have the North America list set to Alias Native for the United States only, and I have the pfb_NAmerica alias used in a WAN rule to allow access to an OpenVPN server running on pfSense from the public internet, but only from United States source IP's. I also have the option selected in pfBlockerNG to kill states during cron/force update. When I run a force update with the setup outlined above, after the block lists are updated, the log shows pfBlockerNG removing the states of what looks like all active connections to United States IP's with the culprit being [ pfB_NAmerica_v4-Inbound ]. This happens whether or not logging to the firewall log is enabled for the rule and whether or not the rule is set to disabled. Changing the list action to Alias Permit or Alias Match instead of Alias Native also doesn't change this behavior; states still get killed. Removing the alias from the rule or completely deleting the rule does end the update massacre.

                                  If a list is set to Alias Native, shouldn't pfBlockerNG only kill the states for that list if the alias is used in an active (not disabled) blocking rule? Also, I wouldn't expect that a list set to Alias Permit or Alias Match would ever have its states killed. Am I missing something?

                                  1 Reply Last reply Reply Quote 0
                                  • T
                                    trumee
                                    last edited by

                                    Hello,

                                    For Outbound Interface I have 'LAN' selected and 'Deny Both' in the IPv4 lists. Is it possible exclude a source ip address from the LAN interface? I dont want to use 'Deny Outbound'  for a particular ip address.

                                    Thanks

                                    1 Reply Last reply Reply Quote 0
                                    • BBcan177B
                                      BBcan177 Moderator
                                      last edited by

                                      @trumee:

                                      Hello,

                                      For Outbound Interface I have 'LAN' selected and 'Deny Both' in the IPv4 lists. Is it possible exclude a source ip address from the LAN interface? I dont want to use 'Deny Outbound'  for a particular ip address.

                                      Thanks

                                      Try the Advanced Outbound Rule settings:

                                      Create a pfSense Alias "ExcludedIP" and add any (lan) SRC IPs that you want to exclude… Check the "Invert" option. Also change the "Custom Protocol" setting to "TCP/UDP":


                                        ( The created Firewall Rule is shown in the Red box )

                                      NOTE - There is a bug with the existing package for "Outbound Protocol" settings. I have a fix for for this in the pfSense 2.3 version of pfBlockerNG in PR #107, that is waiting to be merged…

                                      "Experience is something you don't get until just after you need it."

                                      Website: http://pfBlockerNG.com
                                      Twitter: @BBcan177  #pfBlockerNG
                                      Reddit: https://www.reddit.com/r/pfBlockerNG/new/

                                      1 Reply Last reply Reply Quote 0
                                      • T
                                        trumee
                                        last edited by

                                        Thanks for the screenshot. But instead of source, i have a destination?

                                        1 Reply Last reply Reply Quote 0
                                        • BBcan177B
                                          BBcan177 Moderator
                                          last edited by

                                          Yes that is also part of the fix in PR #107… Sometimes copy/paste is a bad thing... Its really "Custom Source"... Wait for the next version and it should work for you :)

                                          "Experience is something you don't get until just after you need it."

                                          Website: http://pfBlockerNG.com
                                          Twitter: @BBcan177  #pfBlockerNG
                                          Reddit: https://www.reddit.com/r/pfBlockerNG/new/

                                          1 Reply Last reply Reply Quote 0
                                          • S
                                            samoth
                                            last edited by

                                            Hey everyone,

                                            My apologies, but I'm just not getting how to make the ipv4 lists work.

                                            I have an i-blocklist subscription and I enter in the list and can see when I update that it's finding updates, but I don't see any alias created or any rules made outside of the country blocks.  Should I see any firewall alias's or rules after entering an ipv4 list/s?

                                            I've done my fair share of looking through this thread and I still can't figure it out.  Any help would be greatly appreciated, even if its "no you're doing it wrong".

                                            Thanks,
                                            Tom

                                            pfblocker_ipv4_list_screen.png
                                            pfblocker_ipv4_list_screen.png_thumb
                                            pfblocker_ipv4_list_screen2.png
                                            pfblocker_ipv4_list_screen2.png_thumb

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.