snort rule for DNS query

Greetings,
I am trying to configure a rule in the local.rules file to capture DNS queries for malwaresite.ru. The following rule is not working

alert udp any any <> any 53 (msg:"DNS request of bad URL"; content:"malwaresite.ru"; sid:1232313;)

Thank you.
centemAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rich RumbleSecurity SamuraiCommented:
The <> is incorrect syntax, it should be -> only, this "arrow" always faces right and will not work in any other direction. It actually does nothing to affect the rule, it's just part of the syntax.
-rich
0
Rich RumbleSecurity SamuraiCommented:
Well it "is valid" but not for UDP really, and you shouldn't need a bidirectional rule like that for DNS. Since your doing "any any -> any 53" snort has no idea what direction to use already, so it's almost implied bidirectional, but still isn't technically.
-rich
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
centemAuthor Commented:
Thanks richrumble. I seem to catch all DNS query request. I noticed during my internet searches the inclusion of a long hex representation. Do I need to reqresent the domain in hex in order for it to only fire off for that specific domain?
0
Rich RumbleSecurity SamuraiCommented:
No, hex is slightly faster technically to match rules, but it's not necessary. Also note that making your string case insensitive with the "nocase" switch does not work with hex. So Example.com would not be matched if you used the hex of "example.com" Hex is how the packets are seen by the OS/kernel, converting them to "ascii" or strings is trivial for snort, but not necessary.
-rich
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Security

From novice to tech pro — start learning today.