Sound proofing and wall batons

December 23rd, 2008

I live in a semi-detached house and therefore have to be considerate to our neighbours when it comes down to making noise, so adding more sound-proofing to to the dividing wall ahead of a AV install is a bit of a no brainer.

After doing a bit of google searching I found a wall-mounted product that should decrease noise by about 50%. Padding out the dividing wall with another layer of plaster board with about 50mm of acoustic wool attached however creates some challenges when it comes down to mounting a TV to the wall (what the hell do you screw the brackets into?).

So before adding the sound proofing to the wall, I added a couple of batons in the correct place for the LCD wall-mount and (hopefully) the center speaker. These should provide a good backing to screw a mount into.

I also ran some trunking over the wall to manage the hidden cables.

Batons and trunkning attached to wall before adding insulation

Batons and trunkning attached to wall before adding insulation

I have run power, a couple of HDMI, a SCART, and a VGA cable through the conduits (note that power takes it’s own path to minimise interference with AV signals. The challenge after adding these cable runs and batons is to make sure the sound insulation will be able to snugly attach to the *plaster* of the original wall. The only way to make this happen is to spend a long time with a craft knife and a ruler.

Sound insulation with cable runs cut out to match the wall.

Sound insulation with cable runs cut out to match the wall.

Believe it or not, cutting the above piece to size, channelling out cable runs to the minimum required depth, and attaching it to the wall took a couple of hours.

And yes, I know that cutting into the insulation will decrease it’s effectiveness but It’s better than nothing and allows me to hide a lot of cable.

Cut to perfection!

Cut to perfection!

The Home AV Install Part one (of many)

December 23rd, 2008

The first stages of my home AV install are under way, it’s a medium term project and for fun I thought I would document it here.

We moved into a new house close to a year ago and have been pretty slow in making any changes, but this has provided us with the luxury of getting used to how we live in the house before committing to anything  permanent. We found that the area that we have been using as our dining room is far better suited to being a TV/lounge room because of its smaller size and shape than the current lounge room.

When we first moved into the house we nick-named the soon-to-be-ex dining room “the stage” because it was raised above the normal level of the rest of the house with weird stage style lights. Our original intention was to lower all the floors back down to their original level, but after raising the boards it is clear that it will take far more effort (and $) to make it worthwhile.

Last weekend I got stuck into some hard work (with the kind help of my father who supplied most of the know-how and experience)

  • Knocked down the two ledges on the dividing partition
  • Ripped up the laminate floor
  • Laid speaker wire under the floor boards
  • Cut out back boxes ready for some AV speaker front-plates (flush with the wall)
  • Found that the electrical wiring in the room is far-from acceptable, so therefore ran some new cables ready for a certified electrician to hook up.

The Before shot (taken on the day we moved in, hence why everything is just dumped where it landed)

The lounge on the day we moved in

The lounge on the day we moved in

The After shot (and yes I know that is one hell of a mess!)

No more wall sticky-out-bits

No more wall sticky-out-bits!

Modem handshake iPhone ringtone

December 8th, 2008

I was in a meeting last week with a couple of engineers when my phone went off. My normal ringtone is the  sound of a loud 56K modem handshake. Everyone in the room wanted a copy, so I though I would share it here.

The original idea for this ringtone wasn’t my own, I head it on a colleague’s Nokia ( Jim++ ). Following a bit of google / audicity / iTunes-foo, I made my own m4r. I think the result was pretty good.

WARNING - I have been using this ring-tone for about ten months, it gets you strange looks in meetings.

Download it here

Portable USB network traffic generator Part 1

October 26th, 2008

In my line of work there is a regular need to generate some network traffic, whether it’s just background noise or attack data the general requirements are the same.

  • Conjure up network traffic out of the ether
  • Have a method of exposing the traffic it to a monitoring system
  • Audit the monitoring systems categorization of the data - Did it correctly detect the data as clean or dirty.
  • Be portable.
    • I have many methods of doing this in my work or home test lab’s but not on the road where I need it the most.
  • Help out others with similar problems
    • I regularly get asked by people if I have a tool to achieve this, and I want to answer with a “Sure, take a copy of this”

After some tough thought, the best solution I came up with is a bootable USB stick that “just works”.

I thought I would walk through the steps taken to create this, followed by a downloadable image of the tool.

Consider this post part-1 in a series: Building the platform.

I am executing these instructions on an Ubuntu system, things may well differ on other platforms. I have no idea if RH based systems have an equivilant to Debians debootstrap.

Plug the stick into your system, and look at dmesg

It is important that we recognise what the device name is for our USB stick.

On my system, following insertion of a stick, I can see the following

$ dmesg
[12169.500704] sd 5:0:0:0: [sdc] 506880 512-byte hardware sectors (260 MB)
[12169.502281] sd 5:0:0:0: [sdc] Write Protect is off
[12169.502285] sd 5:0:0:0: [sdc] Mode Sense: 43 00 00 00
[12169.502287] sd 5:0:0:0: [sdc] Assuming drive cache: write through
[12169.502292]  sdc: sdc1[12171.503704] sd 5:0:0:0: [sdc] 506880 512-byte hardware sectors (260 MB)
[12171.504587] sd 5:0:0:0: [sdc] Write Protect is off
[12171.504590] sd 5:0:0:0: [sdc] Mode Sense: 43 00 00 00
[12171.504592] sd 5:0:0:0: [sdc] Assuming drive cache: write through
[12171.504596]  sdc: sdc1

Clearly my working device is sdc

Create a partition & build a filesystem

Use fdisk to remove an existing partitions on your USB stick, cfdisk or fdisk are the tools to use.

$ sudo fdisk /dev/sdc                # Manage partitions on my USB device /dev/sdc

I created a single primary Linux partition, and made it active (bootable)

Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *           1        1021      253177   83  Linux

We now need to make a filesystem on this device. Note that because of the way flash memory can only take a limited number of disk writes, we don’t want to use ext3’s journal.

$ sudo mkfs.ext2 /dev/sdc1           # Makes a ext2 fs on the partition

Install our OS onto the new filesystem

Lets mount the filesystem so that we can add files to it.

$ sudo mkdir /mnt/temp               # Create a temp mount point
$ sudo mount /dev/sdc1 /mnt/temp/    # and mount our USB filesystem

I mentioned earler that I use Ubuntu as my closen desktop disrto, however I want the USB stick to be running stock Debian stable (etch). Becase Ubuntu is essentially a broken Debian system, we can simply do the following:

$ sudo debootstrap etch /mnt/temp/ http://ftp.uk.debian.org/debian

For those who are unaware, debootstrap bootstraps a new debian system. It will install all the base programs I need for a GNU/Linux instance on this USB stick.

$ sudo dumpe2fs /dev/sdc1 | grep UUID       # find the UUID for our fs - Note this somewhere
dumpe2fs 1.40.8 (13-Mar-2008)
Filesystem UUID:          4481e1b0-0c0c-48fa-8c27-971aa95e3e9b
# chroot into our new system in /mnt/temp
$ sudo chroot /mnt/temp/             
$ mount /proc/
$ dpkg-reconfigure --all --priority critical --frontend dialog
# This reconfigures all debs that need critical configuration
$ apt-get update
$ apt-get install initrd-tools linux-image-686
# Note to pay attention to the yes/no abort prompt - Select No to continue.
$ echo 127.0.0.1 > /etc/hosts
# create a minimum hosts file
$ echo replay > /etc/hostname
$ vi /etc/fstab

Paste the below, editing the UUID for your UUID found by doing the dumpe2fs command earlier

# Leons example fstab - edit for your uuid
# Note this is the minimum i need, there is no static association with a device name here
# the UUID is a uniq ID for the fs

UUID=4481e1b0-0c0c-48fa-8c27-971aa95e3e9b /  ext2    defaults,errors=remount-ro 0       1
tmpfs           /tmp    tmpfs   defaults        0       0
proc            /proc   proc    defaults        0       0

Thats it for our work inside our chroot, lets exit and make the system bootable

$ sudo grub-install --root-directory=/mnt/temp /dev/sdc

$ sudo chroot /mnt/temp/
$ apt-get install grub

Check your grub settigns

$ umount /proc

$ exit
$ sudo umount /mnt/temp

If the umount complains about the device being busy (very likely), I find that cron is running inside the chroot. Kill it.

$ eject /dev/sdc

There you go, you should now have a bootable(ish) USB stick with a debian base install on it. What a walk i the park, and far easier than many of the how-to’s I see scattered around the internet. I have noticed that there are a few things that don’t work well and need some attention: Essentially parsing the correct partition ID at boot time to the initrd. Ill look into that and do an update when I get this being more portable.

Enjoy

-Leon

Snort and VoIP - Thoughts on IPS in a modern voice network

August 27th, 2008

I have been putting some thought into the subject of voice over IP (VoIP) and the fact it presents a particularly interesting security challenge. Communication line convergence was one of the big pushes in the early 2000’s due to the cost savings it advertised, this unification of network and voice communications also seeded the uptake of then emerging VoIP technologies into enterprise networks. Many years on VoIP is now widely accepted as a technology mature enough to be provided to a wider consumer market but still lacks some of the security features expected in a mature system.

The reason I find this security challenge interesting is that it brings together two distinct threat and concern types; one of voice communication services and one of IP networks. Those implementing or maintaining a VoIP network are commonly from one of these two backgrounds, and therefore may initially see only half of a security objective.

Stock IP threats

These are the concerns that are picked up by the regular IP networking person and probably the threats that they think about daily. For example;

  • Remote Code Execution
  • Denial of Service
  • Traffic interception

Because the Voice platform is now on an IP connected and integrated network, all of these now also exist in your voice infrastructure. In fact, all of these concerns existed before, however inward connections were far more limited than on your nice new VoIP system and attacks were less likely.

Voice specific threats

Those who maintain large non-IP voice networks have similar problems keeping them awake at night. Commonly these concerns fall into one of the following categories:

  • Service theft (toll fraud)
  • Evesdroping (wiretapping)
  • Service Disruption / Outage (read Denial of Service)

The most common VoIP signalling protocol I see in use  SiP, and it is pretty simple to understand from an observers point of view. This means that it IP based security threat monitoring tools could be converted to the voice world, IDS/IPS on VoIP networks could offer discovery and mitigation of both traditional IP network threats along with the voice specific. I recommend that those maintaining a VoIP infrastructure take a look at a modern IDS system to determine  if it can help them discover and protect against many of the threats that concern them.

Snort obvoiusly has a bucket of rules specific to voice networks put together by the Sourcefire VRT, and there are also additional offerings from the Bleeding Threats.

Fire alarm fail

August 7th, 2008

I found this poster attached to the office door. I guess it’s one approach to mitigating fire risk

photo

Snort 3 Beta on Ubuntu / Debian Installation

July 27th, 2008

A few days ago I had some spare(ish) time, and decided to take a look at the Snort 3.x beta. I took some time looking at the alpha release in 07, and am happy to see how far it has come since then.

Over the last few weeks, I have seen a couple of posts to the Snort forums asking for help to get Snort 3.x up and running. It is good to see that others are interested in testing the engine, and unfortunate that there is such a steep learning curve to get to grips with the new way that Snort, and the Snort Security Platform now work. I have a hunch that after a little effort in learning the new methods it will all soon seem like second nature to all of us.

I thought I would share the steps I went through to get Snort 3 running on a test VMware virtual machine in the hope they can help out others.

My base OS is Ubuntu jeos, a stripped down build of Ubuntu designed and optimised for running in a VMware instance, the below instructions should work for pretty much any Debian based OS and let me know if they don’t!

The Jeos installation leaves me with a minimal Ubuntu system, comparable to Debian “base” , so to build anything on top of this we need to install some extra packages.

Before we try to install and configure the Snort Security Platform along with the Snort 3 analitical engine, lets make sure that we are able to get snort 2.8.2.1 (the latest stable 2.x release at the time of writing) working on our device. This extra task will save us a LOT of time later.

Building and installing Snort 2.8

Firstly I want to access this device via ssh, so a ssh daemon is required along with some other basic tools

sudo apt-get install ssh wget

We need all the key components to allow us to compile code, the build-essential meta-package will install all of these for me.

sudo apt-get install build-essential

To build Snort from source, we need to install some key libraries and development headers that it requires. libpcap is the promiscuous packet capture library, it is used by Snort, wireshark, tcpdump etc to capture network traffic.

sudo apt-get install libpcap0.8 libpcap0.8-dev

Snort supports PCRE for matching data within packets and data streams, therefore we need to install the required libraries and header files.

sudo apt-get install libpcre3 libpcre3-dev

Once Snort’s dependancies are installed, lets get the snort 2.x source and install it.

wget http://snort.org/dl/current/snort-2.8.2.1.tar.gz
tar -zxf ./snort-2.8.2.1.tar.gz
cd snort-2.8.2.1
./configure
make
sudo make install
sudo mkdir /etc/snort
sudo cp etc/* /etc/snort

We should now be in a position where Snort 2.8.x is ready to be configured for use, lets check its availability with a snort -V to check.

snort -V

   ,,_     -*> Snort! <*-
  o"  )~   Version 2.8.2.1 (Build 16)
   ''''    By Martin Roesch & The Snort Team: http://www.snort.org/team.html
           (C) Copyright 1998-2008 Sourcefire Inc., et al.
           Using PCRE version: 7.4 2007-09-21

Before we can test Snort in any way, we need a few more things, some rules, and some test data. How you access the Snort rulebase is dependant on whether or not you are a Snort rule subscriber, and what level of subscription you have. for this simple test we don’t need the latest and greatest rules from the Sourcefire VRT (Vulnerablity Researh Team) like if we were running a real sensor, but we need a modern set of rules that will work with a 2.8 engine.

Go and register an account on snort.org, and download the “registered user release”, or use whatever ruleset you have handy for a 2.8 engine. Put the rule files into /etc/snort/rules/

<get hold of rule tarball>
tar -zxf snortrules-snapshot-CURRENT.tar.gz
sudo cp -r rules/ /etc/snort/

We now need to set the “RULE_PATH” variable in /etc/snort/snort.conf to point to /etc/snort/rules. I use vi to acomplish this.

sudo vi /etc/snort/snort.conf

After editing, the line should look like this

grep "var RULE_PATH" /etc/snort/snort.conf
var RULE_PATH /etc/snort/rules

Lets not give snort a test

snort -c /etc/snort/snort.conf -A fast -l /tmp -T

This command tells snort to start up in IDS mode reading /etc/snort/snort.conf. The output mode is “Fast”, logging will be to the /tmp directory, and to simply test the config and exit.

You should see an output a little like this:

        --== Initialization Complete ==--

   ,,_     -*> Snort! <*-
  o"  )~   Version 2.8.2.1 (Build 16)
   ''''    By Martin Roesch & The Snort Team: http://www.snort.org/team.html
           (C) Copyright 1998-2008 Sourcefire Inc., et al.
           Using PCRE version: 7.4 2007-09-21

           Rules Engine: SF_SNORT_DETECTION_ENGINE  Version 1.8  <Build 14>
           Preprocessor Object: SF_DCERPC  Version 1.1  <Build 4>
           Preprocessor Object: SF_FTPTELNET  Version 1.1  <Build 10>
           Preprocessor Object: SF_SMTP  Version 1.1  <Build 7>
           Preprocessor Object: SF_Dynamic_Example_Preprocessor  Version 1.0  <Build 1>
           Preprocessor Object: SF_SSH  Version 1.1  <Build 1>
           Preprocessor Object: SF_DNS  Version 1.1  <Build 2>
           Preprocessor Object: SF_SSLPP  Version 1.0  <Build 1>

Snort successfully loaded all rules and checked all rule chains!
Snort exiting

The below pcap is one I commonly use for testing an installation, it contains some obvious attacks from about 2001. I host it here to make it easy for me to find but its originally from the honeynet project (original data captured by Rain Forest Puppy).

cd /tmp
wget rm-rf.co.uk/downloads/Honeynet-RFP-iis.tgz
tar -zxvf ./Honeynet-RFP-iis.tgz

Now we have Snort configured (using the term losely), and a pcap to test snort with, lets give it a run.

snort -c /etc/snort/snort.conf -A fast -l /tmp -r ./Honeynet-RFP-iis.pcap

If successful you should have a file in /tmp/Alert that contains lots of alarms, and /tmp/snort.log.<timestamp> that contains the pcaps of the detected events.

If you do, lets move on to building and installing snortsp.

Building Snortsp 3.0Beta

The Snort security platform has other requirements for building on top of the above that were needed for Snort 2.x

Libnet and libdumbnet provide low level packet creation and modification libraries. Note that libdumbnet is the Debian name equivalent of libdnet in other distributions. The curses libraries handle screen and terminal manipulation, Libreadline provides history and tab completion for terminal commands to improve the user interaction expience with a shell. Lua is the new scripting language used in the Snort Security Platform, flex and bison are more modern replacements to lex and yacc. A UUID (universally unique identifier) generator is also now required for SnortSP.

sudo apt-get install libnet1 libnet1-dev \
    libdumbnet-dev libdumbnet1 \
    libncurses5 libncurses5-dev \
    libreadline5 libreadline5-dev \
    liblua5.1-0 liblua5.1-0-dev \
    flex bison \
    uuid uuid-dev

Now download and compile SnortSP.

Note: At the time of writing snort 3.0.0b2 is the most current release. Don’t use old betas, go grab the latest from snort.org.

cd ~
wget http://www.snort.org/dl/prerelease/3.0.0-b2/snortsp-3.0.0b2.tar.gz
tar -zxf ./snortsp-3.0.0b2.tar.gz
cd snortsp-3.0.0b2
./configure
make
sudo make install
sudo ldconfig
sudo mkdir /etc/snortsp
sudo cp etc/* /etc/snortsp/

Now SnortSP should be installed, not that this is just the security platform and not the snort engine itself. Snort, the analytical engine, needs to be built separately. Before we compile it first check that snortsp works

snortsp -V
SnortSP Version 3.0.0b2

cd src/analysis/snort/

./configure --with-platform-includes=/usr/local/include/snortsp/ \
    --with-platform-libraries=/usr/local/lib/snortsp/
make
sudo make install

The snort engine should now be ready for configuration and use under SnortSP. The challenge we have now it to get it doing what we want.

Start up snortsp to check the platform it is ready for use, (ssp.shutdown() is the command to shutdown the snortsp shell)

sudo snortsp -L /etc/snortsp/snort.lua
[+] Loaded pcap DAQ
[+] Loaded file DAQ
[+] Loaded afpacket DAQ
[*] DAQ Modules Loaded...
[*] Loading decoder modules
[+] Loaded ethernet
[+] Loaded null
[+] Loaded arp
[+] Loaded ip
[+] Loaded tcp
[+] Loaded udp
[+] Loaded icmp
[+] Loaded icmp6
[+] Loaded gre
[+] Loaded mpls
[+] Loaded 8021q
[+] Loaded ipv6
[+] Loaded ppp
[+] Loaded pppoe
[+] Loaded gtp
[+] Loaded raw
[*] Decoder initialized...
[*] Flow manager initialized...
[*] Data source subsystem loaded
[*] Engine manager initialized
Control thread running - 3083479952 (22010)
[*] Loading command interface
[!] Loading SnortSP command metatable
[!] Loading data source command metatable
[!] Loading engine command metatable
[!] Loading output command metatable
[!] Loading analyzer command metatable
Executing /etc/snortsp/snort.lua
   ,,_     -*> SnortSP! <*-
  o"  )~   Version 3.0.0b2 (Build 9) [BETA]
   ''''    By Martin Roesch & The Snort Team: http://www.snort.org/team.html
           (C) Copyright 2008 Sourcefire Inc.
snort> ssp.shutdown()

Because snortsp is a radically new method of handling data sources and detection engines (such as the Snort analytic), some tools have been provided within the snortsp tarball for porting your old method of starting up snort and having it run within the snortsp. This tool is called sspiffy.sh. This tool was a key element to me getting my first instance of snort inside the snortsp running the packets contained within my pcap through detection, however it wasn’t the simple walk in the park it was supposed to be.

I suggest you take a look at the documentation for this tool and see how you get on, however expect the lua file that it creates to not be perfect, but close. Also make sure that it has write access to your snort.conf. With this in mind, i decided to share my sightly modified lua file, based on the output of sspiffy.sh. It works for me along with this snort.conf. Feel free to hack about with it to make it do what you want.

My snort.lua file (save it to /etc/snort)

My snort3 beta snort.conf file (save it to /etc/snort)

cd /tmp/
wget http://rm-rf.co.uk/downloads/snort3_beta_pcap.lua
sudo cp snort3_beta_pcap.lua /etc/snort/

sudo mv /etc/snort/snort.conf /etc/snort/snort.conf.2.8
wget http://rm-rf.co.uk/downloads/snort3_beta.conf
sudo cp /tmp/snort3_beta.conf /etc/snort/snort.conf

Now lets fire up snortsp using the lua file above, and see how she goes. If successful you should see output like this.

Anyway, I need to spend some more time playing with the tool and less writing all of this. Let me know if I have got something wrong, or if these instructions don’t work for you.

Happy Snortin’

-Leon

“Not using PCAP_FRAMES”, A.k.a When good verbosity goes bad

July 18th, 2008

The same questions get posted again and again to the Snort forums, at the moment this is the most frequently misunderstood, and asked question that catches my eye.

Help !!!!!!!!
Snort doesn’t work !
It dies with a “Not Using PCAP_FRAMES” error message”.
Quick, quick help me now!

I’m ranting about this here so hopefully when people google the “Not using PCAP_FRAMES” message before blindly posting to the forums or mail lists for help (I know, I can dream), maybe this post will appear in their search results solving their non-issue.

What is an error message?

Lets look a real error messages first, unlike the above.

--== Initializing Snort ==--
Initializing Output Plugins!
Initializing Preprocessors!
Initializing Plug-ins!
Parsing Rules file /this/rules/file/does/not/exist
ERROR: Unable to open rules file: /this/rules/file/does/not/exist or /this/rules/file/does/not//this/rules/file/does/not/exist
Fatal Error, Quitting..

The error condition above is clearly identified, other messages not prefixed with “ERROR” are supporting messages to help a user understand what the system is doing. This rule holds true with most software and not Snort alone.

What is a PCAP_FRAME?

PCAP_FRAMES is an environment variable that is used to pass a configuration setting to a custom pcap library, specifically the code by Phil Woods (Nice job by the way Phil). If you have not built snort against Phil’s libpcap that supports pcap ring buffers in shared memory, PCAP_FRAMES means absolutely NOTHING to you, zip, nout, fsck all, nada.

If you are unsure if you have built Snort against Phil’s libpcap or a stock distribution, then trust me you’re using a stock libpcap.

For those who are interested, PCAP_FRAMES defines a size (in frames) of a pcap ring-buffer in shared memory.

Are you sure? It looks like Snort stops with this as an error.

Yes I’m sure, and I find your lack of faith disturbing. Lets look at the code in snort.c to check.

1163     if( getenv(”PCAP_FRAMES”) )
1164     {
1165         LogMessage(”Using PCAP_FRAMES = %s\n”, getenv(”PCAP_FRAMES”) );
1166     }
1167     else
1168     {
1169         LogMessage(”Not Using PCAP_FRAMES\n” );
1170     }

If the environment variable PCAP_FRAMES is set, it shows the value to user during Snort initialization. If the environment variable is not set, it tell the user that PCAP_FRAMES are not being used.

For example, ill start up snort as a sniffer on my Mac with a stock libpcap.

[09:12:32]lward@drax~$ sudo snort -vdei en0 > /dev/null
Password:
Running in packet dump mode
-snip verbose startup output-
,,_     -*> Snort! <*-
o"  )~   Version 2.8.0.2 (Build 75)
''''    By Martin Roesch & The Snort Team:
http://www.snort.org/team.html
(C) Copyright 1998-2007 Sourcefire Inc., et al.
Using PCRE version: 7.6 2008-01-28
Not Using PCAP_FRAMES
^C*** Caught Int-Signal
==============================================================
Packet Wire Totals:

-SNIP-

Here Snort has started up and was sniffing without error (until I hit CRTL+C), now lets set PCAP_FRAMES to some garbage because it will have no effect on Snorts behavior or my stock libpcap.

bash-3.2# export PCAP_FRAMES="Foo Bar This setting has no impact on my libpcap instance"
bash-3.2# snort -dvei en0 > /dev/null
Running in packet dump mode
--== Initializing Snort ==--
Initializing Output Plugins!
Verifying Preprocessor Configurations!
Initializing Network Interface en0
OpenPcap() device en0 network lookup:
en0: no IPv4 address assigned
Decoding Ethernet on interface en0
--== Initialization Complete ==--
 ,,_     -*> Snort! <*-
o"  )~   Version 2.8.0.2 (Build 75)
 ''''    By Martin Roesch & The Snort Team: http://www.snort.org/team.html
(C) Copyright 1998-2007 Sourcefire Inc., et al.
Using PCRE version: 7.6 2008-01-28
Using PCAP_FRAMES = Foo Bar This setting has no impact on my libpcap instance
 ^C*** Caught Int-Signal
 ===================================

So in summary, this verbose message has no meaning to most users of Snort. If you are running Snort as an IDS but not in daemon mode, don’t expect to see anything on STDOUT until you stop the processes (hit CRTL+C to send a SIGINT).

As always, happy Snortin’
-Leon

Defining achievable IDS/IPS deployment goals

July 8th, 2008

A network intrusion detection (and prevention) system is a flexible tool that can be used in many different ways. Let’s outline some of the most common deployment types I see in use today on *real* networks, and look them in no particular order. The reason for looking at these deployment type is to encourage more common compartmentalization (or segmentation) of monitoring tasks.

Firstly let’s don’t not forget that I[DP]S is all about access controls, which controls are implemented are your choice.

a) Tactical threat suppression
b) Business link risk mitigation
c) Security event detection
d) Network audit controls

Tactical threat suppression (Provides a preventative access control)
This is normally seen as the deployment of IPS at key access gateways of a protected network, the policy deployed is set to prevent specific malicious traffic flows from gaining entry. This design meets the “virtual patch” ideas to protect assets from key threats that concern the security team. Think “sploit de jour”.

Security event detection (Provides a detective access control)
Deployment of an IDS to detect network events that could impact the traditional security goals of the network (think network security 101 goals here (C, I & A)).
This is probably the most commonly planned IDS deployment from the out-set, it defines a system that is inspects network data flow, and when a security event occurs a team of analysts is there do their “job”. Following analysis, some form of incident response policy would be followed that should lead to the event being resolved. The main requirement for this type operation is a tuned IDS system to detect events that matter to the organization where something can be done in response to them.

Business link risk mitigation (Provides a preventative access control)
The use of an IPS can decrease the risk associated with a network link, therefore allowing the organization to potentially conduct business with higher risk 3rd party networks. The IPS policy acts as a traffic scrubber to prevent potentially harmful flows from entering the network from less-trusted parties.

Network event recording (Provides an audit control)
Deployment of an IDS that monitors the network for potential security events and supporting information. This is sometimes seen as a failed “Security Event Detection” deployment, where an IDS just logs event data but isn’t inspected by an analyst in anything close to real-time. A report may be run once in a while, but the data is stored for future reference should it be needed.
I see this is as a very valid deployment goal, and those who want “all rules enabled” generally fit into this category.

Problems can appear when designs attempt mix requirements between these achievable goals, for example:

Security event detection + Network event recording:

This combination leads to access and audit controls being enabled in the same policy. Those who are interested in audit requirements commonly want “all rules enabled” and therefore create an un-tunable policy that cannot hope to provide accurate security event detection (read bucket loads of F+).

The methods used to analyze, store, and work with event data may vary across the deployment goals. For example, if a user wants to place a device outside of a firewall to provide audit records, keeping event data in a live event analysis system may be overkill. Maybe a better solution would be an event feed to a SAN in a flat-file system. This would remove the burden to keep event data in an analysis database for real-time access.

Splitting an IDS/IPS deployment into logical chunks, each with specific requirements makes makes a far more manageable and valuable deployment as these goals can be segmented and managed on their own. When I get time I will put more effort into explaining my ideas around this, but in the short term I wanted to throw some ideas out there.

Automated IDS alert thresholding

June 6th, 2008

A question was posted to the Snort forums a short while back asking if Snort had the ability to accept how “dirty” a network is today, and then be alerted to only new threats that have never been seen before.

The idea behind this is quite simple, make an assumption that the network is “secure” as it is and operating fine today, then work out how much IPS noise it generates under this normal operation. In the future only alarm on events that have not been previously discovered during the “normal” period.  This type of difference analysis commonly requires a reporting tool that analyses the output from network sensors, but the way that the question was phrased got me thinking about this as a tuning process.

So lets summarize the steps involved to achieve this as a tuning goal.

  • Sensor must be deployed into the target network
  • Sensor must be run for a period of time to generate an alert “base line”
  • The Alerts must be investigated to check that they are all “acceptable” and normal for a network of this type (make sure you don’t accept an already p0wned network)
  • All alerts that were raised then need to be suppressed based on the assumption that they have no interest to the analyst now or in the future.
  • Sensor must be restarted with a new “suppressed” configuration.

It turns out that this is a simple thing to achieve, and after thinking about it for a while also raises two very interesting points:

  • The bulk trade off between F+ and F- . Is there an acceptable ratio, and what is it?
  • IDS for forensic use vs IDS for enhancing current security

I will approach both of the above points in another blog entry when I get some time.

Anyway, here is a dirty bit of perl that achieves what the above. It parses Snort’s fast alert output, and creates a suppression entry for each gid:sid that has generated an alarm. The suppression decision is made either on the event source IP, destination IP, or both IPs depending on what type of event is discovered.

For example, it is more common that policy-violations will need to be suppressed on the IP address that was the source of the event, and therefore the source of the “non policy violating policy-violation” that you don’t want to know about in the future (there is logic there, you just need to look for it).

Execution of the script is simple, and instructions are included in the source.

Download snort_alert_autosuppress.pl here.