1.5 Packet Acquisition

Snort 2.9 引入 DAQ 代替直接调用 libpcap .

有两种网卡特性会影响 Snort :

”Large Receive Offload” (LRO) and ”Generic Receive Offload” (GRO)

Snort 建议关闭这两项 ,对于linux系统 执行以下命令行 :

$ ethtool -K eth1 gro off
$ ethtool -K eth1 lro off

1.5.1 Configuration

假设我们没有禁用 static modules 或者改变默认的 DAQ 类型, 我们可以像以前一样使用 interface 运行Snort 中 readback 或者 sniffing. 当然, 也可以通过以下设置选择和配置 DAQ :

必须通过配置文件或者命令行指定好所需要的参数, 否则 -Q 会强制执行 inline, -r 会强制执行 read-file, mode默认为passive.

-省略-

1.5.2 pcap

pcap 是默认的 DAQ. snort 运行任何 w/o DAQ 命令, 都是通过操作 pcap.以下命令是等价的 :

./snort -i <device>
./snort -r <file>
./snort --daq pcap --daq-mode passive -i <device>
./snort --daq pcap --daq-mode read-file -r <file>

可以指定pcap buffer_size :

./snort --daq pcap --daq-var buffer_size=<#bytes>

pcap DAQ 不记录过滤的数据包.

1.5.3 AFPACKET

afpacket 函数类似与 memory mapped pacp DAQ 但是不需要外部依赖库 :

./snort --daq afpacket -i <device>
[--daq-var buffer_size_mb=<#MB>]
[--daq-var debug]

如果在 inline mode 中运行 afpacket, 必须设置一个或多个接口对(interface pairs), 格式如下 :

eth0:eth1

或者:

eth0:eth1::eth2:eth3

afpacket DAQ 默认分配128MB的包内存(packet memory), 可以通过以下配置修改 :

--daq-var buffer_size_mb=<#MB>

注意, 总的内存分配量比这个高, 约165.5MB(较128MB)

1.5.4 NFQ

NFQ 是新的改良的抓包(iptables packets)方式 :

关于 iptables

https://wiki.archlinux.org/index.php/Iptables_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)

1.5.5 IPQ

IPQ 是旧的抓包(iptables packets)方式. pre-2.9 可以通过以下命令在build时启用 :

./configure --enable-inline / -DGIDS

通过一下设置启用 :

1.5.6 IPFW

BSD系统可以用IPFW. pre-2.9 可以通过以下命令在build时启用 :

./configure --enable-ipfw / -DGIDS -DIPFW

以下这条命令作废 :

./snort -J <port#>

改为以下命令 :

./snort --daq ipfw [--daq-var port=<port>]
<port> ::= 1..65535; default is 8000

IPFW 只支持ip4 流量

1.5.7 Dump

在 snort 2.9 版本中 dump DAQ 允许尝试多种inline模式特性, 例如 injection 和 normalization.

./snort -i <device> --daq dump
./snort -r <pcap> --daq dump

默认会生成一个文件名为inline-out.pcap的文件, 包括所有snort捕获和生成的包. 也可以自定义名字 :

./snort --daq dump --daq-var file=<name>

因为dump是通过调用pcap daq. 因此也没有计数过滤的包.

注意 dump DAQ 的inline mode 不是真正的 inline mode.此外, 在其他模式中需要用到 pcap DAQ :

./snort -r <pcap> -Q --daq dump --daq-var load-mode=read-file
./snort -i <device> -Q --daq dump --daq-var load-mode=passive

1.5.8 Statistics Changes

The Packet Wire Totals and Action Stats sections of Snort’s output include additional fields:

Filtered count of packets filtered out and not handed to Snort for analysis.

Injected packets Snort generated and sent, e.g. TCP resets.

Allow packets Snort analyzed and did not take action on.

Block packets Snort did not forward, e.g. due to a block rule.

Replace packets Snort modified.

Whitelist packets that caused Snort to allow a flow to pass w/o inspection by any analysis program.

Blacklist packets that caused Snort to block a flow from passing.

Ignore packets that caused Snort to allow a flow to pass w/o inspection by this instance of Snort.

The action stats show ”blocked” packets instead of ”dropped” packets to avoid confusion between dropped packets (those Snort didn’t actually see) and blocked packets (those Snort did not allow to pass).




Snort - manual 笔记(二)的更多相关文章

  1. Snort - manual 笔记(一)

    Chapter 1 Snort Overview This manual is based on Writing Snort Rules by Martin Roesch and further wo ...

  2. Snort - manual 笔记(五)

    1.9 Miscellaneous 1.9.1 Running Snort as a Daemon 如果你想让Snort作为守护程序运行,你可以在最后加上 -D 选项.清注意如果你想通过发送一个 SI ...

  3. Snort - manual 笔记(四)

    1.7 Basic Output Snort可以做很多任务, 并且在任务完成后输出很多有用的统计信息. 一些不用说明就可以看懂, 其他的总结在这里, 不过只是一些基本的 1.7.1 Timing St ...

  4. Snort - manual 笔记(三)

    1.6 Reading pcap files Snort 不仅可以监听interface, 还可以读取和分析已经捕获的数据包. 1.6.1 Command line arguments 下面的命令都可 ...

  5. 《CMake实践》笔记二:INSTALL/CMAKE_INSTALL_PREFIX

    <CMake实践>笔记一:PROJECT/MESSAGE/ADD_EXECUTABLE <CMake实践>笔记二:INSTALL/CMAKE_INSTALL_PREFIX &l ...

  6. jQuery源码笔记(二):定义了一些变量和函数 jQuery = function(){}

    笔记(二)也分为三部分: 一. 介绍: 注释说明:v2.0.3版本.Sizzle选择器.MIT软件许可注释中的#的信息索引.查询地址(英文版)匿名函数自执行:window参数及undefined参数意 ...

  7. Mastering Web Application Development with AngularJS 读书笔记(二)

    第一章笔记 (二) 一.scopes的层级和事件系统(the eventing system) 在层级中管理的scopes可以被用做事件总线.AngularJS 允许我们去传播已经命名的事件用一种有效 ...

  8. Python 学习笔记二

    笔记二 :print 以及基本文件操作 笔记一已取消置顶链接地址 http://www.cnblogs.com/dzzy/p/5140899.html 暑假只是快速过了一遍python ,现在起开始仔 ...

  9. WPF的Binding学习笔记(二)

    原文: http://www.cnblogs.com/pasoraku/archive/2012/10/25/2738428.htmlWPF的Binding学习笔记(二) 上次学了点点Binding的 ...

随机推荐

  1. CGContext 的一些工具方法

    /* *设置虚线 *param context CGContext *param context CGContext *param lineDashLengths 如: const CGFloat l ...

  2. SupportV7包中 SwipeRefreshLayout 修改下拉控件的距离

    //修改下拉距离 ViewTreeObserver vto = mCategoryResults.mSwipeRefreshLayout.getViewTreeObserver(); vto.addO ...

  3. Guardian of Decency(二分图)

    Guardian of Decency Time Limit:3000MS     Memory Limit:0KB     64bit IO Format:%lld & %llu Submi ...

  4. ListView具有多种item布局——实现微信对话列

    这篇文章的效果也是大家常见的,各种通讯应用的对话列表都是这种方式,像微信.whatsapp.易信.米聊等.我们这篇文章也权当为回忆,形成简单的笔记.这篇文章参考了2009年Google IO中的< ...

  5. SNF开发平台WinForm之一-开发-单表表格编辑管理页面-SNF快速开发平台3.3-Spring.Net.Framework

    1.1运行效果: 1.2开发实现: 1.2.1          首先在数据库中创建需要开发的数据表,在代码生成器中进行配置连接数据库. 代码生成器的Config.xml文件配置如下节点: 1.2.2 ...

  6. C#基础总结之八面向对象知识点总结-继承与多态-接口

    .方法深入讲解(返回值,形参与实参) 方法 public int getName(int i,int j) { int sum = i + j; return sum; } .利用泛型存储对象数据 . ...

  7. android 应用层性能优化方案

    1.避免创建不必要的类对象 2.如果方法用不到成员变量,可以把方法声明为static,新能会提升15%到20% 3.避免使用getter和setter存取Filed,可以吧Field声明为public ...

  8. ruby -- 问题解决(一)无法连接mysql数据库

     >rails g controller home index  运行该命令时无法连接mysql 先下载配置文件:mysql-connector-c-noinstall-6.0.2-win32. ...

  9. Keypress – 超强大!捕获键盘输入的 JavaScript 库

    Keypress 是一个强大的 JavaScript 库,用于捕获键盘输入.这是一个有非常特殊的功能的输入捕获库,它是很容易掌握和使用,并且不依赖第三方库.在网站开发中,经常会碰到需要处理键盘输入的场 ...

  10. C中extern的用法

    /*********************************************************************** INPUT3.C -- Input data pars ...