Forums

t1ck3ts
t1ck3ts
Offline
Resolved
0 votes
Hey guys

I've started playing around with my home server alot lately! Decided i wanted to see what this PulledPork
is about, possibly making updating ALL the rules for snort, a whole lot better.

Got it installed and was going through the ,conf file.

Alot of the locations are not even on the ClearOS system, ie) /etc/snort/ is actually /etc/snort.d/
alot of the files and rules are completely differant to what PulledPork is asking for.

Has anyone had any luck in installing PulledPork that updates your rules?

This is my PulledPork .conf file, is this correct?
# Config file for pulledpork
# Be sure to read through the entire configuration file
# If you specify any of these items on the command line, it WILL take
# precedence over any value that you specify in this file!

#######
####### The below section defines what your oinkcode is (required for
####### VRT rules), defines a temp path (must be writable) and also
####### defines what version of rules that you are getting (for your
####### snort version and subscription etc...)
#######

# The rule_url value replaces the old base_url and rule_file configuration
# options. You can now specify one or as many rule_urls as you like, they
# must appear as http://what.site.com/|rulesfile.tar.gz|1234567. You can specify
# each on an individual line, or you can specify them in a , separated list
# i.e. rule_url=http://x.y.z/|a.tar.gz|123,http://z.y.z/|b.tar.gz|456
# note that the url, rule file, and oinkcode itself are separated by a pipe |
# i.e. url|tarball|123456789,
rule_url=https://www.snort.org/reg-rules/|snortrules-snapshot.tar.gz|<oinkcode>;

# get the rule docs!
rule_url=https://www.snort.org/reg-rules/|opensource.gz|<oinkcode>;
rule_url=https://rules.emergingthreats.net/|emerging.rules.tar.gz|open

# THE FOLLOWING URL is for etpro downloads, note the tarball name change!
# and the et oinkcode requirement!
rule_url=https://rules.emergingthreats.net/|etpro.rules.tar.gz|<et oinkcode>

# NOTE above that the VRT snortrules-snapshot does not contain the version
# portion of the tarball name, this is because PP now automatically populates
# this value for you, if, however you put the version information in, PP will
# NOT populate this value but will use your value!
#
# Specify rule categories to ignore from the tarball in a comma separated list
# with no spaces. There are four ways to do this:
# 1) Specify the category name with no suffix at all to ignore the category
# regardless of what rule-type it is, ie: netbios
# 2) Specify the category name with a '.rules' suffix to ignore only gid 1
# rulefiles located in the /rules directory of the tarball, ie: policy.rules
# 3) Specify the category name with a '.preproc' suffix to ignore only
# preprocessor rules located in the /preproc_rules directory of the tarball,
# ie: sensitive-data.preproc
# 4) Specify the category name with a '.so' suffix to ignore only shared-object
# rules located in the /so_rules directory of the tarball, ie: netbios.so
# The example below ignores dos rules wherever they may appear, sensitive-
# data preprocessor rules, p2p so-rules (while including gid 1 p2p rules),
# and netbios gid-1 rules (while including netbios so-rules):
# ignore = dos,sensitive-data.preproc,p2p.so,netbios.rules
# These defaults are reasonable for the VRT ruleset with Snort 2.9.0.x.
ignore=deleted.rules,experimental.rules,local.rules
# IMPORTANT, if you are NOT yet using 2.8.6 then you MUST comment out the
# previous ignore line and uncomment the following!
# ignore=deleted,experimental,local,decoder,preprocessor,sensitive-data

# Define your Oinkcode - DEPRICATED, SEE RULE_URL
oinkcode=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

# What is our temp path, be sure this path has a bit of space for rule
# extraction and manipulation, no trailing slash
temp_path=/tmp

#######
####### The below section is for rule processing. This section is
####### required if you are not specifying the configuration using
####### runtime switches. Note that runtime switches do SUPERSEED
####### any values that you have specified here!
#######

# What path you want the .rules file containing all of the processed
# rules? (this value has changed as of 0.4.0, previously we copied
# all of the rules, now we are creating a single large rules file
# but still keeping a separate file for your so_rules!
rule_path=/etc/snort.d/rules

# What path you want the .rules files to be written to, this is UNIQUE
# from the rule_path and cannot be used in conjunction, this is to be used with the
# -k runtime flag, this can be set at runtime using the -K flag or specified
# here. If specified here, the -k option must also be passed at runtime, however
# specifying -K <path> at runtime forces the -k option to also be set
# out_path=/etc/snort.d/rules/

# If you are running any rules in your local.rules file, we need to
# know about them to properly build a sid-msg.map that will contain your
# local.rules metadata (msg) information. You can specify other rules
# files that are local to your system here by adding a comma and more paths...
# remember that the FULL path must be specified for EACH value.
# local_rules=/path/to/these.rules,/path/to/those.rules
# local_rules=/etc/snort.d/rules/local.rules
local_rules=/etc/snort.d/rules/gpl/attack_response.rules,/etc/snort.d/rules/gpl/chat.rules,/etc/snort.d/rules/gpl/dns.rules,/etc/snort.d/rules/gpl/exploit.rules,/etc/snort.d/rules/gpl/ftp.rules,/etc/snort.d/rules/gpl/icmp_info.rules,/etc/snort.d/rules/gpl/imap.rules,/etc/snort.d/rules/gpl/misc.rules,/etc/snort.d/rules/gpl/netbios.rules,/etc/snort.d/rules/gpl/p2p.rules,/etc/snort.d/rules/gpl/pop3.rules,/etc/snort.d/rules/gpl/rpc.rules,/etc/snort.d/rules/gpl/scan.rules,/etc/snort.d/rules/gpl/shellcode.rules,/etc/snort.d/rules/gpl/smtp.rules,/etc/snort.d/rules/gpl/snmp.rules,/etc/snort.d/rules/gpl/sql.rules,/etc/snort.d/rules/gpl/tftp.rules,/etc/snort.d/rules/gpl/web_client.rules,/etc/snort.d/rules/gpl/web_server.rules,/etc/snort.d/rules/gpl/web_specific_apps.rules

# Where should I put the sid-msg.map file?
sid_msg=/etc/snort.d/sid-msg.map

# Where do you want me to put the sid changelog? This is a changelog
# that pulledpork maintains of all new sids that are imported
sid_changelog=/var/log/sid_changes.log
# this value is optional

#######
####### The below section is for so_rule processing only. If you don't
####### need to use them.. then comment this section out!
####### Alternately, if you are not using pulledpork to process
####### so_rules, you can specify -T at runtime to bypass this altogether
#######

# What path you want the .so files to actually go to *i.e. where is it
# defined in your snort.conf, needs a trailing slash
sorule_path=/etc/snort.d/rules/

# Path to the snort binary, we need this to generate the stub files
snort_path=/usr/sbin/snort

# We need to know where your snort.conf file lives so that we can
# generate the stub files
config_path=/etc/snort.conf

# This is the file that contains all of the shared object rules that pulledpork
# has processed, note that this has changed as of 0.4.0 just like the rules_path!
sostub_path=/etc/snort.d/rules/so_rules.rules

# Define your distro, this is for the precompiled shared object libs!
# Valid Distro Types=Debian-Lenny, Ubuntu-6.01.1, Ubuntu-8.04
# CentOS-4.6, Centos-4-8, CentOS-5.0, Centos-5-4
# FC-5, FC-9, FC-11, FC-12, RHEL-5.0
# FreeBSD-6.3, FreeBSD-7-2, FreeBSD-7-3, FreeBSD-7.0, FreeBSD-8-0, FreeBSD-8-1
# OpenSUSE-11-3
distro=Centos-6-4

####### This next section is optional, but probably pretty useful to you.
####### Please read thoroughly!

# What do you want to backup and archive? This is a comma separated list
# of file or directory values. If a directory is specified, PP will recurse
# through said directory and all subdirectories to archive all files.
# The following example backs up all snort config files, rules, pulledpork
# config files, and snort shared object binary rules.
backup=/etc/snort.d,/etc/pulledpork,/usr/lib/snort_dynamicrules/

# what path and filename should we use for the backup tarball?
# note that an epoch time value and the .tgz extension is automatically added
# to the backup_file name on completeion i.e. the written file is:
# pp_backup.1295886020.tgz
backup_file=/tmp/pp_backup

# Where do you want the signature docs to be copied, if this is commented
# out then they will not be copied / extracted. Note that extracting them
# will add considerable runtime to pulledpork.
# docs=/path/to/base/www

# The following option, state_order, allows you to more finely control the order
# that pulledpork performs the modify operations, specifically the enablesid
# disablesid and dropsid functions. An example use case here would be to
# disable an entire category and later enable only a rule or two out of it.
# the valid values are disable, drop, and enable.
# state_order=disable,drop,enable


# Define the path to the pid files of any running process that you want to
# HUP after PP has completed its run.
# pid_path=/var/run/snort.pid,/var/run/barnyard.pid,/var/run/barnyard2.pid
# and so on...
# pid_path=/var/run/snort_eth0.pid

# This defines the version of snort that you are using, for use ONLY if the
# proper snort binary is not on the system that you are fetching the rules with
# Defining this value will set the Textonly flag, and thus will NOT allow
# you to use shared object rules. This value MUST contain all 4 minor version
# numbers. ET rules are now also dependant on this, verify supported ET versions
# prior to simply throwing rubbish in this variable kthx!
# snort_version=2.9.0.0

# Here you can specify what rule modification files to run automatically.
# simply uncomment and specify the apt path.
# enablesid=/usr/local/etc/snort/enablesid.conf
# dropsid=/usr/local/etc/snort/dropsid.conf
# disablesid=/usr/local/etc/snort/disablesid.conf
# modifysid=/usr/local/etc/snort/modifysid.conf

# What is the base ruleset that you want to use, please uncomment to use
# and see the README.RULESETS for a description of the options.
# Note that setting this value will disable all ET rulesets if you are
# Running such rulesets
# ips_policy=security

####### Remember, a number of these values are optional.. if you don't
####### need to process so_rules, simply comment out the so_rule section
####### you can also specify -T at runtime to process only GID 1 rules.

version=0.6.0
Sunday, August 18 2013, 12:54 AM
Share this post:
Responses (10)
  • Accepted Answer

    Friday, August 23 2013, 02:29 PM - #Permalink
    Resolved
    0 votes
    Here are a couple of comments:

    - Extra snort rules should be added to a sub-directory off of /etc/snort.d/rules, e.g. /etc/snort.d/rules/pulledpork (off-topic: now I'm hungry for lunch). The idea is that you can have snort signatures from different vendors play well together (well... kind of).

    - Snort upgrades are notoriously nasty. The scheduled upgrade for the 6.4.0 release didn't even get past internal testing. The 2.0.0 "daq" library was the source of the issue but I'm guessing that the more recent 2.0.1 version fixed many of those dot-oh problems. We'll revisit the upgrade again at some point in the future.
    The reply is currently minimized Show
  • Accepted Answer

    Thursday, August 22 2013, 11:21 AM - #Permalink
    Resolved
    0 votes
    I would guess that you need to pull to pieces the code that generated the screen to see where it is trying to read its files from. I am no good at that!

    Alternatively you could try reinstalling snort and it may fix it for you, perhaps with something like:
    yum reinstall app-intrusion-detection-core app-intrusion-detection
    It may nuke your snort.conf.
    The reply is currently minimized Show
  • Accepted Answer

    t1ck3ts
    t1ck3ts
    Offline
    Thursday, August 22 2013, 09:02 AM - #Permalink
    Resolved
    0 votes
    Seems there is a broken rule in emerging-rbn-BLOCK.rules

    alert udp [89.104.71.235,89.104.80.155,89.104.82.198,89.105.159.213,89.106.14.203,89.107.227.251,89.107.227.252,89.108.104.38,89.108.104.72,89.108.105.10,89.108.105.11,89.108.116.93,89.108.120.72,89.108.122.119,89.108.124.55,89.108.126.22,89.108.64.0/19,89.111.13.45,89.111.16.133,89.111.171.191] any -> $HOME_NET any (msg:"ET RBN Known Russian Business Network IP UDP - BLOCKING (401)"; reference:url,doc.emergingthreats.net/b

    should be
    alert udp [89.104.71.235,89.104.80.155,89.104.82.198,89.105.159.213,89.106.14.203,89.107.227.251,89.107.227.252,89.108.104.38,89.108.104.72,89.108.105.10,89.108.105.11,89.108.116.93,89.108.120.72,89.108.122.119,89.108.124.55,89.108.126.22,89.108.64.0/19,89.111.13.45,89.111.16.133,89.111.171.191] any -> $HOME_NET any (msg:"ET RBN Known Russian Business Network IP UDP - BLOCKING (401)"; reference:url,doc.emergingthreats.net/bin/view/Main/RussianBusinessNetwork; threshold: type limit, track by_src, seconds 60, count 1; flowbits:set,ET.RBN; flowbits:set,ET.Evil; classtype:misc-attack; sid:2407801; rev:306; fwsam: src, 24 hours;)


    *** EDIT ***

    Never mind, re-ran the script and it pulled the file down again, seems wget didnt get the whole file the first time.

    also, still unsure how to fix this still.
    https://dl.dropboxusercontent.com/u/19531710/co64-id-borked.jpg
    The reply is currently minimized Show
  • Accepted Answer

    t1ck3ts
    t1ck3ts
    Offline
    Monday, August 19 2013, 08:41 PM - #Permalink
    Resolved
    0 votes
    Nick Howitt wrote:
    I get my rules for 2.9.0 from http://rules.emergingthreats.net/open-nogpl/snort-2.9.0/rules/ (the all-rules file is in the level one up) and http://rules.emergingthreats.net/blockrules/. Perhaps you could try there instead.


    Haha, yeah i've given up and just stuck with this :P
    *** ALTHOUGH! ***

    As usual, i've broken something B)

    https://dl.dropboxusercontent.com/u/19531710/co64-id-borked.jpg

    Yup! Im good at breaking things :blush:
    The reply is currently minimized Show
  • Accepted Answer

    Sunday, August 18 2013, 02:24 PM - #Permalink
    Resolved
    0 votes
    I get my rules for 2.9.0 from http://rules.emergingthreats.net/open-nogpl/snort-2.9.0/rules/ (the all-rules file is in the level one up) and http://rules.emergingthreats.net/blockrules/. Perhaps you could try there instead.
    The reply is currently minimized Show
  • Accepted Answer

    t1ck3ts
    t1ck3ts
    Offline
    Sunday, August 18 2013, 12:44 PM - #Permalink
    Resolved
    0 votes
    Aug 18 14:40:06 home snort[2248]: FATAL ERROR: /etc/snort.d/rules/snortrules.rules(582) Unknown rule option: 'sip_method'.


    This is the new error im getting.

    So what i can see, ClearOS 6.4 is running on
    [root@home ~]# snort -V

    ,,_ -*> Snort! <*-
    o" )~ Version 2.9.0.4 IPv6 GRE (Build 110)
    '''' By Martin Roesch & The Snort Team: http://www.snort.org/snort/snort-team
    Copyright (C) 1998-2011 Sourcefire, Inc., et al.
    Using libpcap version 1.0.0
    Using PCRE version: 7.8 2008-09-05
    Using ZLIB version: 1.2.3

    [root@home ~]#


    But if you go to the snort website, the latest is 2.9.5.3
    Yum update snort does not give anything near the 2.9.5.3 version...

    Not sure if i want to tackle installing 2.9.5.3 on my own :(
    The reply is currently minimized Show
  • Accepted Answer

    t1ck3ts
    t1ck3ts
    Offline
    Sunday, August 18 2013, 12:24 PM - #Permalink
    Resolved
    0 votes
    Well, i tried to add the snortrules.rules into the snort.conf and got this in the messages log.
    Aug 18 14:23:12 home snort[1676]: Initializing rule chains...
    Aug 18 14:23:12 home snort[1676]: WARNING /etc/snort.d/rules/gpl/netbios.rules(1) threshold (in rule) is deprecated; use detection_filter instead.#012
    Aug 18 14:23:15 home snort[1676]: FATAL ERROR: /etc/snort.d/rules/snortrules.rules(17) ***PortVar Lookup failed on '$FILE_DATA_PORTS'.


    *** EDIT ***

    Fixed that error with the following: http://blog.snort.org/2012/01/portvar-lookup-failed-on-filedataports.html
    The reply is currently minimized Show
  • Accepted Answer

    t1ck3ts
    t1ck3ts
    Offline
    Sunday, August 18 2013, 12:19 PM - #Permalink
    Resolved
    0 votes
    Hey Nick

    Yeah, i've set it to rule_path=/etc/snort.d/rules/snortrules.rules and that seemed to fix it.
    edited the post above to reflect the changes.

    From what i can see, everything has been downloaded, created and generated. Im just triyng to figure out
    if i need to add /etc/snort.d/rules/snortrules.rules into the snort.conf for the rules to be used?

    Any idea?
    The reply is currently minimized Show
  • Accepted Answer

    Sunday, August 18 2013, 12:17 PM - #Permalink
    Resolved
    0 votes
    It is telling you /etc/snort.d/rules is a directory and at a guess it is wanting to write a file called /etc/snort.d/rules and failing. I would have thought you need to modify rule_path=/etc/snort.d/rules either with a trailing "/" or a full file name for your new rules file, but I'm only guessing.
    The reply is currently minimized Show
  • Accepted Answer

    t1ck3ts
    t1ck3ts
    Offline
    Sunday, August 18 2013, 12:03 PM - #Permalink
    Resolved
    0 votes
    [root@home ~]# /etc/pulledpork/pulledpork.pl -c /etc/pulledpork/etc/pulledpork.conf

    http://code.google.com/p/pulledpork/
    _____ ____
    `----,\ )
    `--==\\ / PulledPork v0.6.1 the Smoking Pig <////~
    `--==\\/
    .-~~~~-.Y|\\_ Copyright (C) 2009-2011 JJ Cummings
    @_/ / 66\_ cummingsj@gmail.com
    | \ \ _(")
    \ /-| ||'--' Rules give me wings!
    \_\ \_\\
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Checking latest MD5 for snortrules-snapshot-2931.tar.gz....
    They Match
    Done!
    Prepping rules from snortrules-snapshot-2931.tar.gz for work....
    Done!
    Checking latest MD5 for opensource.gz....
    They Match
    Done!
    Prepping rules from opensource.gz for work....
    Done!
    Reading rules...
    Generating Stub Rules....
    An error occurred: Warning: No dynamic libraries found in directory /usr/lib/snort_dynamicrules!

    Done
    Reading rules...
    Reading rules...
    Activating security rulesets....
    Done
    Setting Flowbit State....
    Enabled 866 flowbits
    Enabled 29 flowbits
    Enabled 4 flowbits
    Enabled 2 flowbits
    Done
    Writing /etc/snort.d/rules/snortrules.rules....
    Done
    Writing /etc/snort.d/rules/so_rules.rules....
    Done
    Generating sid-msg.map....
    Done
    Writing /etc/snort.d/sid-msg.map....
    Done
    Creating backup at: /tmp/pp_backup.1376827880.tgz
    Done
    Writing /var/log/sid_changes.log....
    Done
    Rule Stats....
    New:-------17973
    Deleted:---0
    Enabled Rules:----9276
    Dropped Rules:----0
    Disabled Rules:---9238
    Total Rules:------18514
    Done
    Please review /var/log/sid_changes.log for additional details
    Fly Piggy Fly!
    [root@home ~]#

    Now im just checking if everything is ok, if its actually worked and stuff.
    The reply is currently minimized Show
Your Reply