Snort 命令参数详解

snort -[options] <filters>

 

选项:

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

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

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

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

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

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

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

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

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

-F <bpf> 指定BPF过滤器。

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

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

-h <hn>  设置本地网络为hn,如192.168.1.0/24。

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

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

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

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

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

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

-L <fn>   设置二进制输出文件的文件名为<fn>。

-M    当以非后台模式daemon运行时,保存信息到syslog。

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

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

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

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

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

-p    关闭混杂模式。

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

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

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

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

-R <name>   为snort pidfile增加下标。

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

-S <n=v>   为变量n设置值为v。

-t <chroot>   初始化后将Snort的根目录改变为<chroot>。

-T    以自检测模式启动Snort。

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

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

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

-V    查看版本号并退出。

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

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

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

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

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

-?   帮助信息。

 

长参数选项

 --logid <0xid>                 Same as -G

--perfmon-file <file>          Same as -Z

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

--snaplen <snap>               Same as -P

--help                         Same as -?

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

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

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

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

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

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

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

--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 <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

 

 

 转载自:

https://blog.csdn.net/jack237/article/details/6899465

 

 

 

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值