Netgate m1n1wall

Author Topic: Country Block  (Read 119329 times)

0 Members and 2 Guests are viewing this topic.

Offline Supermule

  • Hero Member
  • *****
  • Posts: 1490
    • View Profile
Re: Country Block
« Reply #120 on: August 19, 2010, 08:35:01 am »
Depending on what the spammer uses as relay....
Kind regards Brian


Offline kpa

  • Full Member
  • ***
  • Posts: 261
    • View Profile
Re: Country Block
« Reply #121 on: August 19, 2010, 08:43:24 am »
Look at the last ip address before your own email server in the received headers, that's the IP address checked by country block.

Offline tommyboy180

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 976
    • View Profile
    • TomSchaefer.org
Re: Country Block
« Reply #122 on: August 20, 2010, 12:01:46 am »
Version 1.4 released.

Added logging option.
Added missing country. (India is in the top 10 list)
Fixed misspellings.
Changed installation process.
-Tom Schaefer
SuperMicro 1U 2X Intel pro/1000 Dual Core Intel 2.2 Ghz - 2 Gig RAM
TomSchaefer.org/pfsense
Please support Countryblock | IP-Blocklist | File Browser | Strikeback Here

Offline mgc6288

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
Re: Country Block
« Reply #123 on: August 20, 2010, 12:11:45 am »
Version 1.4 released.

Added logging option.
Added missing country. (India is in the top 10 list)
Fixed misspellings.
Changed installation process.


After some looking around...is the logging feature located under status --> system logs --> Firewall? 
« Last Edit: August 20, 2010, 12:25:55 am by mgc6288 »

Offline tommyboy180

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 976
    • View Profile
    • TomSchaefer.org
Re: Country Block
« Reply #124 on: August 20, 2010, 02:03:26 am »
Yes, system logs -> Firewall.
I am still working on a way to filter what is logged only by the package. That requires a lvl 67 programmer and I am only lvl 66.

Right now the only way to tell if something is blocked by the package is to click the red x on the logged event.
-Tom Schaefer
SuperMicro 1U 2X Intel pro/1000 Dual Core Intel 2.2 Ghz - 2 Gig RAM
TomSchaefer.org/pfsense
Please support Countryblock | IP-Blocklist | File Browser | Strikeback Here

Offline darklogic

  • Full Member
  • ***
  • Posts: 175
    • View Profile
Re: Country Block
« Reply #125 on: August 20, 2010, 08:45:42 am »
Came across some issues. I found you may need to uninstall the 1.3 package and then reboot you system after the uninstall. Then install the new 1.4 package and reboot again. I was not able to get the new version to start until after I did the following. This is just something to try if anyone else happens to get this same issue for what ever reason.

Other than that, the package is working great. Good job on implementing the logging. I have a feeling level 67 will soon come about.

Thanks again for all the hard work tommyboy180

Offline deltaend

  • Jr. Member
  • **
  • Posts: 34
    • View Profile
Re: Country Block
« Reply #126 on: August 20, 2010, 11:29:16 am »
Thank you for the new version Tommyboy180.

Offline tommyboy180

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 976
    • View Profile
    • TomSchaefer.org
Re: Country Block
« Reply #127 on: August 20, 2010, 04:13:38 pm »
Thank you for the new version Tommyboy180.
Thank you!
-Tom Schaefer
SuperMicro 1U 2X Intel pro/1000 Dual Core Intel 2.2 Ghz - 2 Gig RAM
TomSchaefer.org/pfsense
Please support Countryblock | IP-Blocklist | File Browser | Strikeback Here

Offline louis-m

  • Full Member
  • ***
  • Posts: 263
    • View Profile
Re: Country Block
« Reply #128 on: August 21, 2010, 02:49:59 am »
has anybody got this going on embedded yet? i'm getting hit with terrible spam and this would come in extremely handy.
i've changed my embedded to rw, did the install but it still complains. i've tried to create countries.txt etc and they get deleted the minute i try to commit countries in the gui.
i'd really appreciate some help with this as i've had to close down my mail server to stop spam coming in (even with spam assasin!)

Offline louis-m

  • Full Member
  • ***
  • Posts: 263
    • View Profile
Re: Country Block
« Reply #129 on: August 21, 2010, 03:33:23 am »
i got it going but could the author or anybody else let me know if i am doing anything wrong or opening a hole as i am not a coder.
i simply edited the config file like:

$N = count($aCountry);

         $myFile = "countries.txt";
         conf_mount_rw();
         $fh = fopen($myFile, 'w+');
         $output = "You selected $N Countries";
         
         for($i=0; $i < $N; $i++)
         {
            //echo($aCountr
y[$i] . " ");
            fwrite($fh, $aCountry[$i] . "\n");
         conf_mount_rw();
         }
         echo("</p>");
      }
   }


and away it went. it's running ok now. thank you.

Offline tommyboy180

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 976
    • View Profile
    • TomSchaefer.org
Re: Country Block
« Reply #130 on: August 21, 2010, 04:11:52 am »
i got it going but could the author or anybody else let me know if i am doing anything wrong or opening a hole as i am not a coder.
i simply edited the config file like:

$N = count($aCountry);

         $myFile = "countries.txt";
         conf_mount_rw();
         $fh = fopen($myFile, 'w+');
         $output = "You selected $N Countries";
         
         for($i=0; $i < $N; $i++)
         {
            //echo($aCountr
y[$i] . " ");
            fwrite($fh, $aCountry[$i] . "\n");
         conf_mount_rw();
         }
         echo("</p>");
      }
   }


and away it went. it's running ok now. thank you.

Awesome! You saved me a couple hours on my day off. I will make the changes and commit this in the CountryBlock package and the IPBlocklist package.
-Tom Schaefer
SuperMicro 1U 2X Intel pro/1000 Dual Core Intel 2.2 Ghz - 2 Gig RAM
TomSchaefer.org/pfsense
Please support Countryblock | IP-Blocklist | File Browser | Strikeback Here

Offline louis-m

  • Full Member
  • ***
  • Posts: 263
    • View Profile
Re: Country Block
« Reply #131 on: August 21, 2010, 04:45:09 am »
hey, no probs! thanks for your efforts and what a great package!
i still can't get the logging to work (tick box etc) so there must be another bit in there to change to rw

think the last bit above is meant to be "ro" instead of "rw"
« Last Edit: August 21, 2010, 04:46:56 am by louis-m »

Offline tommyboy180

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 976
    • View Profile
    • TomSchaefer.org
Re: Country Block
« Reply #132 on: August 21, 2010, 04:51:16 am »
The logging uses a feature already built into pfsense. It logs just like anything else, so you logs should show up under the Firewall logs.
-Tom Schaefer
SuperMicro 1U 2X Intel pro/1000 Dual Core Intel 2.2 Ghz - 2 Gig RAM
TomSchaefer.org/pfsense
Please support Countryblock | IP-Blocklist | File Browser | Strikeback Here

Offline louis-m

  • Full Member
  • ***
  • Posts: 263
    • View Profile
Re: Country Block
« Reply #133 on: August 21, 2010, 05:07:13 am »
i've edited it again and put the conf_mount_rw(); at the very begining of the php script and the conf_mount_ro(); at the end and it works fine now

<?php
conf_mount_rw();


mwexec("touch countries.txt");
//$myFile = "countries.txt";
//$fh = fopen($myFile, 'a+');



   if(isset($_POST['formSubmit']))
    {
      $aCountry = $_POST['formCountry'];
   
      if(isset($_POST['formOutbound']))
        {
         $output2 = " and Outbound access is BLOCKED.";
         exec("touch OUTBOUND");
      }
        else
        {
         $output2 = " and Outbound access is ALLOWED.";
         exec("rm OUTBOUND");
      }
      
      if(isset($_POST['formlogging']))
        {
         exec("touch logging");
      }
        else
        {
         exec("rm logging");
      }

      
      if(empty($aCountry))
        {
         $output = "You didn't select any Countries.";
         exec("rm countries.txt");
      }
        else
        {
      
            $N = count($aCountry);

         $myFile = "countries.txt";
         $fh = fopen($myFile, 'w+');
         $output = "You selected $N Countries";
         
         for($i=0; $i < $N; $i++)
         {
            //echo($aCountr
y[$i] . " ");
            fwrite($fh, $aCountry[$i] . "\n");
         }
         echo("</p>");
      }
   }
conf_mount_ro
?>

Offline tommyboy180

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 976
    • View Profile
    • TomSchaefer.org
Re: Country Block
« Reply #134 on: August 21, 2010, 05:14:21 am »
Excellent! Great work and thank you.
-Tom Schaefer
SuperMicro 1U 2X Intel pro/1000 Dual Core Intel 2.2 Ghz - 2 Gig RAM
TomSchaefer.org/pfsense
Please support Countryblock | IP-Blocklist | File Browser | Strikeback Here