【发布时间】:2012-08-19 01:21:11
【问题描述】:
我需要一些帮助来为 failregex 创建一个正则表达式,以从该日志中查找和禁止源 ip(例如 SRC=192.168.0.1 并禁止 IP 192.168.0.1):
[ATT] 嫌疑人:IN=eth0 OUT= MAC=xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx SRC=192.168.0.1 DST=192.168.0.100 LEN=37 TOS=0x00 PREC=0x00 TTL=13 ID=56037 PROTO=TCP SPT=21 DPT=35 LEN=60
fail2ban 中的示例 正则表达式
^%(__prefix_line)sFailed (?:password|publickey) for .* from [HOST](?: 端口\d*)?(?: ssh\d*)?$
搜索:
8 月 5 日 11:11:11 igs sshd[28071]:无效用户的密码失败 来自 192.168.0.100 端口 1234 ssh2 的用户名
提前致谢
【问题讨论】: