Snort 命令参数详解

转载自《Snort 命令参数详解》

用法:

       snort -[options]

选项:

-A      设置报警模式,alert = full/fast/none/unsock,详解上一篇snort简介。

-b    用二进制文件保存网络数据包,以应付高吞吐量的网络。

-B    将IP地址信息抹掉,去隐私化。

-c    使用配置文件,这会使得snort进入IDS模式,并从中读取运行的配置信息。

-d    显示包的应用层数据。

-D    以后台进程运行snort。如无指定,Alerts将写到/var/log/snort/alert。

-e    显示数据链路层的信息。

-E    保存报警日志为windows事件日志。

-f    激活PCAP行缓冲(line buffering)。

-F  指定BPF过滤器。

-g  初始化Snort后以组ID(group ID)运行。

-G   为事件生成设置一个基础事件id值。

-h   设置本地网络为hn,如192.168.1.0/24-i <if> 设置网络接口为<if>。可以用-W选项查询网络接口列表,然后用接口序号index指定接口。如-i 2

-I    报警时附加上接口信息。

 -J   当以in-line模式运行时,这个选项将只捕获端口的报文。

-k   为all,noip,notcp,noudp,noicmp,or none设置校验和模式。

-K     设置保存文件的格式:pcap,ascii, none。pcap是默认格式,同于-b选项的格式。ascii是老的模式格式。none则关闭数据包记录。

-l    设置数据包文件存放目录。默认目录是/var/log/snort.

-L    设置二进制输出文件的文件名为-M    当以非后台模式daemon运行时,保存信息到syslog。

-m  设置snort输出文件的权限位。

-n  出来个报文后终止程序。

-N    关闭保存日志包功能。

-o    改变应用规则的顺序。从Alert-->Pass-->Log顺序改为Pass-->Alert-->Log,避免了设置大量BPF命令行参数来过滤alert规则。

-O    在ASCII数据包捕获模式下混淆IP地址。

-p    关闭混杂模式。

-P    设置snaplen,默认值是当前网卡的MTU。

-q    安静模式,不显示标志和状态报告。

-Q    当在线(in-line)运行时,从iptables/IPQ中读取数据包。

-r    从pcap格式的文件中读取数据包。

-R    为snort pidfile增加下标。

-s    使snort把报警消息发送到syslog,默认的设备是LOG_AUTHPRIV和LOG_ALERT。可以修改snort.conf文件修改其配置。

-S    为变量n设置值为v。

-t    初始化后将Snort的根目录改变为-T    以自检测模式启动Snort。

-u    初始化后改变Snort的UID。

-U    在时间戳上用UTC时间代替本地时间。

-v    从网络上读出数据包然后显示在你的控制台上。

-V    查看版本号并退出。

-w    如果运行在802.11网中,显示管理帧。

-W    *WIN32 ONLY*列出可以网络接口。其中的Index或Device Name都可以用到-i选项中。

- X    显示包括数据链路层的原始数据包。

-y    在时间戳里显示年份。

-Z    设置性能监视器(perfmon)路径。

-?   帮助信息。

 

 

长参数选项

 --logid <0xid>                 Same as -G

    --perfmon-file           Same as -Z

    --pid-path               Specify the path for the Snort PID file

    --snaplen                Same as -P

    --help                         Same as -?

    --dynamic-engine-lib 
            指定动态监测引擎文件

    --dynamic-detection-lib 
            指定一个动态规则库文件

    --dynamic-detection-lib-dir 
            指定所有动态规则库路径

    --dump-dynamic-rules 
            为所有加载的规则库创建根规则文件

    --dynamic-preprocessor-lib 
            指定动态预处理库文件

    --dynamic-preprocessor-lib-dir 
            指定动态预处理库路径

    --dump-dynamic-preproc-genmsg 
            为所有加载的预处理库生成gen-msg.map文件到路径.

    --alert-before-pass
            在pass之前处理alert, drop, sdrop, or reject. 默认是pass before alert, drop, etc.

    --treat-drop-as-alert
            Converts drop, and reject rules into alert rules during startup. sdrop rules are not loaded.将drop处理为alert。

    --process-all-events
            Process all triggered events in group order, per Rule Ordering configuration.  Default stops after first group.

    --pid-path 
            Specify the path for Snort's PID file. 为SnortPID文件指定路径。

    --create-pidfile
            Create PID file, even when not in Daemon mode. 创建PID文件。

    --enable-inline-test
            Runs snort in "inline test mode". This option cannot be used with -Q. 在线测试模式。

 

 

[*][FILTERS]:过滤器选项

过滤器选项为标准的BPF格式。即,同tcpdump的过滤器表达式一致。(BPF:http://zh.wikipedia.org/wiki/BPF)

 

你可能感兴趣的:(Snort 命令参数详解)