About Snort
Snort是一套开放源代码(OpenSource and free)的网络入侵预防软件(NIPS)与网络入侵检测软件(NIDS)。Snort使用了以侦测签名(signature-based)与通信协议的侦测方法。截至目前为止,Snort的被下载次数已达到数百万次。 Snort被认为是全世界最广泛使用的入侵预防与侦测软件。
* 需要*
Installation
我们需要安装:
- snortAUR
- pulledporkAUR
snort 和 pulledpork 在AUR仓库, 直接用yaourt安装即可, 下载速度可能会很慢, 可以用代理
yaourt -S snort
yaourt -S pulledpork
Configuration
Snort的默认配置文件存放在 /etc/snort/snort.conf
更改监听的网段
ipvar HOME_NET [10.8.0.0/24,192.168.1.0/24]
如果想用 Pulledpork 更新 rules 注释掉
include $RULE_PATH/snort.rules
Pulledpork的默认配置文件存放在 /etc/pulledpork
编辑 /etc/pulledpork/pulledpork.conf, 把需要下载的规则的注释去掉, 并且更改 <oinkcode> 为自己的oinkcode, oinkcode在官网注册后会获得, 通过这个可以获取最新的规则.
Usage
Snort
IDS mode :
systemctl start snort@interface
Inline mode:
//后续..
Pulledpork
命令行运行:
pulledpork.pl -c /etc/pulledpork/pulledpork.conf -Pw
lz /var/tmp/*.gz | egrep '\.rules' | cut -d'/' -f3 | sort -u | perl -lne '/(.*).rules/ && print $1' > rules.`date +%F`
Troubleshoting
Snort error:
ERROR: /etc/snort/snort.conf(253) Could not stat dynamic module path "/usr/lib/snort_dynamicrules": No such file or directory.
SELUTION:
Had to create the default snort.conf directory:
mkdir /usr/lib/snort_dynamicrules
Pulledpork error:
depends on Bytes::Random::Secure
SELUTION:
yaourt -S perl-bytes-random-secure
See also
- Snort Aur : https://aur.archlinux.org/packages/snort/?comments=all
- BPF : https://en.wikipedia.org/wiki/Berkeley_Packet_Filter
- NIDS : https://en.wikipedia.org/wiki/Intrusion_detection_system
- NIPS : https://en.wikipedia.org/wiki/Intrusion_detection_system