Ethical Hacking

Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package.
Computer Forensics Training at InfoSec Institute

Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors.




Network Security Snort-Signatures
[Top] [All Lists]

Re: [Snort-sigs] Strange PCRE usage in standard snort rules

Subject: Re: [Snort-sigs] Strange PCRE usage in standard snort rules
Date: Mon, 9 May 2005 10:32:43 -0400
On Mon, May 09, 2005 at 11:59:01AM +1000, Erik de Castro Lopo wrote:
I've noticed some strange usage of PCRE in the netbios.rules. For 
instance, rule 2937 has the following construct:

    pcre:"/^.{27}/R";
    content:"&|00|"; distance:29; within:2;

which uses the PCRE matcher to move the current match position forward
by 27 characters and then has a 2 byte content match a further 29 
characters on in the packet (I think thats correct).

That is exactly what it is trying to do.

You are looking at a netbios rule.  Most of the netbios rules are
code generated now.  Instead of the snippet above, it would be faster
to do this:

    content:"&|00|"; distance:56; within:2;

In the above setup, I am using pcre to skip to the appropriate section
in the request, and start doing detection from there.

This way I only worry about each section on its own, bolting them
together as needed to support all of the many enumerations that SMB
allows.  The DCERPC rules are developed first for DCERPC directly
(aka, port 135 via UDP), and then bolted on-top of SMB.  

The rules work fine that way, and for me, the rules are easier to
write.

These rules can be made faster, but doing so makes my rule generator a
bit more complicated.  That additional layer of cleanup will happen
soon enough.  First, detect the vulnerability.  If we have time, tune
it so it doesn't turn the sensor into a brick. ;P

Brian


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
Snort-sigs mailing list
Snort-sigs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/snort-sigs

<Prev in Thread] Current Thread [Next in Thread>