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

    PfBlocker

    Scheduled Pinned Locked Moved pfSense Packages
    896 Posts 143 Posters 1.3m 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.
    • S
      Supermule Banned
      last edited by

      Thks Tom. Havent changed yet since the 2.0 platform is not totally there yet. :)

      It will be soon I hope….

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

        Version 1.3 problems.

        Error: Ipblocklist .txt feature does not work. I have to use .gz file type on txt lists. My recommendation is to remove the URL format option.
        Reason: All clear text lists will correctly work regardless of extension. If the list is compressed then it must use .gz as the extension.
        Fix: Therefore we can remove the user selection and treat every URL as .gz regardless of extension.

        Error: If no interfaces are selected then the package will not process
        Reason:  pfctl is looking for an interface in the rule syntax (“pass  in  quick  on $LAN )”
        Fix: IP-blocklist uses “any” as the default interface. I highly recommend using “any” as the default interface. We can at least have it as an option in the selection box. I get the best results using “any” in ipblocklist and countryblock.

        Error: switching inbound and outbound interfaces stops pfblocker from running correctly after saving settings
        Reason: unknown
        Fix: unknown
        Note: After changing interfaces on the fly and saving the settings the rules entry for pfblock are removed from rules.debug even though the table is still defined. Even after a filter reload the package still isn’t working

        Error: Selecting loopback as an interface causes rules to be removed from rules.debug
        Reason: unknown
        Fix: unknown

        Error: After blocking a specific IP with action “Deny Outbound” with ipblocklist feature I’m still able to ping
        Reason: I’m not exactly sure, but I didn’t have this behavior in ipblocklist
        Fix: unknown

        Also I figured out fetch.
        Problem: When adding dynamic links like http://list.iblocklist.com/?list=bt_ads&fileformat=p2p&archiveformat=gz the package tries to download the file.
        Reason: Fetch breaks because of the & symbols. So since the begging of IPblocklist we’ve always had to use direct URLs.
        Fix: Parse the URL in “”. Sofetch http://list.iblocklist.com/?list=bt_ads&fileformat=p2p&archiveformat=gzwill break but```
        fetch –o FILENAME http://list.iblocklist.com/?list=bt_ads&fileformat=p2p&archiveformat=gz

        You will have to assign a file name to each file otherwise the default filename will be something like “?list=bt_ads&fileformat=p2p&archiveformat=gz”
        
        I haven’t had the time to find sample code changes for the above problems. I’m still looking deeper into the reason why some of those errors occur.

        -Tom Schaefer
        SuperMicro 1U 2X Intel pro/1000 Dual Core Intel 2.2 Ghz - 2 Gig RAM

        Please support pfBlocker | File Browser | Strikeback

        1 Reply Last reply Reply Quote 0
        • marcellocM
          marcelloc
          last edited by

          Erros fixed :

          • table reload is now forced after each config change

          • fix wrong php function to get clear text lists from url

          Not erros:
          When you choose no interfaces, pfBlocker creates only Aliases for any custom rules you want.
          some examples:

          • block only smtp from top spammers

          • Block everything except inbound 80

          Many thanks to tommyboy180.

          NOTE:
          These fixes solves almost all erros tommyboy180 found in 1.3
          pfctrl was not reloading tables so almost all tests failed.
          while doing new tests, check diagnostics -> tables updates.
          I've did same tests after fix and seems to be ok for me.

          how to apply? reinstall package.

          Treinamentos de Elite: http://sys-squad.com

          Help a community developer! ;D

          1 Reply Last reply Reply Quote 0
          • J
            johnnybe
            last edited by

            Congratulations marcelloc and tommyboy180!
            Very well done.

            Just a note:
            A better brief description in the Package Manager, and probably the most important: a Package Info link with more details.
            Does it blocks MSN, Facebook, Orkut and this or that even behind a transparent Proxy or not?

            you would not believe the view up here

            1 Reply Last reply Reply Quote 0
            • marcellocM
              marcelloc
              last edited by

              If you have social networks ip ranges on a url, it will work on transparent proxies.

              If you have squid on same pfsense you have to create a custom floating rule for this.

              Treinamentos de Elite: http://sys-squad.com

              Help a community developer! ;D

              1 Reply Last reply Reply Quote 0
              • AhnHELA
                AhnHEL
                last edited by

                Trying out your new pfblocker, awesome idea to combine packages.

                I've added about 13 iblocklist lists in gz format and I'm getting this error on save.

                php: /pkg_edit.php: New alert found: pfBlockerInbound alias table is too large. Reduce Inbound list or increase "Firewall Maximum Table Entries" value to at least 818134 in "system - advanced - Firewall/NAT".
                
                

                I have 4 gigs RAM and my current Table Entries Size is 100000 so i raised it to 1000000.  Enabled pfblocker and hit save and then got this

                php: : There were error(s) loading the rules: /tmp/rules.debug:18: cannot define table pfBlockerInbound: Cannot allocate memory pfctl: Syntax error in config file: pf rules not loaded - The line in question reads [18]: table <pfblockerinbound> persist file "/var/db/aliastables/pfBlockerInbound.txt"
                Oct 30 02:11:29 	php: : New alert found: There were error(s) loading the rules: /tmp/rules.debug:18: cannot define table pfBlockerInbound: Cannot allocate memory pfctl: Syntax error in config file: pf rules not loaded The line in question reads [18]: table <pfblockerinbound> persist file "/var/db/aliastables/pfBlockerInbound.txt"
                Oct 30 02:11:26 	php: : The command '/sbin/pfctl -o basic -f /tmp/rules.debug' returned exit code '1', the output was '/tmp/rules.debug:18: cannot define table pfBlockerInbound: Cannot allocate memory pfctl: Syntax error in config file: pf rules not loaded'</pfblockerinbound></pfblockerinbound>
                

                Neither IPblocklist nor countryblock were installed when i installed pfblocker.  Memory usage is at 19%.

                Line 18 in /tmp/rules.debug

                table <pfblockerinbound> persist file "/var/db/aliastables/pfBlockerInbound.txt"</pfblockerinbound>
                

                AhnHEL (Angel)

                1 Reply Last reply Reply Quote 0
                • marcellocM
                  marcelloc
                  last edited by

                  Did you tried to reaply pfBlocker config, after increasing Firewall Maximum Table Entries to 1000000?

                  It seems that your change in "Firewall Maximum Table Entries" value did not take effect.

                  Cannot allocate memory pfctl: Syntax error in config file error is exactly what happens when  "Firewall Maximum Table Entries"  is lower then applied table size.

                  EDIT
                  Last package update was about 08 hours ago without version changing, so try to reinstall package to be sure you are on latest version.

                  Treinamentos de Elite: http://sys-squad.com

                  Help a community developer! ;D

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

                    I'm looking forward to trying the new package, when you'll add configurable update frequency.

                    I'm currently using a couple of shell scripts, to add pf tables of unwanted IPs to pfsense, e.g.

                    http://www.spamhaus.org/drop/drop.lasso
                    DROP (Don't Route Or Peer) is an advisory "drop all traffic" list, consisting of stolen 'hijacked' netblocks and netblocks controlled entirely by professional spammers. DROP is a tiny subset of the SBL designed for use by firewalls and routing equipment.

                    http://feeds.dshield.org/top10-2.txt
                    DShield's current Most Active Attacking IPs
                    (Same data as is used on DShield.org Top 10 Most Wanted.)
                    0 = IP Address, 1 = Resolved domain of IP Address

                    which are both updated on a daily basis.

                    1 Reply Last reply Reply Quote 0
                    • marcellocM
                      marcelloc
                      last edited by

                      I'm looking forward to trying the new package, when you'll add configurable update frequency.

                      Maybe today.

                      I'll also check ips without netmask to be able to include dshield.org lists compatibility.

                      Treinamentos de Elite: http://sys-squad.com

                      Help a community developer! ;D

                      1 Reply Last reply Reply Quote 0
                      • AhnHELA
                        AhnHEL
                        last edited by

                        @marcelloc:

                        Did you tried to reaply pfBlocker config, after increasing Firewall Maximum Table Entries to 1000000?

                        It seems that your change in "Firewall Maximum Table Entries" value did not take effect.

                        Cannot allocate memory pfctl: Syntax error in config file error is exactly what happens when  "Firewall Maximum Table Entries"  is lower then applied table size.

                        EDIT
                        Last package update was about 08 hours ago without version changing, so try to reinstall package to be sure you are on latest version.

                        Double checked Maximum Table Entries in /System/Advanced/Firewall-NAT, uninstalled and reinstalled package, even rebooted box, still same error.  Only other packages running are Snort, Unbound and Cron.

                        AhnHEL (Angel)

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

                          @dhatz:

                          I'm looking forward to trying the new package, when you'll add configurable update frequency.

                          I'm currently using a couple of shell scripts, to add pf tables of unwanted IPs to pfsense, e.g.

                          http://www.spamhaus.org/drop/drop.lasso
                          DROP (Don't Route Or Peer) is an advisory "drop all traffic" list, consisting of stolen 'hijacked' netblocks and netblocks controlled entirely by professional spammers. DROP is a tiny subset of the SBL designed for use by firewalls and routing equipment.

                          http://feeds.dshield.org/top10-2.txt
                          DShield's current Most Active Attacking IPs
                          (Same data as is used on DShield.org Top 10 Most Wanted.)
                          0 = IP Address, 1 = Resolved domain of IP Address

                          which are both updated on a daily basis.

                          iblocklist.com has a the DROP list from spamhaus.org  URL: http://list.iblocklist.com/?list=sh_drop&fileformat=p2p&archiveformat=gz

                          iblocklist.com also has the dshield list from Bluetack  URL: http://list.iblocklist.com/?list=bt_dshield&fileformat=p2p&archiveformat=gz

                          iblocklist.com has many lists in p2p format.

                          -Tom Schaefer
                          SuperMicro 1U 2X Intel pro/1000 Dual Core Intel 2.2 Ghz - 2 Gig RAM

                          Please support pfBlocker | File Browser | Strikeback

                          1 Reply Last reply Reply Quote 0
                          • marcellocM
                            marcelloc
                            last edited by

                            @onhel:

                            Double checked Maximum Table Entries in /System/Advanced/Firewall-NAT, uninstalled and reinstalled package, even rebooted box, still same error.  Only other packages running are Snort, Unbound and Cron.

                            send me your lists in PM. I'll try on my vm.

                            Treinamentos de Elite: http://sys-squad.com

                            Help a community developer! ;D

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

                              Great, I look forward to it.

                              Actually, I think pfsense would benefit from an enhanced aliastable feature, that would maintain (collect data, process, store) IP ranges of interest as text files in CIDR-notation fomat in /var/db/aliastables and load them into pf tables.

                              Those would include the usual IP black-list sources (e.g. Spamhaus' drop.lasso, DShield etc), country IP ranges (though I personally don't favor the practice of blocking entire countries) but also IP ranges of popular sites (Amazon EC2, Facebook, Google, Hotmail, SAP) to be black-listed or white-listed.

                              I think it's a feature that will be increasingly asked for, as more companies move to SaaS http://en.wikipedia.org/wiki/Software_as_a_service provider

                              In fact I recently suggested it Feature #1901: Maintain IP range tables for popular Internet sites having that in mind.

                              1 Reply Last reply Reply Quote 0
                              • marcellocM
                                marcelloc
                                last edited by

                                @dhatz:

                                Great, I look forward to it.

                                Actually, I think pfsense would benefit from an enhanced aliastable feature, that would maintain (collect data, process, store) IP ranges of interest as text files in CIDR-notation fomat in /var/db/aliastables and load them into pf tables.

                                Those would include the usual IP black-list sources (e.g. Spamhaus' drop.lasso, DShield etc), country IP ranges (though I personally don't favor the practice of blocking entire countries) but also IP ranges of popular sites (Amazon EC2, Facebook, Google, Hotmail, SAP) to be black-listed or white-listed.

                                I think it's a feature that will be increasingly asked for, as more companies move to SaaS http://en.wikipedia.org/wiki/Software_as_a_service provider

                                In fact I recently suggested it Feature #1901: Maintain IP range tables for popular Internet sites having that in mind.

                                Isn't this the main feature of pfBlocker lists??

                                Treinamentos de Elite: http://sys-squad.com

                                Help a community developer! ;D

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

                                  @marcelloc:

                                  Isn't this the main feature of pfBlocker lists??

                                  Yup. Exactly.

                                  dhatz,
                                    iblocklist.com has all those lists you asked for and more. p2p is a widely used format and is incredibly popular across many websites.

                                  @dhatz:

                                  …Actually, I think pfsense would benefit from an enhanced aliastable feature, that would maintain (collect data, process, store) IP ranges of interest as text files in CIDR-notation fomat in /var/db/aliastables and load them into pf tables….

                                  That is exactly what is working in pfblocker right now!

                                  @dhatz:

                                  ….Those would include the usual IP black-list sources (e.g. Spamhaus' drop.lasso, DShield etc), country IP ranges (though I personally don't favor the practice of blocking entire countries) but also IP ranges of popular sites (Amazon EC2, Facebook, Google, Hotmail, SAP) to be black-listed or white-listed….

                                  That is exactly what the ipblocklist feature does in pfblocker. Your lists just have to follow p2p format which iblocklist.com has for the lists that you want!

                                  pfblocker gives users more power when it comes to blocking IP ranges (country sources and list sources), whitelisting IP ranges (country sources and list sources), whitelisting popular IPs of sites like Google, Hotmail, etc, and are updated frequently by the list maintainer.
                                  pfblocker already does everything that you are asking for!

                                  -Tom Schaefer
                                  SuperMicro 1U 2X Intel pro/1000 Dual Core Intel 2.2 Ghz - 2 Gig RAM

                                  Please support pfBlocker | File Browser | Strikeback

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

                                    Well, I haven't tried it yet, but given the name pfBlocker I assumed it was mainly about blocking  :D

                                    PS: How "safe" is list.iblocklist.com as a source (site security, DNS hijacking, GPG signing etc) ?

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

                                      @dhatz:

                                      Well, I haven't tried it yet, but given the name pfBlocker I assumed it was mainly about blocking  :D

                                      lol, so you're asking for features without even testing the software? Thanks.

                                      -Tom Schaefer
                                      SuperMicro 1U 2X Intel pro/1000 Dual Core Intel 2.2 Ghz - 2 Gig RAM

                                      Please support pfBlocker | File Browser | Strikeback

                                      1 Reply Last reply Reply Quote 0
                                      • marcellocM
                                        marcelloc
                                        last edited by

                                        @dhatz:

                                        Well, I haven't tried it yet, but given the name pfBlocker I assumed it was mainly about blocking  :D

                                        PS: How "safe" is list.iblocklist.com as a source (site security, DNS hijacking, GPG signing etc) ?

                                        I will follow Johnnybe suggestion and increase pfBlocker description for better understanding.

                                        Treinamentos de Elite: http://sys-squad.com

                                        Help a community developer! ;D

                                        1 Reply Last reply Reply Quote 0
                                        • AhnHELA
                                          AhnHEL
                                          last edited by

                                          @marcelloc:

                                          send me your lists in PM. I'll try on my vm.

                                          PM sent, thank you.

                                          AhnHEL (Angel)

                                          1 Reply Last reply Reply Quote 0
                                          • J
                                            johnnybe
                                            last edited by

                                            @marcelloc:

                                            @dhatz:

                                            Well, I haven't tried it yet, but given the name pfBlocker I assumed it was mainly about blocking  :D

                                            PS: How "safe" is list.iblocklist.com as a source (site security, DNS hijacking, GPG signing etc) ?

                                            I will follow Johnnybe suggestion and increase pfBlocker description for better understanding.

                                            Sounds good. Do it… do it. Thanks.  ;D

                                            you would not believe the view up here

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