Skip to content

Instantly share code, notes, and snippets.

@glaslos
Created July 30, 2013 13:47
Show Gist options
  • Save glaslos/6113050 to your computer and use it in GitHub Desktop.
Save glaslos/6113050 to your computer and use it in GitHub Desktop.
Snort rules related to HTTP ports
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