next up previous contents
Next: pkt_data Up: pcre Previous: Format   Contents

Example

This example performs a case-insensitive search for the HTTP URI foo.php?id=<some numbers>

    alert tcp any any -> any 80 (content:"/foo.php?id="; pcre:"/\/foo.php?id=[0-9]{1,10}/iU";)

Note:   It is wise to have at least one content keyword in a rule that uses pcre. This allows the fast-pattern matcher to filter out non-matching packets so that the pcre evaluation is not performed on each and every packet coming across the wire.

Note:  

Snort's handling of multiple URIs with PCRE does not work as expected. PCRE when used without a uricontent only evaluates the first URI. In order to use pcre to inspect all URIs, you must use either a content or a uricontent.



Eugene Misnik 2013-05-08