PfBlockerNG v2.0 w/DNSBL


  • Moderator

    @TyphooN:

    I fixed the stability problem and the issue was not DNSBL.

    Glad you got it sorted out  :)



  • Hi,

    I have one IPV4 alias list that works before and now are generating the "/var/db/aliastables/pfB_Allow_List.txt"

    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <title>400 - Bad Request</title>

    400 - Bad Request

    Why that happening?

    Thanks


  • Moderator

    @heliop100:

    <title>400 - Bad Request</title>

    What URL are you using? Load the URL in the browser and see what it returns. You're getting a 400 error on connection. Check the Alerts tab if something is blocking access to that URL.

    "The 400 Bad Request error is an HTTP status code that means that the request you sent to the website server, often something simple like a request to load a web page, was somehow incorrect or corrupted and the server couldn't understand it."



  • Hi,

    It's not an URL.
    Is a WHOIS based on AS number.

    Thanks


  • Moderator

    @heliop100:

    Is a WHOIS based on AS number.

    So you select "whois" and enter an AS for example:    AS13414    in the source field? Is this an IPv4 or v6 alias? Maybe post a screenshot…

    What does this command report when you run it from the shell? You can change the ASN to the number that you configured above:

    mwhois -h whois.radb.net \!gAS13414
    

    UPDATE:
    You can see if its listed in DNSBL and if the host cmd responds with the DNSBL VIP, then it need to be whitelist in DNSBL.

    host -t A whois.radb.net
    


  • @BBcan177:

    @heliop100:

    Is a WHOIS based on AS number.

    So you select "whois" and enter an AS for example:    AS13414    in the source field? Is this an IPv4 or v6 alias? Maybe post a screenshot…

    What does this command report when you run it from the shell? You can change the ASN to the number that you configured above:

    mwhois -h whois.radb.net \!gAS13414
    

    UPDATE:
    You can see if its listed in DNSBL and if the host cmd responds with the DNSBL VIP, then it need to be whitelist in DNSBL.

    host -t A whois.radb.net
    

    Hi, is an IPV4 alias.

    mwhois -h whois.radb.net \!gAS13414
    ```returs:
    
    mwhois -h whois.radb.net \!gAS14061
    
    A3848
    5.101.96.0/21 5.101.104.0/22 5.101.108.0/24 5.101.109.0/24 5.101.110.0/24 5.101.111.0/24 37.139.0.0/19 45.55.32.0/19 45.55.64.0/19 45.55.96.0/22 45.55.100.0/22 45.55.104.0/22 45.55.116.0/22 45.55.120.0/22 45.55.124.0/22 45.55.128.0/17 45.55.128.0/18 45.55.192.0/18 46.101.0.0/18 46.101.64.0/22 46.101.68.0/22 46.101.72.0/21 ….. a lot more
    
    And
    
    

    host -t A whois.radb.net

    
    whois.radb.net has address 198.108.0.18
    
    DNSBL are disable.
    Thanks.
    
    ![pfbloquerNG.jpg](/public/_imported_attachments_/1/pfbloquerNG.jpg)
    ![pfbloquerNG.jpg_thumb](/public/_imported_attachments_/1/pfbloquerNG.jpg_thumb)

  • Moderator

    You're on an older version of pfSense and pfBlockerNG… I'd suggest updating to the latest versions...



  • BBcan, I've read and been using most of the feeds mentioned in the first few pages of this thread.  Is there an exhaustive list of feeds or any "must have" feeds that I might have missed?  Thank you!  8)


  • Moderator

    @TyphooN:

    BBcan, I've read and been using most of the feeds mentioned in the first few pages of this thread.  Is there an exhaustive list of feeds or any "must have" feeds that I might have missed?  Thank you!  8)

    I am working on the next version of pfBlockerNG v3.0 which will have a Feeds Management Tab for IPv4/v6/DNSBL feeds … plus many other features ...

    Currently listing:

    • IPv4:  105 Feeds

    • IPv6:      9 Feeds

    • DNSBL: 71 Feeds

    Just working on the last bits … Hope to have it out soon....
    I will post some screenshots when I can...



  • @BBcan177:

    @TyphooN:

    BBcan, I've read and been using most of the feeds mentioned in the first few pages of this thread.  Is there an exhaustive list of feeds or any "must have" feeds that I might have missed?  Thank you!  8)

    I am working on the next version of pfBlockerNG v3.0 which will have a Feeds Management Tab for IPv4/v6/DNSBL feeds … plus many other features ...

    Currently listing:

    • IPv4:  105 Feeds

    • IPv6:      9 Feeds

    • DNSBL: 71 Feeds

    Just working on the last bits … Hope to have it out soon....
    I will post some screenshots when I can...

    Awesome!  Can't wait for it's release!  Thank you for your continued contribution, pfBlockerNG is already great but this is the icing on the cake!



  • @BBcan177:

    I am working on the next version of pfBlockerNG v3.0 which will have a Feeds Management Tab for IPv4/v6/DNSBL feeds … plus many other features ...
    I will post some screenshots when I can...

    As one of BBcan's testers, I can tell you he has done an amazing job on this feature.  It alone will be worth the update.


  • Banned

    Any guesstimates for ETA?



  • I'd like to report a serious bug.

    After the first setup and first reboot, PFblockerNG proceeds to alter the order of the pre-existing Floating Rules.
    Before PFblockerNG:

    1º Custom quick Allow rules to many things

    2º Custom quick Deny all rule to all traffic on my subnets.

    After PFblockerNG

    1º  PFblocker own rules

    2º Custom quick Deny all rule to all traffic on my subnets.

    3º Custom quick Allow rules to many things.

    It changed the order of my Deny Rule to be above my Allow rules, thus blocking all traffic.

    I fixed the rules ordering, but I have yet to reboot the machine to see if they are preserved.

    Edit: I see there is an option on how to order pfblockerng floating rules, and the default one  says:

    pfb_block / Reject | all other rules

    It either considered my custom Deny rule to be one of its own, or it simply parses all existing rules looking for "deny/reject" and jumps them ahead.



  • @Ramosel:

    @BBcan177:

    I am working on the next version of pfBlockerNG v3.0 which will have a Feeds Management Tab for IPv4/v6/DNSBL feeds … plus many other features ...
    I will post some screenshots when I can...

    As one of BBcan's testers, I can tell you he has done an amazing job on this feature.  It alone will be worth the update.

    How do you become a tester?  I would like to sign up if any more are needed!  I always love to try bleeding edge/potentially buggy software and assist in the debugging/feedback process.  Kind of why I religiously update my pfSense box daily whenever updates are available :)


  • Moderator

    @TyphooN:

    How do you become a tester?  I would like to sign up if any more are needed!  I always love to try bleeding edge/potentially buggy software and assist in the debugging/feedback process.  Kind of why I religiously update my pfSense box daily whenever updates are available :)

    I sent a PM :)



  • @BBcan177:

    @TyphooN:

    How do you become a tester?  I would like to sign up if any more are needed!  I always love to try bleeding edge/potentially buggy software and assist in the debugging/feedback process.  Kind of why I religiously update my pfSense box daily whenever updates are available :)

    I sent a PM :)

    I'd love  to test too.. :) let me know if can include me..



  • Just got caught up on this thread.  The only thing I am unclear on is what is the ramifications of having these two options enabled?

    1. Register DHCP leases in the DNS Resolver
    2. Register Static DHCP static mappings in the DNS Resolver

    Thanks.



  • At every registration, Unbound reloads, so if it takes 1-3 minutes to restart (depending on you domain block list size), you have no DNS service available.

    Static mappings are not dynamic, so Unbound will reload only when you save the mappings.



  • Yes, unbound reloading delay makes sense.  Look like I will have to limit my DNSBL feeds since I need both features enabled.

    Another question for DNSBL is do you normally Deny Both or just Deny Outbound and allow pfSense implicit block to handle the inbound.  I am trying to imagine a case for Deny Both in DNSBL.  For anything incoming, the session has to be initiated from inside the firewall.  So for unwanted ads to come in, they have to be embedded in the response of the original request in the form of actual content and not a URL.  In which case, DNSBL would not be able to block it anyway.



  • @RonpfS:

    At every registration, Unbound reloads, so if it takes 1-3 minutes to restart (depending on you domain block list size), you have no DNS service available.

    Static mappings are not dynamic, so Unbound will reload only when you save the mappings.

    Thanks Ron. This might be added as an explanation in the screen, next to these two options.


  • Moderator

    @mifronte:

    Another question for DNSBL is do you normally Deny Both or just Deny Outbound and allow pfSense implicit block to handle the inbound.  I am trying to imagine a case for Deny Both in DNSBL.  For anything incoming, the session has to be initiated from inside the firewall.  So for unwanted ads to come in, they have to be embedded in the response of the original request in the form of actual content and not a URL.  In which case, DNSBL would not be able to block it anyway.

    If you have open WAN ports, then you only need to protect those ports… If so, you can use the "Adv. Inbound" rule settings to add the DST IP(s) and Port(s) so the rules are effective for those events only... The default pfSense block rule on the WAN will handle all other blocking required...

    IP Blocking uses the Firewall rules to block/permit/match while DNSBL is blocking based on DNS request by the LAN clients... Don't get the two mixed up :)



  • @BBcan177:

    IP Blocking uses the Firewall rules to block/permit/match while DNSBL is blocking based on DNS request by the LAN clients... Don't get the two mixed up :)

    Sorry if I sound like a newbie, but I just found out about pfBLockNG a few days ago and have been reading the forums to fully understand the package.

    This is where I am confused about is if DNSBL is blocking based on DNS request by the LAN clients, why are there options in DNSBL to block incoming?  I am trying to understand a scenario where I would have DNS request coming in through the WAN that I would need blocking.  Or is the incoming blocking options in DNSBL is just a way to implement IP Blocking using DNSBL feeds?

    I am feeling like I am missing a connection to fully understand the difference between IP blocking and DNSBL "incoming" blocking.  By incoming, I am referring to requests originating from the WAN/internet.


  • Moderator

    @mifronte:

    -I am missing a connection to fully understand the difference between IP blocking and DNSBL "incoming" blocking.  My incoming, I am referring to requests originating from the WAN/internet.

    Some of the DNSBL Feeds contain IP addresses.. So when IPs are found in DNSBL, they can be added to a "DNSBL_IP" aliastable to be blocked. So the IP settings in DNSBL are just for that part. Typically IP based feeds are entered in the IPv4/6 Tabs and GeoIP.

    There is also a "Permit Rule" in DNSBL which is used to allow other Vlans to be able to access the DNSBL VIP address.

    Hope that makes it clearer.



  • I have the latest version to date and wondering if there is a way, or if in the future, possible to whitelist IPs from companies like Teamviewer sending email from Germany when all countries are blocked?

    I understand it sounds counter productive as pfSense blocks all by default but we want pfBlockerNG blocking all international traffic as we open ports for services and don't need the N. Koreans attempting any crazy stuff.  pfBlockerNG has done a marvelous in blocking unwanted international email spam which is an A+++!


  • Moderator

    @mgc6288:

    I have the latest version to date and wondering if there is a way, or if in the future, possible to whitelist IPs from companies like Teamviewer sending email from Germany when all countries are blocked?

    I understand it sounds counter productive as pfSense blocks all by default but we want pfBlockerNG blocking all international traffic as we open ports for services and don't need the N. Koreans attempting any crazy stuff.  pfBlockerNG has done a marvelous in blocking unwanted international email spam which is an A+++!

    To overcome an IP that is blocked by a GeoIP Alias, you can create a "Permit" Alias, and add the IPs to the customlist at the bottom of this new Alias. Then set the appropriate action such as "Permit Outbound". Then ensure that this Permit rule is above the other Block rules by setting the appropriate "Rule Order" setting in the general tab.

    You can also use the "Whois" setting in the IPv4 tab to whitelist a particular ASN number.  Click on the blue infoblock icons in the IPv4 tab for further details.



  • Hi

    The GZ from http://list.iblocklist.com/?list=bt_spyware&fileformat=p2p&archiveformat=gz  is not wokring it keeps making Download FAIL, but the link is working just fine?



  • @BBcan177:

    @mgc6288:

    I have the latest version to date and wondering if there is a way, or if in the future, possible to whitelist IPs from companies like Teamviewer sending email from Germany when all countries are blocked?

    I understand it sounds counter productive as pfSense blocks all by default but we want pfBlockerNG blocking all international traffic as we open ports for services and don't need the N. Koreans attempting any crazy stuff.  pfBlockerNG has done a marvelous in blocking unwanted international email spam which is an A+++!

    To overcome an IP that is blocked by a GeoIP Alias, you can create a "Permit" Alias, and add the IPs to the customlist at the bottom of this new Alias. Then set the appropriate action such as "Permit Outbound". Then ensure that this Permit rule is above the other Block rules by setting the appropriate "Rule Order" setting in the general tab.

    You can also use the "Whois" setting in the IPv4 tab to whitelist a particular ASN number.  Click on the blue infoblock icons in the IPv4 tab for further details.

    Are you able to share a screencap of adding a IP and/or domain? I have tried, but those sites are still getting blocked. I use WHOIS and tried the IP's and tried the domain names and tried the ASN names. I used Permit both and also change the rule order. The new rule was added to the top of the WAN rules list, but still no go. So I must be doing something wrong somewhere.

    Thanks


  • Moderator

    @Mikki-10:

    Hi

    The GZ from http://list.iblocklist.com/?list=bt_spyware&fileformat=p2p&archiveformat=gz  is not wokring it keeps making Download FAIL, but the link is working just fine?

    Check the Alerts tab and see if its being blocked?


  • Moderator

    @iculookn:

    Are you able to share a screencap of adding a IP and/or domain? I have tried, but those sites are still getting blocked. I use WHOIS and tried the IP's and tried the domain names and tried the ASN names. I used Permit both and also change the rule order. The new rule was added to the top of the WAN rules list, but still no go. So I must be doing something wrong somewhere.

    Thanks

    Typically you do not want to use "Permit Both" as pfSense is a stateful firewall by design…. So you would want the LAN to make the request outbound which creates a firewall state entry that allows the IP to return back thru on the WAN side.... So when you use "Permit Both", you are allowing those IPs to access your network without a LAN device first making the request for it....  If you have a webserver, then that would be more applicable...

    For the IP whitelist, did you add the IP that you want to access to an IPv4 customlist? Did you set the Rule order option in the General Tab to put the Permit rules above the Blocked rules? Rules are processed top to bottom.



  • @BBcan177:

    I am working on the next version of pfBlockerNG v3.0 which will have a Feeds Management Tab for IPv4/v6/DNSBL feeds … plus many other features ...

    Currently listing:

    • IPv4:  105 Feeds

    • IPv6:      9 Feeds

    • DNSBL: 71 Feeds

    Just working on the last bits … Hope to have it out soon....
    I will post some screenshots when I can...

    Hey BBcan177, first and foremost, thanks for your work on this. It's coming up to 2 years since you launched it here, and you have remained available to chat to all levels of users!

    I just wanted to see if v3 was close to launching, or if I could help out with the testing at all?

    Cheers



  • What do you guys do for a dual stack supported pfsense, ie both IPv6 and IPv4?  I can set all the IPv4 stuff up no problem, but most systems will use the IPv6 resolvers, which pretty much bypasses all of this stuff.  I could modify systems to use ipv4 first, but would much rather resolve the issue on the DNSBL side.



  • Hello, sorry if this has been addressed before.  69 pages to scan through is a lot.

    I am getting this strange certificate error randomly where the certificate issuer is DNSBL.  So the browser is correct to issue a warning, however I am curious if this can be avoided.

    A good test would be to do a google search for a product and then click the very first link in the search results.  I searched for Otterbox for example, and clicked the first link.  I was immediately warned of a certificate trust issue for DNSBL.

    The only thing I have in DNSBL is the EasyList w/o Elements and EasyPrivacy.

    I thought some sites online were telling me to install this certificate.  Thats not hard on one machine, but when you have a lot of other machines, or devices, I'm not sure of an easy way to install custom certs on appliances, embedded OS's, different makes and models of android tablets and phones, iphones and ipads, etc…



  • Nevermind, fixed it with a firewall rule on the lan side as first mentioned in this post:
    https://forum.pfsense.org/index.php?topic=124945.msg697380#msg697380



  • Hi,

    I am wondering why the "easylist w/o elements" + "easy pricacy" is not working when I open this website to test adblock tester: http://simple-adblock.com/faq/testing-your-adblocker/. It works when I install the ABP browser extension though.

    I have tried to parse easylist to be able to work with squidguard. But once squidgaurd detects it, the entire page will be affected not the only elements. Not a good idea.

    I hope you can enlighten me and the rest here.

    Thanks!

    Regards,
    xChaz


  • Moderator

    @xchaz:

    I am wondering why the "easylist w/o elements" + "easy pricacy" is not working when I open this website to test adblock tester: http://simple-adblock.com/faq/testing-your-adblocker/. It works when I install the ABP browser extension though.

    DNS based blockers work differently than Browser based blockers. The best test would be to use the pfBlockerNG log tab and view the EasyList feed and run a:

    host -t A example.com
    

    and if it replies back with the DNSBL VIP then its being blocked correctly.



  • Thanks for the reply. Its working. I want to block youtube ads. When this will be available?



  • Moderator

    @xchaz:

    I want to block youtube ads. When this will be available?

    Blocking via DNS is difficult with Domain based blocking, as Youtube/Google mix the webpages and ADs together, so blocking ADs may also block other webpages…

    There are some Youtube based Feeds but YMMV on how well it performs.



  • @BBcan177:

    Blocking via DNS is difficult with Domain based blocking, as Youtube/Google mix the webpages and ADs together, so blocking ADs may also block other webpages…

    Agree. It's a challenge on how to make this work without affecting the entire/other webpages. I think its time to add an unofficial 3rd party package, E2******. Well see how the content-control software do.



  • I've been trying to emulate the same configuration as this poster outlines, for the same reasons.  However the rule order preference that BBCan suggests doesn't seem to be followed, with the pfB alias_permit rule ("pfB AllowEmails") getting moved under the pfb block rules when the PFB cron update occurs.

    I should probably first state that I'm not using the DNSBL option.

    @BBcan177:

    @mgc6288:

    I have the latest version to date and wondering if there is a way, or if in the future, possible to whitelist IPs from companies like Teamviewer sending email from Germany when all countries are blocked?

    I understand it sounds counter productive as pfSense blocks all by default but we want pfBlockerNG blocking all international traffic as we open ports for services and don't need the N. Koreans attempting any crazy stuff.  pfBlockerNG has done a marvelous in blocking unwanted international email spam which is an A+++!

    To overcome an IP that is blocked by a GeoIP Alias, you can create a "Permit" Alias, and add the IPs to the customlist at the bottom of this new Alias. Then set the appropriate action such as "Permit Outbound". Then ensure that this Permit rule is above the other Block rules by setting the appropriate "Rule Order" setting in the general tab.

    You can also use the "Whois" setting in the IPv4 tab to whitelist a particular ASN number.  Click on the blue infoblock icons in the IPv4 tab for further details.

    I've attached image of rules as I would expect them to stay, given the selected PFB rule selection (image also attached).

    I've struggled with this system due to lack of concrete documentation (possibly also lack of brain power!!) and trying to peg together info from many sources, many of which conflict in the approach.  I found this reddit post to be the most helpful so far: https://www.reddit.com/r/PFSENSE/comments/48iiq4/pfblockerng_exceptionswhitelist/

    We host servers behind the pfSense box, so we have allow rules to forward specific service ports/virtual-IP's to those systems.  We now also need to block large attack volumes from countries/continents we have no business connection to - in particular people trying to hack into email accounts (causing account lockouts) and the VoIP server (which luckily provides its own blacklisting, but at penalty of additional network load).

    I have tried using the main suggestion of "allowed countries" (rather than "block the world") - but this doesn't seem to provide enough protection, as with that approach we still see connections to our internal servers from countries that we don't want/need.  So the "block the world" approach and then allowing our own country (UK), plus adding some whitelisted addresses for known customer email sources (using services such as Messagelabs which use server presences across Europe) seems to be the configuration that works as we want.

    I fully accept this whitelisting approach is not easy with need to keep our manual list updated - but once we get the main sources in the list it shouldn't need changing very often.

    But I'm worried that the PFB rule priority setting seems to be ignored (or that the whitelist is not seen as a Pass/Match rule) - or simply I've not understood how to keep the Alias_Permit definition at the top of the rules.  I can't spend time resetting the rule several times a day.

    So just in the time taken to write this, the PFB cron job has occurred and the rule order changed again (attachment "Rule order after PFB cron update.png)", once again moving our whitelist rule under the block rules.

    Any ideas what I am doing wrong?  Could it be that using the Alias_Permit instead of "Allow Inbound" for the IPv4 custom list is the problem?

    We are on pfSense version 2.3.4-p1, with PFB 2.1.1_10.  We also use SNORT (just updated from 3.2.9.3 to 3.2.9.5_1) and OpenVPN.

    Thanks.

    EDIT I experimented with changing the IPv4 alias list setting from "Alias_Permit" to "Permit_Inbound".  That then uses the PFB rule priority setting to place the whitelist at the top of the PFB "auto rules", as its now set by PFB itself.  My manually added rule was still present (but again had been moved below the PFB reject rules), so I've deleted it.

    While it seems I've got things working, I'd still like to know if there is any better config I can define that still matches the desired protection as described above.

    ![manually set allow rule.png](/public/imported_attachments/1/manually set allow rule.png)
    ![manually set allow rule.png_thumb](/public/imported_attachments/1/manually set allow rule.png_thumb)
    ![pfBlockerNG rule priority setting.png](/public/imported_attachments/1/pfBlockerNG rule priority setting.png)
    ![pfBlockerNG rule priority setting.png_thumb](/public/imported_attachments/1/pfBlockerNG rule priority setting.png_thumb)
    ![Rule order after PFB cron update.png](/public/imported_attachments/1/Rule order after PFB cron update.png)
    ![Rule order after PFB cron update.png_thumb](/public/imported_attachments/1/Rule order after PFB cron update.png_thumb)
    ![pfBlockerNG IPv4 Alias List setting changed to Allow Inbound.png](/public/imported_attachments/1/pfBlockerNG IPv4 Alias List setting changed to Allow Inbound.png)
    ![pfBlockerNG IPv4 Alias List setting changed to Allow Inbound.png_thumb](/public/imported_attachments/1/pfBlockerNG IPv4 Alias List setting changed to Allow Inbound.png_thumb)



  • @webtyro:

    @BBcan177
    First I wanted to thank you for the work you have put into this and as usual no real problems. I just wanted to ask about the gif image being pushed to the browser. When I browse to the VIP address I get a 1x1 pixel image.  Is this image a placecard holder that would be populated with info or should it be in a different scale. I run my browser locked down as much as possible so not having seen the image is not on my priority list. I can ping and browse to it but was wondering about the single pixel size. If this is normal unpopulated size no worries but if not where do you hide it and what size is the default.

    Where is this 1x1 Pixel option? I don't see it anywhere.


Log in to reply