检测规则
Sigma 过滤条件
内网地址
匹配 RFC 1918 私有 IPv4 地址:10.0.0.0/8、172.16.0.0/12、192.168.0.0/16。
filter_private_ip:
process.cmd_line|re: '(^|[^0-9.])(10\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}|172\.(1[6-9]|2[0-9]|3[01])\.[0-9]{1,3}\.[0-9]{1,3}|192\.168\.[0-9]{1,3}\.[0-9]{1,3})([^0-9.]|$)'
condition: selection and not filter_private_ip
| 正则部分 | 含义 |
|---|---|
(^|[^0-9.]) | 左侧为字符串开头,或非数字、非点号字符 |
10\. / 192\.168\. | 固定网段前缀,\. 表示点号 |
172\.(1[6-9]|2[0-9]|3[01]) | 匹配 172.16~172.31 |
[0-9]{1,3} | 1~3 位数字 |
([^0-9.]|$) | 右侧为非数字、非点号字符,或字符串结尾 |
(...) / | | 分组 / 或 |
| 示例 | 是否匹配 |
|---|---|
ping 192.168.1.1 | 是 |
curl http://172.31.1.2/test | 是 |
ping 172.32.1.2 | 否 |
ping 192.168.1.1234 | 否 |
不校验八位组是否在 0~255,例如 10.999.1.1 也会匹配。