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

    IP-Blocklist

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

      @tommyboy180:

      @darxmurf:

      @tommyboy180:

      Are you using Firefox or Chrome?

      Tested with chrome and firefox.
      Also I tried to mount the CF card in RW mode via ssh. I don't have any warning, I can load lists but still have 0 ip blocked

      SSH into your box and navigate to /usr/local/www/packages/ipblocklist/  and run convert-execute.sh
      Post any errors.

      Here is :

      0 table deleted.
      0 table deleted.
      ./convert-execute.sh: /usr/bin/perl: not found
      ./convert-execute.sh: /usr/bin/perl: not found
      rm: /usr/local/www/packages/ipblocklist/lists/ipfw.ipfwTEMP: No such file or directory
      rm: Wlists/whitelistTEMP: No such file or directory
      rm: /tmp/rules.debug.tmp: No such file or directory
      rm: /tmp/rules.debug.tmp: No such file or directory
      0
      1
      2
      ..
      ..
      219
      220

      it displays numbers from 0 to 220

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

        okay, found the solution

        I edited the file ipblocklist_list.php

        • added : require_once('config.inc');
        • added : conf_mount_rw(); and conf_mount_ro(); around the block line 69

        edited the file convert-execute.sh

        • changed "usr/bin/perl" to "/usr/local/bin/perl"

        edited convert.pl

        • changed "usr/bin/perl" to "/usr/local/bin/perl"

        It's now running and blocking the addresses I added in my list

        EDIT : how can I verify if it's really working ?
        EDIT 2 : I did not edit the whitelist.php file as I'm not using it…

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

          @darxmurf:

          okay, found the solution

          I edited the file ipblocklist_list.php

          • added : require_once('config.inc');
          • added : conf_mount_rw(); and conf_mount_ro(); around the block line 69

          edited the file convert-execute.sh

          • changed "usr/bin/perl" to "/usr/local/bin/perl"

          edited convert.pl

          • changed "usr/bin/perl" to "/usr/local/bin/perl"

          It's now running and blocking the addresses I added in my list

          EDIT : how can I verify if it's really working ?
          EDIT 2 : I did not edit the whitelist.php file as I'm not using it…

          To verify you can look at the pfctl table. Just look at the php code that counts how many IP networks are being counted.
          I'm glad you got it working! Since your running embedded I will just link to this post for other embedded users to view. Nice work!

          -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
            darxmurf
            last edited by

            cool, all looks okay.

            And btw, thanks for your package  ;D

            And for ppl with the embedded version, here is the detailed operation:

            via SSH :
            Login your system and go in the ip-blocklist folder : /usr/local/www/packages/ipblocklist
            mount your CF card in RW mode with this command : /etc/rc.conf_mount_rw
            edit the file ipblocklist_list.php

            • add this in the 3rd line of the file (the blank one…) : require_once('config.inc');
            • line 66 add this line: conf_mount_rw();, it's just before this : $myFile = "lists.txt";
            • line 75 add this line: conf_mount_ro();, it's just after this : fclose($fh);
              save your file

            check where is perl on your system with this command : find / -type f -name perl
            if the result is not : /usr/bin/perl
            edit files :

            • convert-execute.php
            • convert.pl
              and replace all the "/usr/bin/perl" instances with the path returned by the "find" command

            then put your system back in RO mode with : /etc/rc.conf_mount_ro

            If you don't like SSH, you can do everything from the admin page, using the Edit File function located in the Diagnostic menu. From there, you don't need to mount your system in RW mode, the admin page will do it for you

            */!\ this fix worked on my system but I'm not responsible if your crash yours… so be careful  ;) /!*

            1 Reply Last reply Reply Quote 0
            • C
              Cino
              last edited by

              Haven't used this package in a while.. Giving it a shot on my 2.0Beta5 build. When i disable IP-Blocklist, I see this error in my log:

              Feb 4 16:21:54 	php: /packages/ipblocklist/ipblocklist.php: The command 'ipfw -f flush' returned exit code '69', the output was 'ipfw: setsockopt(IP_FW_FLUSH): Protocol not available'
              

              BTW great work!! this package is coming out real nice!

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

                @Cino:

                Haven't used this package in a while.. Giving it a shot on my 2.0Beta5 build. When i disable IP-Blocklist, I see this error in my log:

                Feb 4 16:21:54 	php: /packages/ipblocklist/ipblocklist.php: The command 'ipfw -f flush' returned exit code '69', the output was 'ipfw: setsockopt(IP_FW_FLUSH): Protocol not available'
                

                BTW great work!! this package is coming out real nice!

                That's some old code that I need to remove. Ignore it until its removed.

                -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
                • C
                  Cino
                  last edited by

                  thanks tommyboy180!

                  1 Reply Last reply Reply Quote 0
                  • W
                    wm408
                    last edited by

                    I'm on an embedded pfsense 1.2.3.  I had some errors under the "whitelist" tab on IP-blocklist.

                    "Warning: fopen(wlists.txt): failed to open stream: Read-only file system in /usr/local/www/packages/ipblocklist/whitelist.php on line 86 Warning: fwrite(): supplied argument is not a valid stream resource in /usr/local/www/packages/ipblocklist/whitelist.php on line 87 Warning: fclose(): supplied argument is not a valid stream resource in /usr/local/www/packages/ipblocklist/whitelist.php on line 92"

                    -I also have a slave 160GB sata drive mounted to /store.  (Kind of cheating for an embedded, might not apply to most)
                    -I searched for "wlists.txt" in whitelist.php, while in command mode in vi, typed /wlists.txt
                    -changed wlists.txt entry to /store/ipblocklist/wlists.txt.
                    -made sure permissions were the same on the original wlists.txt and the new /store/ipblocklist/wlists.txt  (they were, didn't have to modify)

                    whitelist tab has no errors now.

                    Also, thanks a lot guys for the modifications to the files to get it working on embedded!

                    Hey Tommyboy.. any updates on making Internet Explorer/IE functional with ipblocklist?

                    I grabbed countryipblocks.net's full pg2 list and removed the US_pg2.txt from the group.  Then did a: cat * > pg2_beast.txt

                    wget –no-check-certificate -r -U Mozilla -A "*pg2.txt" www.countryipblocks.net/e_country_data/

                    I had to stop the wget once it started to go recursively outside e_country_data, but I got it all.

                    Thx so much countryipblocks.net!

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

                      quick question, is it logged somewhere when somebody is blocked ?

                      1 Reply Last reply Reply Quote 0
                      • W
                        wm408
                        last edited by

                        Wow i did this whole write up on squid and forgot I am in the IP-blocklist thread.   ::)  Think I forget because when IP-blocklist is successful, access denied gets shoved into a squid page.

                        @darxmurf:

                        quick question, is it logged somewhere when somebody is blocked ?

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

                          @wm408:

                          Wow i did this whole write up on squid and forgot I am in the IP-blocklist thread.   ::)  Think I forget because when IP-blocklist is successful, access denied gets shoved into a squid page.

                          @darxmurf:

                          quick question, is it logged somewhere when somebody is blocked ?

                          lol :)

                          To answer the question, it goes into the firewall logs if you checked logging.

                          -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
                            darxmurf
                            last edited by

                            Sorry, I just saw it after I asked my question

                            1 Reply Last reply Reply Quote 0
                            • W
                              wm408
                              last edited by

                              Hey Tommyboy, any luck on getting IE to function with this?  I personally use chrome but I want to implement some IP block stuff in a work environment where all they use is IE.

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

                                @wm408:

                                Hey Tommyboy, any luck on getting IE to function with this?  I personally use chrome but I want to implement some IP block stuff in a work environment where all they use is IE.

                                I've tried to work with IE and it just wont work with me. I kicked it to the curb. If you absolutely need IE then see if the new IE BETA will work.

                                -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
                                • V
                                  vg8open
                                  last edited by

                                  Some of the popular blacklists on the internet change very often.  Is it possible to add a setting for IP-Blocklist to reload the blacklists automatically at a period specified by the user?

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

                                    @vg8open:

                                    Some of the popular blacklists on the internet change very often.  Is it possible to add a setting for IP-Blocklist to reload the blacklists automatically at a period specified by the user?

                                    This has already been answered within this Topic. Please search the topic for the answer you are looking 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
                                    • V
                                      vg8open
                                      last edited by

                                      I was thinking more along the line of user-friendly web-based GUI setting.  With that said, setting up a cron job will works for me.

                                      Thanks

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

                                        @vg8open:

                                        I was thinking more along the line of user-friendly web-based GUI setting.  With that said, setting up a cron job will works for me.

                                        Thanks

                                        I could build a GUI for it but the work is already done for me by the Cron Job package. Perhaps I could integrate. Not sure where I want to go with that. We'll see.

                                        -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
                                          Systex
                                          last edited by

                                          I'm running an embedded install of 2.0Beta5 and tried to make the changes listed in this thread in order to get it to work. However, I accidentally forgot a semicolon after the first line I added (require_once('config.inc')) and when I went to refresh the IP-Blocklist page I got the following error in the textbox:

                                          Parse error: syntax error, unexpected T_ECHO in /usr/local/www/packages/ipblocklist/ipblocklist_list.php on line 5

                                          Since then, I've tried everything I can to get back to a cleanly-installed state: I've undone the edits I made to that file, and I've even uninstalled and reinstalled the IP-Blacklist package, but whatever I do, I now always get that error. How can I get back to a clean slate without completely reinstalling pfsense?

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

                                            @Systex:

                                            I'm running an embedded install of 2.0Beta5 and tried to make the changes listed in this thread in order to get it to work. However, I accidentally forgot a semicolon after the first line I added (require_once('config.inc')) and when I went to refresh the IP-Blocklist page I got the following error in the textbox:

                                            Parse error: syntax error, unexpected T_ECHO in /usr/local/www/packages/ipblocklist/ipblocklist_list.php on line 5

                                            Since then, I've tried everything I can to get back to a cleanly-installed state: I've undone the edits I made to that file, and I've even uninstalled and reinstalled the IP-Blacklist package, but whatever I do, I now always get that error. How can I get back to a clean slate without completely reinstalling pfsense?

                                            My best advice is to uninstall the package, check the file system (/usr/local/www/ipblocklist) and delete it, and then reboot. That should help you start from a clean slate.

                                            -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
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.