<div dir="ltr">Since I cannot rely on external ip addresses, I've been testing out a new rule that examines the http content, specificially the http header. Looking at the http-keyword page on redmine, this is the new rule I created for testing<div>
<br></div><div style>alert http any any -> any any (msg:"rule fired"; content:"<a href="http://businessweek.com">businessweek.com</a>"; http_header;)</div><div style><br></div><div style>Looking at the example, it explains it would look at the http header for any matching and create an alert if it matches. My one question is how exactly does it do the matching?</div>
<div style><br></div><div style><br></div><div style>For instance, the <a href="http://businessweek.com">businessweek.com</a> address can appear in two places based on what I examined in the wireshark http packets</div><div style>
<br></div><div style>Host: <a href="http://www.businessweek.com">www.businessweek.com</a>\r\n</div><div style><br></div><div style>or</div><div style><br></div><div style>Referer: <a href="http://www.businessweek.com/\r\n">http://www.businessweek.com/\r\n</a></div>
<div style><br></div><div style>The examples shown in redmine only show it matching to the Host field but would this same rule also match if the address showed up in the Referer field? Right now I'm running into issues with Chrome caching which is fuddling my results so I can't tell based on my testing, but I was wondering if anyone had any experience and knows what Suricata is doing with the content matching in the header field.</div>
<div style><br></div><div style>Also is it possible to specify a wildcard * in the content: "*<a href="http://businessweek.com">businessweek.com</a>" for matching?</div><div style><br></div><div style>The end goal is for me to maybe specify that</div>
<div style><br></div><div style>content:"Host: *<a href="http://businessweek.com">businessweek.com</a>"; http_header;</div><div style><br></div><div style>so that Suricata would match all packets going to this address. I ran a test with the modified rule</div>
<div style><br></div><div style>alert http any any -> any any (msg:"rule fired"; content:"*<a href="http://businessweek.com">businessweek.com</a>"; http_header;)<br></div><div style><br></div><div style>
and fast.log isn't populating. I'm not sure if I'm doing it wrong or if wildcards are not supported in Suricata rules.</div><div style><br></div><div style>Vince</div></div>