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

Parsing a badly-formatted rule ends in seg fault #58

Closed
imbellish opened this issue Sep 8, 2017 · 1 comment
Closed

Parsing a badly-formatted rule ends in seg fault #58

imbellish opened this issue Sep 8, 2017 · 1 comment

Comments

@imbellish
Copy link

To reproduce:

>>> from idstools import rule
>>> rule.parse_file('snort.rules')

NOTE: the second rule is missing a semi-colon after metadata, an obvious cause, but a typo on my part.

snort.rules

 drop ( msg: "REPUTATION_EVENT_BLACKLIST"; sid: 1; gid: 136; rev: 1; metadata: rule-type preproc; classtype:bad-unknown; )
 alert icmp any any -> $HOME_NET any (msg:"ICMP test detected"; gid:0; sid:10000001; rev:1; classtype: icmp-event; metadata:policy balanced-ips drop, policy connectivity-ips drop, policy security-ips drop)
 alert ip any any -> any any (msg: "IP Packet detected"; gid:0; sid:10000002; rev:1; classtype:icmp-event; metadata:policy balanced-ips drop, policy connectivity-ips drop, policy security-ips drop;)
 alert ( msg: "REPUTATION_EVENT_WHITELIST"; sid: 2; gid: 136; rev: 1; metadata: rule-type preproc; classtype:bad-unknown; )

Version information:
I tested this out on two different python versions since seg faults are unusual. Not sure if it affects python 3 but I'd guess that it does.

  • Python 2.7.6, 2.7.9
  • idstools 0.6.1, 0.6.2
jasonish added a commit that referenced this issue Nov 20, 2017
Infinite loop would be entered.

Issue:
#58
@jasonish
Copy link
Owner

Thanks. This should be fixed in master now.

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