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

    States Not Being Killed PFblockerNG

    Scheduled Pinned Locked Moved pfBlockerNG
    3 Posts 2 Posters 1.0k 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
      pfsense555
      last edited by

      We're experiencing a problem where existing states are not being killed by pfBlockerNG when a new IP is added to an IPv4 alias list.

      Running pfSense 2.3.4-RELEASE-p1 on Netgate hardware with pfBlockerNG 2.1.1_10

      In Firewall > pfBlockerNG > General, Kill States is checked.

      The Alias List config here Firewall > pfBlockerNG > Edit > IPv4 is as follows:
      Alias Name: HTTP_Blocked_dynamic_2
      IPv4 Lists: Format: Auto, State: ON, Source: http://host/url.txt, Header/Label: HTTP_Blocked
      List Action: Alias Deny
      Update Frequency: Every Hour
      Enable Logging: Enable
      States Removal: Enable

      When a new IP is added to the HTTP Source and the Cron job runs, the IP is added to the alias list and new connections from this IP are being handled appropriately. However existing states are not being matched and/or killed.

      Here is an example from the pfblockerng.log:

      ===[  Aliastables / Rules  ]==========================================

      No changes to Firewall rules, skipping Filter Reload

      Updating: pfB_HTTP_Blocked_dynamic_2
      1 addresses added.

      ===[  Kill States  ]==================================================

      No matching states found

      We know the states for the IP are still there because we can still see them by filtering here: Diagnostics > States > States. If we manually kill the states then the IP's get blocked immediately.

      We also attempted this in a lab using the latest builds of pfSense 2.4.0 with pfBlockerNG 2.1.2 and experienced the same issue. The last time we know this was working was with pfSense 2.2.6 which we recently upgraded from.

      Any help or suggestions with this would be appreciated.

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

        Thanks for reporting this… Looks like it wasn't picking up Alias type rules with "pfb_" in the Rule descriptions.

        Can you edit:  /usr/local/pkg/pfblockerng/pfblockerng.inc

        https://github.com/pfsense/FreeBSD-ports/blob/devel/net/pfSense-pkg-pfBlockerNG/files/usr/local/pkg/pfblockerng/pfblockerng.inc#L5099

        and change Line #5099

        from:

        if ($alias['type'] == 'urltable' && strpos($alias['name'], 'pfB_') !== FALSE && strpos($alias['descr'], '[s]') === FALSE) {
        
        to:
        [code]
        if ($alias['type'] == 'urltable' &&
            (strpos($alias['name'], 'pfB_') !== FALSE || strpos($alias['name'], 'pfb_') !== FALSE) &&
            strpos($alias['descr'], '[s]') === FALSE) {
        
        Please report back ... Thanks![/s][/code][/s]
        

        "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
        • P
          pfsense555
          last edited by

          @BBcan177:

          Thanks for reporting this… Looks like it wasn't picking up Alias type rules with "pfb_" in the Rule descriptions.

          Can you edit:  /usr/local/pkg/pfblockerng/pfblockerng.inc

          https://github.com/pfsense/FreeBSD-ports/blob/devel/net/pfSense-pkg-pfBlockerNG/files/usr/local/pkg/pfblockerng/pfblockerng.inc#L5099

          and change Line #5099

          from:

          if ($alias['type'] == 'urltable' && strpos($alias['name'], 'pfB_') !== FALSE && strpos($alias['descr'], '[s]') === FALSE) {
          
          to:
          [code]
          if ($alias['type'] == 'urltable' &&
              (strpos($alias['name'], 'pfB_') !== FALSE || strpos($alias['name'], 'pfb_') !== FALSE) &&
              strpos($alias['descr'], '[s]') === FALSE) {
          
          Please report back ... Thanks!
          
          I am still having the same issue after changing the code [/s][/code][/s]
          
          1 Reply Last reply Reply Quote 0
          • T totowentsouth referenced this topic on
          • First post
            Last post
          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.