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

    Sshlockout & webConfiguratorlockout rules

    Scheduled Pinned Locked Moved Firewalling
    4 Posts 3 Posters 1.8k 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.
    • F Offline
      fsansfil
      last edited by

      Hello,

      I would like to change those rules from rules.debug

      block in log quick proto tcp from <sshlockout>to (self) port 22 tracker 1000000301 label "sshlockout"
      block in log quick proto tcp from <webconfiguratorlockout>to (self) port 443 tracker 1000000351 label "webConfiguratorlockout"</webconfiguratorlockout></sshlockout>

      into…

      block in log quick proto tcp from <sshlockout>to any tracker 1000000301 label "sshlockout"
      block in log quick proto tcp from <webconfiguratorlockout>to any tracker 1000000351 label "webConfiguratorlockout"</webconfiguratorlockout></sshlockout>

      My understanding is…anyone bruteforcing should be block to any connection once they are in the table...

      Thanks.

      F.

      1 Reply Last reply Reply Quote 0
      • P Offline
        phil.davis
        last edited by

        That would mean that someone who tried to ssh (unsuccessfully) from LAN to oyuor pfSense box 15 times would get their whole internet blocked for an hour. I guess that inflicts an automatic punishment on those local clients trying to mess with the router!

        table <sshlockout>persist
        table <webconfiguratorlockout>persist</webconfiguratorlockout></sshlockout> 
        

        At the moment those tables are not exposed as aliases on the Firewall Rules GUI. Perhaps it would be useful if they were? Then you could add your own extra block rules to be more nasty to offenders.

        If you think it is worthwhile, then add a feature request to RedMine. And then write the code :)

        As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
        If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

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

          @fsansfil:

          I would like to change those rules from rules.debug

          Hi fsansfil,

          You can modify the file    /etc/inc/filter.inc    and change it to meet your needs, but it will get overwritten on any firmware update. You could also create a dif file and create a "System Patch".

          
             2585         $ipfrules .= "\n# SSH lockout\n";
             2586         if(is_array($config['system']['ssh']) && !empty($config['system']['ssh']['port'])) {
             2587                 $ipfrules .= "block in log quick proto tcp from <sshlockout> to (self) port ";
             2588                 $ipfrules .= $config['system']['ssh']['port'];
             2589                 $ipfrules .= " label \"sshlockout\"\n";
             2590         } else {
             2591                 if($config['system']['ssh']['port'] <> "")
             2592                         $sshport = $config['system']['ssh']['port'];
             2593                 else
             2594                         $sshport = 22;
             2595                 if($sshport)
             2596                         $ipfrules .= "block in log quick proto tcp from <sshlockout> to (self) port {$sshport} label \"sshlockout\"\n";
             2597         }
             2598
             2599         $ipfrules .= "\n# webConfigurator lockout\n";
             2600         if(!$config['system']['webgui']['port']) {
             2601                 if($config['system']['webgui']['protocol'] == "http")
             2602                         $webConfiguratorlockoutport = "80";
             2603                 else
             2604                         $webConfiguratorlockoutport = "443";
             2605         } else {
             2606                 $webConfiguratorlockoutport = $config['system']['webgui']['port'];
             2607         }
             2608         if($webConfiguratorlockoutport)
             2609                 $ipfrules .= "block in log quick proto tcp from <webconfiguratorlockout> to (self) port {$webConfiguratorlockoutport} label \"webConfiguratorloc
          kout\"\n";</webconfiguratorlockout></sshlockout></sshlockout>
          

          "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
          • F Offline
            fsansfil
            last edited by

            Thanks BB, very usefull!

            Cheers.

            F.

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