工程造价信息网站,介绍网络营销,网站建设平台选择,黄冈公司做网站一、Payload关键字
1、content
可以匹配所有字符#xff1b;从a到z#xff0c;大写和小写及所有特殊标志。针对一些特殊符号或中文等#xff0c;需要使用十六进制进行匹配#xff0c;写法#xff1a;|3A|表示冒号#xff0c;以此类推。|0D| - \r#xff0c;|0A| -…一、Payload关键字
1、content
可以匹配所有字符从a到z大写和小写及所有特殊标志。针对一些特殊符号或中文等需要使用十六进制进行匹配写法|3A|表示冒号以此类推。|0D| - \r|0A| - \n
另外默认情况下content中给定的值是包含运算模糊匹配但是不是正则表达式同时也可以在content后面具体指定对应的字段比如http_stat_codehttp_url等。另外还可以辅助使用startswith,endswith来进行更加精准的匹配。content: GET;startswith;http_request_line;
其中http_request_line表示请求头http_request_body表示请求体http_response_line表示响应头http_response_body表示响应体 2、nocase
不区分大小写通常放在content后面 3、dsize
有效载荷的内容的长度基本用法如下
dsize:[!]number; || dsize:minmax;
(1)dsize:100,表示大小等于100
(2)dsize:100 dsize:100 dsize:!100 dize:100200 4、pcre
标准的正则表达式匹配基本语法pcre:/regex/opts; 需要注意两点
1必须使用/进行包裹最后的位置可以设置选项
2通常情况下pcre不能直接单独存在必须依赖于content也就是说必须现有content再有pcre进行更精准的匹配。 二、转码关键字
1、to_md5
2、to_sha
3、url_encode
4、base64_decode
对字段的值进行base64解码并在解码后进行匹配前提知道解码后具体的内容
Buffer content:
http_uriGET /en/somestringdGvzdAonot_base64
Rule:
alert http any any - any any (msg:base64 example; http.url; content: somestring; base64_decode:bytes 8, offset 1,relative; base64_data: content:test; sid:10001; rev:1;)
三、Flow流关键字
1、flowbits 2、flow
如flow:established,to_server;表示目标服务器方向连接已经建立 3、flowint
1基本语法
flowint: name, ,-,,,,,,, ! , value; 号用于赋初始值 - 数学运算 其他 数字比较判断
flowint: name, (isset|isnotset); 用来判断某个变量是否已经初始化
2用法示例
alert http any any $HOME_NET 80 (msg:web服务器出现404状态码; content: 404; http_stat_code; flowint:urlcount , notset; flowint: urlcount, , 1; noalert; sid:561002;)
alert http any any $HOME_NET 80 (msg:web服务器出现404状态码; content: 404; http_stat_code; flowint:urlcount , isset; flowint: urlcount, , 1; noalert; sid:561003;)
alert http any any $HOME_NET 80 (msg:频繁出现404状态码疑似扫描; content: 404; http_stat_code; flowint: urlcount, 5, priority: 2; sid:561004; rev: 2;)
4、strream_size 四、阈值关键字
1、threshold
threshold: type threshold|limit|both,track by_src|by_dst|by_rule|by_both,count N,seconds T
默认建议使用threshold如果设置为limit则会限制警告的数量
track 优先使用by_src,T秒内连续出现N次则触发警告
2、实例
alert http any any $HOME_NET 80 (msg:频繁出现404状态码疑似扫描; content: 404; http_stat_code; threshold:type threshold, track by_src, count 5, seconds 20; classtype: web-url-scan; sid:561004; rev: 3;)