Created
July 30, 2013 13:47
-
-
Save glaslos/6113050 to your computer and use it in GitHub Desktop.
Snort rules related to HTTP ports
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
rule_count = 0 | |
http_rule_count = 0 | |
r = requests.get("http://rules.emergingthreats.net/open-nogpl/snort-edge/rules/emerging-trojan.rules") | |
for line in r.text.split("\n"): | |
if line.strip() == "#": | |
rule_count += 1 | |
elif "$HTTP_PORTS" in line: | |
http_rule_count += 1 | |
print "{0} rules total, {1} related to HTTP ports".format(rule_count, http_rule_count) | |
# 2059 rules total, 1520 related to HTTP ports |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment