Convert Pads signature to Bro-NIDS

A few months back Bamm from Sguil has included PADS (Passive Asset Detection System) into Sguil to assist in network asset discovery passively. Although this is a great adding to Sguil, unfortunately PADS is no longer maintained by the original author.

Geek00l has written a nice article about converting PADS signature into Bro-NIDS signature.

To convert the PADS signature to Bro-NIDS signature, he is using egrep, awk and sed to get this done.

For me that is too much hassle, so I have written a small Perl to get the same thing done.

Here is my first alpha release of converting PADS signature to Bro signature

#!/usr/bin/perl -w

use strict;

my ($srv, $ver, $sig, $osrv);
my $cnt = 1;

while (<>) {
    # remove empty lines and lines with comment
    next if ( /^(?:#|\s+$)/);

    # split each section up into (service, version and signature)
    ($srv, $ver, $sig) = split(/,/);
    chomp($sig);

    # remove (unwanted) entries from the signature
    $ver =~ s!v/([\w\d\s\.]+)?.*$!$1!;

    # set an unique signature-Id
    $cnt = 1 if ( $osrv ne "$srv");
    $osrv = $srv;
    $srv = sprintf("%s-%03d", $srv, $cnt);
    $cnt++;

    # print the outcome to stdout
    print <<EOL;
signature $srv
{
    ipproto == tcp
    src-ip != local_nets
    dst-ip == local_nets
    event \"$ver\"
    tcp-state established
    payload /$sig/
}

EOL
}

Well, it is still a first release, it looks quite alright! Hopefully in the near future can include this into Sguil and move away from PADS. Maybe Bro-NIDS all together.

Leave a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About this Entry

This page contains a single entry by Robin Gruyters published on September 23, 2007 3:42 PM.

Querying session data based on Bleeding Snort compromised IPs was the previous entry in this blog.

Stupid SSH Tricks: ProxyCommand is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Powered by Movable Type 4.2rc4-en