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

    IP-Blocklist

    Scheduled Pinned Locked Moved pfSense Packages
    496 Posts 86 Posters 503.5k 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.
    • W
      Woger
      last edited by

      @tommyboy180:

      @Woger:

      OK,
      Probably found the problem.
      both lists use a lot off the same ranges which are removed. This is because you use uniq -u in your convert script. The -u removes all duplicates. If I remove the -u it leaves 1 behind and I get 570 networks instead of 137. Is there a reason why you use the -u ?

      Greetings,
      Woger

      Why wouldn't you use the unique switch?

      uniq -u gets only the uniq lines from a file. So if there are double lines in a file these aren't uniq and will be discarded (as mentioned earlier in this thread). But without the -u switch, uniq will leave one of the double lines behind. For the 2 lists I use 358 lines in bt_hijacked and 469 lines in sh_drop there are more than 300 identical lines. With uniq -u these are all removed which ends in 139 lines in ipfw.ipfw. If I remove the -u switch the 300 identical lines are made uniq again which leaves more than 400 uniq lines in ipfw.ipfw.

      hmm.. not very explaining  ???. I'll try it like this:

      file "test" containg these lines:
      ip-1
      ip-1
      ip-2
      ip-3
      ip-3

      uniq -u test > test2 will result in a file which contains
      ip-2

      uniq test > test2 will result in a file which contains
      ip-1
      ip-2
      ip-3

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

        Well that is a major problem. I will hopefully push an update ASAP. Thanks for taking the time to explain it!

        -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
        • T
          tommyboy180
          last edited by

          Version 3.3 Released.

          • Fixed uniq -u bug

          • Removed email tab - no longer needed

          Thank you Woger!

          -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
          • W
            Woger
            last edited by

            No thanks,
            Glad I could help  :)
            Keep up the good work!

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

              When I try turning this on with one list added, I get the error:

              /tmp/rules.debug:86: cannot load "/usr/local/www/packages/countryblock/lists/countries.txt": No such file or directory

              I am running pfSense 2.0-RC3 (i386) Aug 18, 2011
              I have package IP-Blocklist 0.3.3
              I'm trying to use this list: http://www.tomschaefer.org/temp/pfsense/IP-Blocklist-ForumSpam.txt

              I don't have the "country block" package installed at all, so I don't get why I'm seeing this error…

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

                Did you have the countryblock package installed at any point?

                -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
                • S
                  Shuey
                  last edited by

                  @tommyboy180:

                  Did you have the countryblock package installed at any point?

                  Yes, and I could never get it to work properly.  But it was uninstalled and I also upgraded pfSense from RC2 to RC3.  I figured those two things would've fixed the problem, but pf obviously still sees some junk left over from CB.

                  What can I do?

                  1 Reply Last reply Reply Quote 0
                  • M
                    mliesenfelt
                    last edited by

                    I'm new to the forum. First I'd like to say thank you to tommyboy180 for his work and effort on the project.

                    I can confirm that ip-blocklist and country block do seem to interfere with each other and are not install-configure-run-uninstall-reinstall safe as Shuey mentioned. Also, the option for logging results seems to have amnesia.

                    I think this is a great project and I'm interesting in putting some time in to make it stable. Where is the source code for your branches and 3.3 beta located?

                    -Michael

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

                      @mliesenfelt:

                      I'm new to the forum. First I'd like to say thank you to tommyboy180 for his work and effort on the project.

                      I can confirm that ip-blocklist and country block do seem to interfere with each other and are not install-configure-run-uninstall-reinstall safe as Shuey mentioned. Also, the option for logging results seems to have amnesia.

                      I think this is a great project and I'm interesting in putting some time in to make it stable. Where is the source code for your branches and 3.3 beta located?

                      -Michael

                      Send me a PM.

                      -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
                      • T
                        tommyboy180
                        last edited by

                        Version 3.4 Released!

                        • Whitelists are persistent though reboots

                        • Logging stays checked when it's supposed to

                        • Removed old Warning from main page

                        • Added lvl1 list by default

                        • Changed description on package list

                        • Fixed i-frame error on main page

                        EDIT: The package has also gained several performance tweaks. The package uses less memory and processing time now.

                        -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
                        • S
                          Shuey
                          last edited by

                          @Shuey:

                          @tommyboy180:

                          Did you have the countryblock package installed at any point?

                          Yes, and I could never get it to work properly.  But it was uninstalled and I also upgraded pfSense from RC2 to RC3.  I figured those two things would've fixed the problem, but pf obviously still sees some junk left over from CB.

                          What can I do?

                          I pulled up a command line using the shell option and I navigated to the "/usr/local/www/packages/" directory - there is no subfolder named "countryblock".  The info from my error is being stored somewhere, but I don't know how to wipe it out so I can start over fresh.

                          Any help would be appreciated - thank you!

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

                            @Shuey:

                            @Shuey:

                            @tommyboy180:

                            Did you have the countryblock package installed at any point?

                            Yes, and I could never get it to work properly.  But it was uninstalled and I also upgraded pfSense from RC2 to RC3.  I figured those two things would've fixed the problem, but pf obviously still sees some junk left over from CB.

                            What can I do?

                            it's looking for it in /tmp/rules.debug but before you edit this file I want to ask if you have rebooted your system since you uninstalled countryblock. If you haven't then do so and your problem should be solved.
                            I pulled up a command line using the shell option and I navigated to the "/usr/local/www/packages/" directory - there is no subfolder named "countryblock".  The info from my error is being stored somewhere, but I don't know how to wipe it out so I can start over fresh.

                            Any help would be appreciated - thank you!

                            -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
                            • S
                              Shuey
                              last edited by

                              That's the crazy thing… I uninstalled CountryBlock, updated my pfSense build and rebooted the system.  I too was hoping this would fix the problem, but it hasn't.  So, to be safe, I just now uninstalled the IP-Blocklist package, verified that it and the CountryBlock packages are no longer showing up in my list of installed packages.  I rebooted the system, went back into packages, verified I still do not see a package for CountryBlock or IP-Blocklist.  I installed IP-Blocklist and then enabled it.  As soon as I saved the change, I got the error again :(

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

                                That's not right, lol. See if that file is mentioned in /tmp/rules.debug

                                -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
                                • S
                                  Shuey
                                  last edited by

                                  There is a section in my rules.debug file for CountryBlock.  I'm assuming I can just delete out the entire section of the file that references the CountryBlock information, but I'm not sure how to do it (and I'm hoping there is a fairly easy way to do it from the shell without having to use something very foreign like Vi).  I am a complete newb still when it comes to unix/linux, and I'm currently accessing my server through two hoops (SSH'd to my LAN from work to my Ubuntu server, then SSH'd from one of my Windows boxes on the LAN at home).  You would think I'd be more than capable just based on that info, but I've had a lot of help with my network so far, lol.

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

                                    I got it!  Since all I had to do was remove a few lines, I was able to find the info on how to navigate and work in Vi long enough to modify the file and I am now blocking IP's with IP-Blocklist!

                                    Thanks Tom, appreciate the help!

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

                                      @Shuey:

                                      I got it!  Since all I had to do was remove a few lines, I was able to find the info on how to navigate and work in Vi long enough to modify the file and I am now blocking IP's with IP-Blocklist!

                                      Thanks Tom, appreciate the help!

                                      What I can't figure out is why those lines were still in that file. That file gets deleted on system reboot and regenerated. Since you don't have the countryblock package then that shouldn't be happening unless….

                                      Do you have any countrblock scripts located in /usr/local/etc/rc.d or /usr/local/pkg/pf ?

                                      -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
                                      • S
                                        Shuey
                                        last edited by

                                        Hey Tom, thanks for the info.  Yep, there was a countryblock.sh file still left over in /usr/local/pkg/pf.  And of course the countryblock section was back in the rules.debug file again.  I deleted the countryblock script and removed the lines again in the rules.debug file and rebooted.  IP-Blocklist is running properly again now :).

                                        1 Reply Last reply Reply Quote 0
                                        • L
                                          ljbowdish
                                          last edited by

                                          I used your spam list, http://www.tomschaefer.org/temp/pfsense/IP-Blocklist-ForumSpam.txt, and then created my own, it's small, but it's a start,
                                          http://www.safetyservicesinc.com/spamlist/spamlist2.txt
                                          and added it to IP Blocklist.  When I started, the package reported
                                          You are blocking 46182 Networks/IPs
                                          I added about 25 ip's, but the number being blocked did not change.  Did I do something wrong??

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

                                            @ljbowdish:

                                            I used your spam list, http://www.tomschaefer.org/temp/pfsense/IP-Blocklist-ForumSpam.txt, and then created my own, it's small, but it's a start,
                                            http://www.safetyservicesinc.com/spamlist/spamlist2.txt
                                            and added it to IP Blocklist.  When I started, the package reported
                                            You are blocking 46182 Networks/IPs
                                            I added about 25 ip's, but the number being blocked did not change.  Did I do something wrong??

                                            Your syntax looks fine.  Remove the small list you made and save the changes.  See the number it's displaying.  Then add your small list again and save and see if the number changes.  If not, we'll have to refer this one to Tom.

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