在/var/log/消息中,我将获得IDS的输出。就像这样:
Feb 4 13:24:17 test1-1 snort[4535]: [122:1:1] (portscan) TCP Portscan [Classification: Attempted Information Leak] [Priority: 2] {PROTO:255} 10.0.0.1 -> 10.0.0.2我所做的是,使用 swatch 监视/var/log/messenges文件,并将日志输出发送到python脚本,这将通知一些智能手机管理人员。
所以我想要一个更详细的输出给经理。我使用的设置:
watchfor /.*(.*test1-1.*TCP Portscan.*).*/
exec command /usr/local/bin/send_msg "user" "$1"产出如下:
test1-1 snort[4535]: [122:1:1] (portscan) TCP Portscan但是我想要这样的,ip地址总是随机的:
test1-1 TCP Postscan 10.0.0.1 -> 10.0.0.2一个人怎么能这么做?用正则表达式?
亲切关怀
从你友好的系统管理员那里
发布于 2015-02-04 16:28:53
这将捕获有趣的部分:
watchfor /(test1-1).*(TCP Portscan).*} (.*)/
exec command /usr/local/bin/send_msg "user" "$1 $2 $3"https://stackoverflow.com/questions/28326285
复制相似问题