Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rule parsing fails if last option doesn't close with semi-colon #90

Open
KimiNewt opened this issue Feb 9, 2022 · 1 comment
Open

Comments

@KimiNewt
Copy link

KimiNewt commented Feb 9, 2022

Rule that end their last option without a semi-colon fail parsing, while snort accepts them. e.g.

Exception: end of option not found: alert tcp $EXTERNAL_NET 53 -> $HOME_NET any (msg:"NF - LOCAL Large DNS TCP response - possible CVE-2015-7547 attempt"; flow:to_client,established; byte_test: 1,&,128,4; byte_test:2,>,2000,0; flowbits: set,large_dns_resp; flowbits: noalert; reference:url,seclists.org/snort/2016/q1/285; reference:url,networkforensic.dk; metadata:22022016; classtype:misc-activity; sid:5019401; rev:1)

This happens in rule.py's find_opt_end(), since it only looks for a semi-colon. A simple solution seems to also search for an ending parenthesis in case a semi-colon isn't found, but I'm ot sure if this could result in unexpected behaviour.

@jasonish
Copy link
Owner

I wrote this tool more for Suricata than Snort, and Suricata does not accept such a rule. I'm a little hesitant to make this change as I don't use this code myself anymore, but others do depend on it.

A quick look at pulledpork3 source code and it looks like it wouldn't accept this rule either, at least not with rev at the end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants