Snort Rule - HTTP Body Content

穿精又带淫゛_ 提交于 2019-12-11 18:06:41

问题


I am trying to create a simple rule to alert when "MZ" are the first two characters in the HTTP body.

My current rule is:

alert tcp any any -> any any (msg:"Test"; content:"MZ"; depth: 2; http_client_body; sid:51; rev:1;)

But this finds no results despite "MZ" definitely being present in the HTTP body.

Assistance much appreciated.


回答1:


After seeking assistance from a few other sources, it turns out I was asking snort to look in the wrong place:

The correct rule is below:

alert tcp any any -> any any (msg:"Test"; file_data; content:"MZ"; depth: 2; sid:51; rev:1;)

Instead of http_client_body after the content string, the rule needed file_data before the content string.

http_client_body = the request body

file_data = the response body*

(*It's more complicated than that, but this is sufficient to explain this case. Please see the Snort documentation for further reference)



来源:https://stackoverflow.com/questions/54015580/snort-rule-http-body-content

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!