简体   繁体   English

从snort中读取警报日志

[英]Read the alert log from snort

I have a new instance with snort setup. 我有一个新的snort设置实例。 When I tried to look at the alert log I noticed that the directory doesn't have a /var/log/snort/alert file. 当我试着查看警报日志时,我注意到该目录没有/ var / log / snort / alert文件。 I tried to touch this file and to chmod to give read and write access to my snort user but I still have no alert (even if I create a rule to catch all the calls and put them in the log them as errors) 我试图触摸这个文件并chmod给我的snort用户提供读写访问权限,但我仍然没有警报(即使我创建了一条规则来捕获所有的调用并将它们作为错误记录在日志中)

alert ip any any -> any any ( msg: "ICMP packet detected!"; sid: 1; )

Any idea if I am missing something. 不知道我是否遗漏了什么。

By the way here is the command I run for Snort: 顺便说一下,这是我为Snort运行的命令:

sudo /usr/sbin/snort -m 027 -D -d -l /var/log/snort -u snort -g snort -c /etc/snort/snort.conf -S HOME_NET=[192.168.0.0/16] -i eth0

Am I missing something? 我错过了什么吗?

If you want the alerts to go to syslog you must specify this in the snort.conf file (/etc/snort/snort.conf in your case) with the output keyword. 如果要将警报发送到syslog,则必须使用output关键字在snort.conf文件(在您的情况下为/etc/snort/snort.conf)中指定。 You need to add the keyword "output" and then the name "alert_syslog", and then the options: 您需要添加关键字“output”,然后添加名称“alert_syslog”,然后选项:

output <name>: <options>

So something like the following should be in your snort.conf file: 因此,您的snort.conf文件中应包含以下内容:

output alert_syslog: log_alert

Read more about the options that can be used with alert_syslog here 在此处阅读有关可与alert_syslog一起使用的选项的更多信息

You don't need to create any file.snort will create it when something matches your rule and it generates an alert.To do this start your snort in a full alert mode to log all alerts by something like this 您不需要创建任何file.snort将在符合您的规则的情况下创建它并生成警报。要执行此操作,请在完全警报模式下启动snort以通过此类事件记录所有警报

‫‪snort‬‬ ‫‪-dev‬‬ ‫‪-i‬‬ ‫‪wlan0‬‬ ‫‪-c‬‬ ‫‪/etc/snort/snort.conf‬‬ ‫‪-l‬‬ ‫‪/var/log/snort/‬‬ ‫‪-A‬‬ ‫‪full‬‬

Then if you have Linux you can go to the path ‫‪‬‬ ‫‪cd /var/log/snort/‬‬ and see your logs by this command: cat alert | grep -i‬‬ ‬‬‫‪‫‪detected 然后,如果您有Linux,则可以转到路径‫‪‬‬ ‫‪cd /var/log/snort/‬‬并通过此命令查看日志: cat alert | grep -i‬‬ ‬‬‫‪‫‪detected cat alert | grep -i‬‬ ‬‬‫‪‫‪detected

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM