[root@monster suricata]# suricata --build-info
This is Suricata version 3.0.1 RELEASE
Features: PCAP_SET_BUFF LIBPCAP_VERSION_MAJOR=1 PF_RING AF_PACKET HAVE_PACKET_FANOUT HAVE_HTP_URI_NORMALIZE_HOOK HAVE_NSS TLS
SIMD support: SSE_4_2 SSE_4_1 SSE_3
Atomic intrisics: 1 2 4 8 16 byte(s)
64-bits, Little-endian architecture
GCC version 4.4.7 20120313 (Red Hat 4.4.7-16), C version 199901
compiled with _FORTIFY_SOURCE=0
L1 cache line size (CLS)=64
thread local storage method: __thread
compiled with LibHTP v0.5.19, linked against LibHTP v0.5.19
Suricata Configuration:
AF_PACKET support: yes
PF_RING support: yes //PF_RING支持
NFQueue support: no
NFLOG support: no
IPFW support: no
Netmap support: no
DAG enabled: no
Napatech enabled: no
Unix socket enabled: no
Detection enabled: yes
libnss support: yes
libnspr support: yes
libjansson support: no
hiredis support: no
Prelude support: no
PCRE jit: no
LUA support: no
libluajit: no
libgeoip: no
Non-bundled htp: no
Old barnyard2 support: no
CUDA enabled: no
Hyperscan support: no
Suricatasc install: yes
Unit tests enabled: no
Debug output enabled: no
Debug validation enabled: no
Profiling enabled: no
Profiling locks enabled: no
Coccinelle / spatch: no
Generic build parameters:
Installation prefix: /usr
Configuration directory: /etc/suricata/
Log directory: /var/log/suricata/
--prefix /usr
--sysconfdir /etc
--localstatedir /var
Host: x86_64-unknown-linux-gnu
Compiler: gcc (exec name) / gcc (real)
GCC Protect enabled: no
GCC march native enabled: yes
GCC Profile enabled: no
Position Independent Executable enabled: no
CFLAGS -g -O2 -march=native
PCAP_CFLAGS -I/usr/local/include
SECCFLAGS
$ sudo yum install wget libpcap-devel libnet-devel pcre-devel gcc-c++ automake autoconf libtool make libyaml-devel zlib-devel file-devel jansson-devel nss-devel
安装过程中,若出现类似 No package *** available.
,则自行wget相应安装包进行安装。
例如:笔者缺少libnet-devel和jansson-devel ,可以到sourceforge或github进行查找安装。
git clone https://github.com/inliniac/suricata.git
cd suricata
sh autogen.sh
./configure --sysconfdir=/etc --localstatedir=/var
若需加入PF_RING支持,则添加
--enable-pfring --with-libpfring-includes=/usr/local/pfring/include --with-libpfring-libraries=/usr/local/pfring/lib
类似地,要加入PCRE-jit支持,则添加
--enable-pcre-jit --with-libpcre-includes=/usr/local/include
--with-libpcre-libraries=/usr/local/lib
综上笔者使用的编译命令:
./configure --sysconfdir=/etc --localstatedir=/var --enable-pfring --with-libpfring-includes=/usr/local/pfring/include --with-libpfring-libraries=/usr/local/pfring/lib
make
sudo make install
sudo ldconfig
Suricata源代码随带默认的配置文件,使用命令sudo make install-conf
,可进行安装。
正如你所知,要是没有IDS规则集,Suricata毫无用处。颇为方便的是,Makefile随带IDS规则安装选项。想安装IDS规则,运行下面这个命令即可。
sudo make install-rules
上述规则安装命令会从EmergingThreats.net(https://www.bro.org)安装可用的社区规则集的最新快照,并将它们存储在/etc/suricata/rules下。
suricata -c /etc/suricata/suricata.yaml -r 0.pcap -l .