[prev in list] [next in list] [prev in thread] [next in thread] 

List:       snort-sigs
Subject:    [Snort-sigs] distance, within, and negated matches
From:       L0rd Ch0de1m0rt <l0rdch0de1m0rt () gmail ! com>
Date:       2012-06-29 15:41:51
Message-ID: CAA7Gf8sGYzqzsp51zp9s_j=2MgogkPx9ovD-oU-cfE37CmcX_A () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hello.  Let's say I want to alert on 'foo' in the http uri but not if 'bar'
or 'xyz' come after it and are within 16 bytes. I have:

content:"foo"; http_uri; content:!"bar"; http_uri; within:16;
conent:!"xyz"; http_uri; within:16;

Will this work?

Basically, if you have two negated content matches in a row with 'within',
do they both match relative to the last non-negated content match or does
the buffer pointer move with the first negated content match and apply to
the second negated content match?  If the latter, I guess you would have to
do something like this, right?:

content:"foo"; http_uri; content:!"bar"; http_uri; within:16;
conent:!"xyz"; http_uri; within:13;

Or would you have to rematch like this?:

content:"foo"; http_uri; content:!"bar"; http_uri; within:16;
content:"foo"; http_uri; conent:!"xyz"; http_uri; within:16;

Cheers,

Lord C.

[Attachment #5 (text/html)]

Hello.=A0 Let&#39;s say I want to alert on &#39;foo&#39; in the http uri bu=
t not if &#39;bar&#39; or &#39;xyz&#39; come after it and are within 16 byt=
es. I have:<br><br>content:&quot;foo&quot;; http_uri; content:!&quot;bar&qu=
ot;; http_uri; within:16; conent:!&quot;xyz&quot;; http_uri; within:16;<br>
<br>Will this work?<br><br>Basically, if you have two negated content match=
es in a row with &#39;within&#39;, do they both match relative to the last =
non-negated content match or does the buffer pointer move with the first ne=
gated content match and apply to the second negated content match?=A0 If th=
e latter, I guess you would have to do something like this, right?:<br>
<br>content:&quot;foo&quot;; http_uri; content:!&quot;bar&quot;; http_uri; =
within:16; conent:!&quot;xyz&quot;; http_uri; within:13;<br><br>Or would yo=
u have to rematch like this?:<br><br>content:&quot;foo&quot;; http_uri; con=
tent:!&quot;bar&quot;; http_uri; within:16; content:&quot;foo&quot;; http_u=
ri; conent:!&quot;xyz&quot;; http_uri; within:16;<br>
<br>Cheers,<br><br>Lord C.<br><br>


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

_______________________________________________
Snort-sigs mailing list
Snort-sigs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/snort-sigs
http://www.snort.org


Please visit http://blog.snort.org for the latest news about Snort!

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic