<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[PfBlocker and .CSV File Format Solution]]></title><description><![CDATA[<p dir="auto">If anyone was looking for a way to have <strong>pfBlocker</strong> utilize <strong>.CSV</strong> files, here is one option-</p>
<p dir="auto">Stop Forum Spam (List is currently Listing approx <strong>442,000</strong> unique IPs addresses.</p>
<p dir="auto">We provide free access to our database of known forum and blog spammers. The database provides their<br />
email addresses, IP addresses, usernames, spamming frequency, and, in some cases, evidence of their spam.</p>
<p dir="auto">http://www.stopforumspam.com<br />
http://www.stopforumspam.com/downloads/bannedips.zip  (Which contain a .CSV file)</p>
<p dir="auto"><strong>Unfortunately pfBlocker only supports .TXT and .GZ files.</strong></p>
<p dir="auto">My Solution:</p>
<p dir="auto"><strong>SSH</strong> into your pfSense box.</p>
<p dir="auto">      <strong>cd /tmp</strong></p>
<p dir="auto">(create this file with the following script)</p>
<p dir="auto"><strong>vi pffetch</strong></p>
<p dir="auto">      #!/bin/sh<br />
      fetch http://www.stopforumspam.com/downloads/bannedips.zip<br />
      tar -xOf bannedips.zip | tr , '\n' &gt; bannedips.txt</p>
<p dir="auto">(save)</p>
<p dir="auto">    <strong>chmod +x pffetch</strong></p>
<p dir="auto">To test, type the following</p>
<p dir="auto">    <strong>./pffetch</strong><br />
    <strong>cat bannedips.txt</strong></p>
<p dir="auto">If it displays the file with</p>
<p dir="auto">    x.x.x.x<br />
    x.x.x.x<br />
    x.x.x.x<br />
    x.x.x.x<br />
    (will show all 442,000 ips)</p>
<p dir="auto">than the pffetch script works correctly.</p>
<p dir="auto">–----------------------</p>
<p dir="auto">From the pfSense GUI</p>
<p dir="auto">Goto <strong>SYSTEM:PACKAGES</strong></p>
<p dir="auto">Add the "<strong>CRON</strong>" Package</p>
<p dir="auto">Once Cron is installed, go into CRON and add a new "Cron Task"</p>
<p dir="auto">******* Be careful not to delete or edit any of the existing CRON jobs!**</p>
<p dir="auto">min/hour/mday/month/wday/who/command<br />
0 | 4,12,20 | * | * | * | root | /tmp/pffetch</p>
<p dir="auto">So this will run the script at 4,12,20 Military Time.<br />
StopForumSpam limits downloading to 3 times MAX per DAY!</p>
<p dir="auto">–---------------------</p>
<p dir="auto">Make sure you have a large enough "<strong>Firewall Maximum Table Entries</strong>" in <strong>SYSTEM:ADVANCED:FIREWALL/NAT</strong><br />
It needs to be large enough to hold all of your ip lists together.</p>
<p dir="auto">"Maximum number of table entries for systems such as aliases, sshlockout, snort, etc, <strong>combined</strong>."</p>
<p dir="auto">–---------------------</p>
<p dir="auto">Goto <strong>pfBlocker:LISTS</strong></p>
<p dir="auto">Create a new List</p>
<p dir="auto">Alias Name  : StopForumSpam<br />
List Desc.  : pfBlocker StopForumSpam<br />
txt        : /tmp/bannedips.txt</p>
<p dir="auto">List Action : <strong>Alias Only</strong></p>
<p dir="auto">Update Freq : Every 4 Hours</p>
<p dir="auto">Save</p>
<p dir="auto">–---------------------</p>
<p dir="auto">Goto <strong>Firewall:Rules</strong></p>
<p dir="auto">Add Rules to utilize the Alias "StopForumSpam" in WAN as "Block" and LAN as "Reject"</p>
<p dir="auto">–----------------------</p>
<p dir="auto">Another list that uses .CSV format</p>
<p dir="auto">http://www.autoshun.org/<br />
http://www.autoshun.org/files/shunlist.csv</p>
<p dir="auto">Same process as above. Use the same script unless you want to create multiple scripts with<br />
different Cron/pfBlocker tasks.</p>
<p dir="auto">#!/bin/sh<br />
fetch http://www.stopforumspam.com/downloads/bannedips.zip<br />
fetch http://www.autoshun.org/files/shunlist.csv<br />
tar -xOf bannedips.zip | tr , '\n' &gt; bannedips.txt<br />
cat shunlist.csv | grep -o '^*[^[,]{0,15}' &gt; shunlist.txt</p>
]]></description><link>https://forum.netgate.com/topic/66129/pfblocker-and-csv-file-format-solution</link><generator>RSS for Node</generator><lastBuildDate>Sat, 07 Nov 2026 11:14:17 GMT</lastBuildDate><atom:link href="https://forum.netgate.com/topic/66129.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 25 Feb 2014 00:39:22 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to PfBlocker and .CSV File Format Solution on Thu, 06 Mar 2014 05:10:25 GMT]]></title><description><![CDATA[<p dir="auto">The little script in my first post needs to be updated to change the path to the user directory. As is, the Fetch (downloads) are going into</p>
<p dir="auto">/etc/cron directory.</p>
<p dir="auto">Please add</p>
<p dir="auto">#!/bin/sh</p>
<p dir="auto"><strong>cd /home/USERDIRECTORY</strong> (Or where ever you would like the downloads to go to. And also where pfBlocker will lookup.</p>
]]></description><link>https://forum.netgate.com/post/447369</link><guid isPermaLink="true">https://forum.netgate.com/post/447369</guid><dc:creator><![CDATA[BBcan177]]></dc:creator><pubDate>Thu, 06 Mar 2014 05:10:25 GMT</pubDate></item><item><title><![CDATA[Reply to PfBlocker and .CSV File Format Solution on Thu, 27 Feb 2014 02:32:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/marcelloc" aria-label="Profile: marcelloc">@<bdi>marcelloc</bdi></a>:</p>
<blockquote>
<p dir="auto">Thanks for the contribution.</p>
<p dir="auto">To keep this script on pfsense xml backup, I suggest you to install package filer instead of creating this script via console/ssl.</p>
</blockquote>
<p dir="auto">Marcelloc,</p>
<p dir="auto">I have a script that is pulling my spammers IP address and collecting them into a .TXT file (CIDR Format). It is creating a file every 5 minutes and sending it to a file in pfSense<br />
with SCP.</p>
<p dir="auto"><strong>Unfortunately pfBlocker is limited to once per hour.</strong></p>
<p dir="auto">Can this code be edited to say 5mins, 1hr, 4hrs, 12hrs? <strong>Can I edited this php file directly?</strong></p>
<pre><code> $cron=array('01hour' =&gt; 1,
                                '04hours' =&gt; 4,
                                '12hours' =&gt; 12,
                                'EveryDay' =&gt; 23);

</code></pre>
<p dir="auto">Please let me know if you have any other suggestions on how to get it to update more frequently.</p>
<p dir="auto">Thanks.</p>
]]></description><link>https://forum.netgate.com/post/446076</link><guid isPermaLink="true">https://forum.netgate.com/post/446076</guid><dc:creator><![CDATA[BBcan177]]></dc:creator><pubDate>Thu, 27 Feb 2014 02:32:26 GMT</pubDate></item><item><title><![CDATA[Reply to PfBlocker and .CSV File Format Solution on Wed, 26 Feb 2014 04:03:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/marcelloc" aria-label="Profile: marcelloc">@<bdi>marcelloc</bdi></a>:</p>
<blockquote>
<p dir="auto">Thanks for the contribution.</p>
<p dir="auto">To keep this script on pfsense xml backup, I suggest you to install package filer instead of creating this script via console/ssl.</p>
</blockquote>
<p dir="auto">Hi Marcelloc,</p>
<p dir="auto">I installed "File manager" instead of the "Filer" package.</p>
<p dir="auto">I now see the correct settings to manage the script from the GUI.</p>
<p dir="auto">Much easier….. Thanks.</p>
<p dir="auto">Question - What would be the best way to get a .txt file from a local server to pfSense?</p>
]]></description><link>https://forum.netgate.com/post/445802</link><guid isPermaLink="true">https://forum.netgate.com/post/445802</guid><dc:creator><![CDATA[BBcan177]]></dc:creator><pubDate>Wed, 26 Feb 2014 04:03:44 GMT</pubDate></item><item><title><![CDATA[Reply to PfBlocker and .CSV File Format Solution on Tue, 25 Feb 2014 18:06:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/marcelloc" aria-label="Profile: marcelloc">@<bdi>marcelloc</bdi></a>:</p>
<blockquote>
<p dir="auto">Thanks for the contribution.</p>
<p dir="auto">To keep this script on pfsense xml backup, I suggest you to install package filer instead of creating this script via console/ssl.</p>
</blockquote>
<p dir="auto">Thanks Marcelloc,</p>
<p dir="auto">I added the "Filer" Package. I had to rename the file to pffetch.sh to get Filer View/Edit working.</p>
<p dir="auto">To make the script executable, you will still need to go manually run "chmod +x"? Or is there a work around?</p>
<p dir="auto">How do you get the files to save in the xml backup file? I don't see any settings for that? Or is there a particular folder to create script files?</p>
<p dir="auto">Thanks for your help.</p>
<p dir="auto">ps - Next step is to get pfBlocker to pull spam ips from my local mail server… Spammustdie!!!</p>
]]></description><link>https://forum.netgate.com/post/445705</link><guid isPermaLink="true">https://forum.netgate.com/post/445705</guid><dc:creator><![CDATA[BBcan177]]></dc:creator><pubDate>Tue, 25 Feb 2014 18:06:53 GMT</pubDate></item><item><title><![CDATA[Reply to PfBlocker and .CSV File Format Solution on Tue, 25 Feb 2014 17:47:29 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for the contribution.</p>
<p dir="auto">To keep this script on pfsense xml backup, I suggest you to install package filer instead of creating this script via console/ssl.</p>
]]></description><link>https://forum.netgate.com/post/445700</link><guid isPermaLink="true">https://forum.netgate.com/post/445700</guid><dc:creator><![CDATA[marcelloc]]></dc:creator><pubDate>Tue, 25 Feb 2014 17:47:29 GMT</pubDate></item><item><title><![CDATA[Reply to PfBlocker and .CSV File Format Solution on Tue, 25 Feb 2014 17:01:55 GMT]]></title><description><![CDATA[<p dir="auto">Made some changes to the script. If the download fails for what ever reason, it can clear the previous downloaded data leaving your table blank.</p>
<pre><code>#!/bin/sh

fetch http://www.stopforumspam.com/downloads/bannedips.zip
returncode=$?
echo $returncode

if [ "$returncode" -eq "0" ]; then
         tar -xOf bannedips.zip | tr , '\n' &gt; bannedips.txt
fi

fetch http://www.autoshun.org/files/shunlist.csv
returncode=$?
echo $returncode

if [ "$returncode" -eq "0" ]; then
         cat shunlist.csv | grep -o '\^*[^[,]\{0,15\}' &gt; shunlist.txt
fi

</code></pre>
<p dir="auto">Also, moved the script to /home folder as the /tmp folder doesn't persist after reboot …</p>
<p dir="auto">Does anyone know if there is an upper limit on the total number of :</p>
<p dir="auto"><strong>"Firewall Maximum Table Entries" in SYSTEM:ADVANCED:FIREWALL/NAT</strong></p>
]]></description><link>https://forum.netgate.com/post/445686</link><guid isPermaLink="true">https://forum.netgate.com/post/445686</guid><dc:creator><![CDATA[BBcan177]]></dc:creator><pubDate>Tue, 25 Feb 2014 17:01:55 GMT</pubDate></item></channel></rss>