我正在尝试识别networking上的用户问题。 ntop识别高stream量和高连接用户,但恶意软件并不总是需要高带宽真的搞砸了。 所以我试图用snort进行离线分析(不想让路由器通过内联分析20 Mbps的stream量)。 显然,snort为此提供了-r选项,但是我无法运行分析。
分析系统是gentoo,amd64,万一有什么区别。 我已经使用oinkmaster下载最新的IDS签名。 但是,当我尝试运行snort,我不断收到以下错误:
% snort -V ,,_ -*> Snort! <*- o" )~ Version 2.9.0.3 IPv6 GRE (Build 98) x86_64-linux '''' By Martin Roesch & The Snort Team: http://www.snort.org/snort/snort-team Copyright (C) 1998-2010 Sourcefire, Inc., et al. Using libpcap version 1.1.1 Using PCRE version: 8.11 2010-12-10 Using ZLIB version: 1.2.5 %> snort -v -r jan21-for-snort.cap -c /etc/snort/snort.conf -l ~/snortlog/
(剪断)
273 out of 1024 flowbits in use. [ Port Based Pattern Matching Memory ] +- [ Aho-Corasick Summary ] ------------------------------------- | Storage Format : Full-Q | Finite Automaton : DFA | Alphabet Size : 256 Chars | Sizeof State : Variable (1,2,4 bytes) | Instances : 314 | 1 byte states : 304 | 2 byte states : 10 | 4 byte states : 0 | Characters : 69371 | States : 58631 | Transitions : 3471623 | State Density : 23.1% | Patterns : 3020 | Match States : 2934 | Memory (MB) : 29.66 | Patterns : 0.36 | Match Lists : 0.77 | DFA | 1 byte states : 1.37 | 2 byte states : 26.59 | 4 byte states : 0.00 +---------------------------------------------------------------- [ Number of patterns truncated to 20 bytes: 563 ] ERROR: Can't find pcap DAQ! Fatal Error, Quitting..
net-libs / daq被安装,但我甚至不想捕获stream量,我只想处理捕获文件。
我应该设置/取消设置哪些configuration选项,以便进行离线分析而不是实时捕获?
我对Gentoo并不熟悉,但可以尝试使用“–daq-list”标志来查看Snort看到的数据(如果有的话)。
例如:
# snort --daq-list Available DAQ modules: pcap(v3): readback live multi unpriv ipfw(v2): live inline multi unpriv dump(v1): readback live inline multi unpriv afpacket(v4): live inline multi unpriv
然后使用“–daq-dir”标志将Snort指向包含DAQ库的目录。
snort -v -r jan21-for-snort.cap -c /etc/snort/snort.conf -l ~/snortlog/ --daq-dir /usr/local/lib/daq/
我不完全确定是什么修复,但它可能与指定编译snort的USE标志有关。 这是在以下POST中报告我认为也包含一个临时解决scheme。
我会build议使用另一个发行版/ Windows,或者去Gentoo论坛询问有关Snort的构build问题。
我总是这样做:
我把它放到一个bash脚本使其可执行(chmod + x script.sh)并执行它:
#!/usr/bin/env bash modprobe dummy lsmod | grep dummy ip link set name eth10 dev dummy0 ip link show eth10 ifconfig eth10 hw ether 00:22:22:ff:ff:ff ip link show eth10 ip addr add 192.168.100.199/24 brd + dev eth10 label eth10:0 ifconfig eth10 up ifconfig eth10 promisc
获得tcpreplay然后做:
sudo tcpreplay -i eth10 -T nano mypcap.pcap
让snort嗅探:
sudo snort -i eth10 -u snort -g snort -c /etc/snort/snort.conf