Snort mailing list archives

Re: writing rule with uricontent keyword


From: Brian <bmc () snort org>
Date: Tue, 1 Mar 2005 14:06:57 -0500

On Mon, Feb 28, 2005 at 02:39:08PM -0500, Jiju Menon wrote:
I tried to get an alert with a test rule using uricontent:

alert tcp $HOME_NET any -> $EXTERNAL_NET 80 (msg:"yahoo.com";
uricontent:"yahoo.com";nocase;)

The rule seems not to detect a connection made to yahoo.com. Can
anyone help me to get this rule working?

While the URL http://www.yahoo.com/foo.html, your packet will look
something like this:

    GET /foo.html HTTP/1.1\r\nHost: www.snort.org\r\n\r\n

You need to write your rule to look something like this:

alert tcp $HOME_NET any -> $EXTERNAL_NET 80 (msg:"yahoo.com"; 
    content:"Host|3a|"; nocase; pcre:"/^Host:\x3a.*yahoo.com/mi";)

Brian


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Snort-users mailing list
Snort-users () lists sourceforge net
Go to this URL to change user options or unsubscribe:
https://lists.sourceforge.net/lists/listinfo/snort-users
Snort-users list archive:
http://www.geocrawler.com/redir-sf.php3?list=snort-users


Current thread: