[Snort-users] Content "c:"

Erek Adams erek at ...577...
Tue Jun 19 16:28:12 EDT 2001


On Tue, 19 Jun 2001, Sheahan, Paul (PCLN-NW) wrote:

>
> I'm trying to create a rule that searches for content of "c:" in packets.
> But Snort complains that a closing quote is needed. In a prior posting I had
> asked about "c:\" and someone mentioned the backslash was a problem. Even
> without the backslash this still fails. Ths is the latest test rule I tried:
>
> alert tcp $HOME_NET any -> $EXTERNAL_NET any (msg:"Outgoing c:"; content:
> "c:"; nocase;)
>
> Snort complains that content needs an ending quote. Apparently the colon
> after the "c" is what is messing this up. Does anyone know how to make a
> content rule with "c:" or any drive letter as the content?

Paul,

	Have a look at the attached message.

-----
Erek Adams
Nifty-Type-Guy
TheAdamsFamily.Net
-------------- next part --------------
From dr at kyx.net Tue Jun 19 13:26:12 2001
Date: Sun, 17 Jun 2001 23:30:35 +0000
From: Dragos Ruiu <dr at kyx.net>
To: "Sheahan, Paul (PCLN-NW)" <Paul.Sheahan at priceline.com>,
     "'Snort-users at lists.sourceforge.net'" <Snort-users at lists.sourceforge.net>
Subject: Re: [Snort-users] Trouble with home-made rule

    [ The following text is in the "iso-8859-1" character set. ]

    [ Your display is set for the "US-ASCII" character set.  ]

    [ Some characters may be displayed incorrectly. ]

This is a kind of esoteric problem that is likely to bite
people who are new to C or unfamiliar with C strings.  
We ought to put a quick little check for backslashes 
and a warning message in the parser to make this 
easier to figure out in the future... I'll send you a 
patch Marty...  I've also been meaning to make 
the port #'s optional for ICMP rules too rather than 
having to put in bogus values...

cheers,
--dr

On Sunday 17 June 2001 23:14, Dragos Ruiu wrote:
> Your problem is with the backslash before the quote....
> \" is how you escape a quote inside the content string
> so it looks like an unterminated string to the parser.
>
> try:
>
> "C:\\"
>
> and remember to add another rule for lowercase:
>
> "c:\\"
>
> the slash in the message string may be a problem too.
> I'd double it up just to make sure....
>
> cheers,
> --dr
>
> On Monday 18 June 2001 05:51, Sheahan, Paul (PCLN-NW) wrote:
> > Hello,
> >
> > I'm expermenting for the first time creating my own rules. I decided to
> > create a rule that detects whenever one of my servers responds to an
> > external address with "C:\" in the packet in case my servers are giving
> > out any info on the local drive without my knowledge. I added this rule:
> >
> > alert tcp $HOME_NET any -> $EXTERNAL_NET any (msg:"Outgoing c:\";
> > content: "c:\"; nocase;)
> >
> > And received this error when starting Snort (the rule above is on line
> > 16):
> >
> > ERROR Line 16 => Content data needs to be enclosed in quotation marks
> > (")!
> >
> > Obviously the closed quotation is there. I thought maybe the ":" in "C:\"
> > is confusing Snort? Just a guess. Anyone know how I can fix this?
> >
> > Thanks!
> >
> >
> > _______________________________________________
> > Snort-users mailing list
> > Snort-users at lists.sourceforge.net
> > Go to this URL to change user options or unsubscribe:
> > http://lists.sourceforge.net/lists/listinfo/snort-users
> > Snort-users list archive:
> > http://www.geocrawler.com/redir-sf.php3?list=snort-users
>
> _______________________________________________
> Snort-users mailing list
> Snort-users at lists.sourceforge.net
> Go to this URL to change user options or unsubscribe:
> http://lists.sourceforge.net/lists/listinfo/snort-users
> Snort-users list archive:
> http://www.geocrawler.com/redir-sf.php3?list=snort-users

_______________________________________________
Snort-users mailing list
Snort-users at lists.sourceforge.net
Go to this URL to change user options or unsubscribe:
http://lists.sourceforge.net/lists/listinfo/snort-users
Snort-users list archive:
http://www.geocrawler.com/redir-sf.php3?list=snort-users


More information about the Snort-users mailing list