本文结合了其他博主,介绍了在CentOS7下安装Snort时出现的问题,如何进行比较有效的处理。在文末,我也将补上引用指令的各个博主的原文链接。
1.安装各种依赖包
[root@vm_machine ~]# yum -y install gcc flex bison zlib zlib-devel libpcap libpcap-devel pcre pcre-devel libdnet libdnet-devel tcpdump glibc-headers gcc-c++ autoconf
[root@vm_machine ~]# yum -y install epel-release
[root@vm_machine ~]# yum -y install nghttp2
2.安装daq
我们可以到snort的官网先看看,哪些版本我们可以下载。(https://www.snort.org/downloads)
wget是从网上下载内容到本地的一个指令,会下载到当前目录。(ps:如果大家觉得在虚拟机里使用wget从官网下载比较慢的话,可以在宿主机上通过某些第三方下载工具,加快下载的速度。当下载完毕后,可以把安装包复制、粘贴到虚拟机里,记住不要直接拖拽,使用cv大法就好。)
[root@vm_machine ~]# wget https://www.snort.org/downloads/snort/daq-2.0.7.tar.gz
[root@vm_machine ~]# tar -xf daq-2.0.7.tar.gz
[root@vm_machine ~]# cd daq-2.0.7/
[root@vm_machine daq-2.0.7]# ./configure
[root@vm_machine daq-2.0.7]# make && make install
此时可能会报很多错,如果出现:
***CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/sh /root/daq-2.0.7/missing aclocal-1.15 -I m4
/root/daq-2.0.7/missing:行81: aclocal-1.15: 未找到命令
WARNING: ‘aclocal-1.15’ is missing on your system.
You should only need it if you modified ‘acinclude.m4’ or
‘configure.ac’ or m4 files included by ‘configure.ac’.
The ‘aclocal’ program is part of the GNU Automake package:
http://www.gnu.org/software/automake
It also requires GNU Autoconf, GNU m4 and Perl in order to run:
http://www.gnu.org/software/autoconf
http://www.gnu.org/software/m4/
http://www.perl.org/
那么我们可以先执行 yum install -y libtool
,再执行 autoreconf -ivf
。如果终端提示,未能找到对应的软件包,那么我们可以执行 yum upgrade
,更新一波软件源,再执行上面的指令。
3.安装snort
[root@vm_machine ~]# wget https://www.snort.org/downloads/snort/snort-2.9.16.tar.gz
[root@vm_machine ~]# tar -xf snort-2.9.16.tar.gz
[root@vm_machine ~]# cd snort-2.9.16/
[root@vm_machine snort-2.9.16]# ./configure
[root@vm_machine snort-2.9.16]# make && sudo make install
如果出现这个错误:
ERROR! LuaJIT library not found. Go get it from http://www.luajit.org/ (or)
Try compiling without openAppId using ‘–disable-open-appid’
configure: error: “Fatal!”
那我们就执行# ./configure --disable-open-appid
,这样就行了。
4.安装规则
[root@vm_machine ~]# mkdir -p /etc/snort/rules
[root@vm_machine ~]# wget https://www.snort.org/downloads/community/community-rules.tar.gz
[root@vm_machine ~]# tar -xf community-rules.tar.gz -C /etc/snort/rules
这样应该就能完成Snort的安装了。
最后,附上我参考的几个博主的链接地址:
原文链接:https://blog.csdn.net/xiaopan233/article/details/83478356
原文链接:https://www.cnblogs.com/Dev0ps/p/9856905.html
原文链接:https://blog.csdn.net/rdgfdd/article/details/83420811