I want to generate an event in snort whenever someone visits a URL structured like
site/year2015.pdf
site/year2014.pdf
:
:
site/year2000.pdf
Instead of writing multiple snort rules as more URLs will be added over years I thought of utilizing PERC. The rule is written as.
alert tcp any any -> any any(msg:"PDF is being downloaded"; pcre:"(/.*site\/year\d\d\d\d\.pdf)/i"; sid: 100003; rev:3;)
I tried many different ways of inserting the regex in the rule above but it always fails to parse it. The Regex is doing fine what I want it to do here. The whole thing starts to fail because it does not start cause of rule not being parsed.
Error received is
Error: /etc/snort/rules/assignment.rules Line 3 => unable to parse pcre regex "(/.*site\/year\d\d\d\d\.pdf)/i"
Fatal Error Quitting..