[Snort-users] Now that I have my oink code

Paul Schmehl pauls at ...6838...
Wed Mar 9 12:20:07 EST 2005

--On Wednesday, March 09, 2005 10:48:44 AM -0800 Snortty 
<cwcwcwg at ...131...> wrote:

> How did you figure out the IP of the snort NATting to
> outbound?
Here's what I did:

I wrote a shell script on an Internet-facing box.  It's croned to run every 
night at 10PM.  It fetches the rules file and puts it in (IP-restricted, 
access restricted, non-linked) directory on our web server.  The IP of that 
box is fixed and never changes.

I then edited the oinkmaster.conf file to point to that location to fetch 
the rules files every night at 11PM.  (I also changed the name of the file 
to snortrules.tar.gz.  That way I only have to edit the shell script when 
the filename changes at snort.org.  Oinkmaster always looks for 

Note: if you're going to do this, you need to use very tight restrictions 
on who/what can access the file.  Use a firewall or .htaccess rules to 
restrict the access to the one IP where oinkmaster lives.

Here's an example .htaccess file:
SetEnvIf X-Cluster-Client-Ip "(192\.168\.1\.12).*$" permitted
order deny,allow
deny from all
allow from env=permitted

If you have multiple snort boxes that need to fetch the rules, just use an 
OR ("|") in the SetEnvIf statement (e.g. 

With this .htaccess file in place, the only host that can access the file 
from the web (or using wget or ftp) is  NOTE: if you do not 
restrict access to this file, you will almost certainly be in violation of 
Sourcefire's license agreement.

Here's the shell script:

# This script downloads the snort rules to a (configurable) local directory.
# Oinkmaster on buttercup2 then fetches them from that directory, so if you
# change the local directory or the filename, you have to edit the "url" 
# in the config file for oinkmaster or rules updating will be broken
# When the file is downloaded, we rename it snortrules.tar.gz so that the
# oinkmaster.conf file never has to be edited when the rules change

RULES="snortrules-snapshot-{your version}.tar.gz"
OINKCODE="put your oink code here"


> That could be my prolems for d.l new rules after
> having regitered, and got Oink Code by entering my
> snort box IP (internal IP), it shows errors:
> Connecting to 192.168.103.x:8000... connected.
> Proxy request sent, awaiting response... 403 You must
> be a registered user with a valid oink code to
> download this file from your IP Address
> 18:32:37 ERROR 403: You must be a registered user with
> a valid oink code to download this file from your IP
> Address.
> -------------------------
> where 192.168.103.x is our proxy IP.
The registration instructions specifically excluded RFC 1918 addresses. 
You must use an "internet" address.

> Also, I'm running snort v2.1.2, which latest rules
> should work for my snort, and file name to d.l?

Paul Schmehl (pauls at ...6838...)
Adjunct Information Security Officer
The University of Texas at Dallas
AVIEN Founding Member

More information about the Snort-users mailing list