|
|||||||||||
|
[Snort-devel] is offset subtracted from depth?
From: Jason Lunz <lunz(at)falooley.org>
Date: Wed Mar 03 2004 - 16:46:09 EST
2.5.4 depth The depth keyword allows the rule writer to specify how far into a packet snort should search for the specified pattern. depth modifies the previous 'content' keyword in the rule. A depth of 5 would tell snort to only look look for the specified pattern within the first 5 bytes of the payload. This would indicate that for the example rule given above, 0-indexed bytes 4-23 are searched, for a searched area of 20 bytes. However, a cursory reading of uniSearchReal() in detection-plugins/sp_pattern_match.c from 2.1.1 says: int depth = dlen; [... stuff omitted ...] else /* otherwise just use the offset (validated by calling function) */ { base_ptr += pmd->offset; depth -= pmd->offset; } So without reading into the snort code any more, it appears that the example given in the docs would subtract offset from depth before searching, giving a search range of data bytes 4-19 and a target area of 16 bytes. Am I just reading the snort source incorrectly? Or does the documentation need an update? If so, what does that mean for all the rules written using the old documentation? thanks, Jason This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click Snort-devel mailing list Snort-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/snort-devel Received on Thu Mar 4 08:46:47 2004 This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 14:08:10 EDT |
||||||||||
|
|||||||||||