我從來源安裝了 snort-2.9.7,並作為 IDS 啟動:
% snort -devQ -A console -c /etc/snort/snort.conf -i eth0:eth1
Enabling inline operation
Running in IDS mode
...
設定檔非常簡單:
#
var RULE_PATH rules
# Set up the external network addresses. Leave as "any" in most situations
ipvar EXTERNAL_NET any
# Setup the network addresses you are protecting
ipvar HOME_NET [10.10.10.0/24]
config daq: afpacket
config daq_mode: inline
config policy_mode:inline
include $RULE_PATH/icmp.rules
icmp.rules 中的規則也很簡單,用於測試目的:
block icmp 10.10.10.2 any <> 10.10.10.1 any (msg:"Blocking ICMP Packet from 10.10.10.2"; sid:1000001; rev:1;)
在執行 Snort 的主機上,介面 eth0 的位址為 10.10.10.1,但當我從另一台主機發送 ping 10.10.10.1 時,Snort 不會丟棄 icmp 封包,並且會產生 icmp 回覆:
WARNING: No preprocessors configured for policy 0.
02/27-15:04:40.623763 [Drop] [**] [1:1000001:1] Blocking ICMP Packet from 10.10.10.2 [**] [Priority: 0] {ICMP} 10.10.10.2 -> 10.10.10.1
警告是什麼意思?難道我做錯了什麼?