大佬教程收集整理的这篇文章主要介绍了linux – 如何在snort警报上运行shell脚本?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我在Seclists上找到了一个example,它使用syslog-ng来运行sHell脚本,但它必须是旧版本的syslog-ng,因为我在重新启动syslog-ng时遇到了关于语句被弃用的错误.
我对syslog-ng过滤器了解不多,所以要对它进行更多的研究,因为它看起来很有希望,但我想在这里提出一个问题,以防有更好的方法.当snort警报通过我的snort盒的SPAN端口时,运行sHell脚本的好方法是什么?
我在这里使用了一些信息:http://www.mad-hacking.net/documentation/linux/reliability/logging/email-notification.xml
/etc/snort/snort.conf - configure snort to log to syslog ------------------------------------------------------------ # syslog output alert_syslog: LOG_LOCAL6 LOG_ALERT /etc/syslog/syslog-ng.conf - setup filters/desTinations for alerts ------------------------------------------------------------ # snort filter - this only pays attention to syslog messages sent by the 'snort' program filter f_snort { facility(local6) and match("snort" value ("PROGRAM")); }; # optionally,this would send the snort message to a remote host running a syslog listener. # I was running tcpdump to debug the whole setup so I use UDP protocol here so the # message is just blasted out over the ether without needing to actually have a syslog # listener setup anywhere desTination d_net { udp("10.10.10.1" port(514) log_fifo_size(1000) template(t_snort)); }; # this one sends the syslog message consisTing of priority,time_in_seconds,host and syslog meesage. # desTination d_prog { program("/root/bin/snort_script" template("<$PRI>$UNIXTIME $HOST $MSGONLY\n") ); }; # ..or use a pipe if you don't want syslog running scripts desTination d_prog_pipe { pipe("/root/bin/syslog-pipe" template("<$PRI>$DATE $HOST $MSGONLY\n") ); }; # finally,log the message out the snort parsing mechanism log { source(s_src); filter(f_snort); desTination(d_prog); #desTination(d_net); }; /root/bin/snort_script ------------------------------------------------------------ #!/bin/bash while read line; do echo "$line" >> /tmp/snort.log done
以上是大佬教程为你收集整理的linux – 如何在snort警报上运行shell脚本?全部内容,希望文章能够帮你解决linux – 如何在snort警报上运行shell脚本?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。