查看完整版本: Juniper IDP入侵检测方法——状态签名

笑三少 2007-12-5 22:04

Juniper IDP入侵检测方法——状态签名

[b][font=宋体][size=12pt]运用状态签名的入侵检测[/size][/font][/b][b][font=Arial][size=12pt][/size][/font][/b]
[font=宋体][size=12pt]建立在辨认和匹配攻击签名(样本)方法基础上的入侵检测是简单的。它主要在流量中寻找一个已知被使用或攻击的特定样本。[/size][/font][size=12pt][font=Times New Roman]NIDS[/font][/size][font=宋体][size=12pt]的早期发展是一台非入侵式封包监视器,它被称为[/size][/font][size=12pt][font=Times New Roman]“[/font][/size][font=宋体][size=12pt]嗅探器[/size][/font][size=12pt][font=Times New Roman]”(sniffer)[/font][/size][font=宋体][size=12pt],因为它能[/size][/font][size=12pt][font=Times New Roman]“[/font][/size][font=宋体][size=12pt]嗅出[/size][/font][size=12pt][font=Times New Roman]”[/font][/size][font=宋体][size=12pt]网络中的数据包。入侵检测厂商运用封包监视器的概念去构建系统,完成数据包签名检测。这意味着系统将检测数据包流量中的内容并和数据库中已知攻击签名进行配比。然而,这种简单化的入侵检测有很多缺点,特别是需大量的资源以构建一个大的攻击签名库上,而没有考虑流量是如何被重组、解码、规范化和分析。[/size][/font][size=12pt][/size]
[font=Arial][size=12pt] [/size][/font]
[i][u][font=宋体][size=12pt]网络传输-你看到的并不是你想要的[/size][/font][/u][/i][i][u][font=Arial][size=12pt][/size][/font][/u][/i]
[font=宋体][size=12pt]当信息通过网络传送时,信息被当作数据包分割成具有数字编号的[/size][/font][size=12pt][font=Times New Roman]TCP[/font][/size][font=宋体][size=12pt]分段。在一个理想环境里,信息被按顺序进行传送并且不被丢失(图[/size][/font][size=12pt][font=Times New Roman]3a[/font][/size][font=宋体][size=12pt]所示)。然而不幸的是实际情况并非如此。当一个被实际传送时(图[/size][/font][size=12pt][font=Times New Roman]3b[/font][/size][font=宋体][size=12pt]所示),网络设备如路由器等将以随机的方式(不按顺序)或更小的数据单元(叫作碎片)进行传送。甚至更糟糕的是,由于任何原因,封包可能被丢失。接收系统负责重新组织封包到原传送信息流,并请求重发丢失的封包,该信息被完整表示成应用程序所需的信息。图[/size][/font][size=12pt][font=Times New Roman]3a[/font][/size][font=宋体][size=12pt]和图[/size][/font][size=12pt][font=Times New Roman]3b[/font][/size][font=宋体][size=12pt]只表示了从客户端到服务器的单一信息流;现实是大多数客户机到服务器的通讯包含两个信息流,一个从客户端到服务器,另一个为服务器到客户端。[/size][/font][size=12pt][/size]
[align=center][align=center][font=Arial][size=12pt][/size][/font][/align][/align][font=Arial][size=12pt]
[size=12pt][img]http://junipers.cn/upload_files/86/vyaPa__2007927143133.jpg[/img][/size] [/size][/font]
[font=宋体][size=12pt]为了精确地处理流量,消除数据误译的技术是非常必要的。这些技术包括:[/size][/font][font=Arial][size=12pt][/size][/font]
[size=12pt]·
[/size][font=Arial][size=12pt]IP[/size][/font][font=宋体][size=12pt]碎片整理[/size][/font][font=Arial][size=12pt]—[/size][/font][font=宋体][size=12pt]适当地将封包的碎片结合起来的能力。[/size][/font][font=Arial][size=12pt][/size][/font]
[size=12pt]·
[/size][font=Arial][size=12pt]TCP[/size][/font][font=宋体][size=12pt]重组[/size][/font][font=Arial][size=12pt]—[/size][/font][font=宋体][size=12pt]在去除复制和重叠数据的时候,用正确的次序适当地重组[/size][/font][font=Arial][size=12pt]TCP[/size][/font][font=宋体][size=12pt]片段的能力。[/size][/font][font=Arial][size=12pt][/size][/font]
[size=12pt]·
[/size][font=宋体][size=12pt]流量跟踪[/size][/font][font=Arial][size=12pt]—[/size][/font][font=宋体][size=12pt]可以跟踪流量(客户端到服务器的流量以及服务器到客户端的流量),并且把它们与一个单一的通信会话([/size][/font][font=Arial][size=12pt]communication session[/size][/font][font=宋体][size=12pt])联系起来。[/size][/font][font=Arial][size=12pt][/size][/font]
[size=12pt]·
[/size][font=宋体][size=12pt]规范化[/size][/font][font=Arial][size=12pt]—[/size][/font][font=宋体][size=12pt]从重组的信息中进行分析已经解码的符号和特殊的文字,如果有必要将它们删除。[/size][/font][font=Arial][size=12pt][/size][/font]
[font=Arial][size=12pt] [/size][/font]
[i][u][font=宋体][size=12pt]优化的分析=状态签名[/size][/font][/u][/i][i][u][font=Arial][size=12pt][/size][/font][/u][/i]
[font=宋体][size=12pt]一旦封包在网络上被发送,处理和重组,[/size][/font][size=12pt][font=Times New Roman] [/font][/size][font=宋体][size=12pt]下一步就是在该流量中精确地检测攻击。市场上大多数的[/size][/font][size=12pt][font=Times New Roman]NIDS[/font][/size][font=宋体][size=12pt]使用包签名检测,这就意味着在每一个独立的封包中匹配攻击样本。一些[/size][/font][size=12pt][font=Times New Roman]NIDS[/font][/size][font=宋体][size=12pt]可以作到[/size][/font][size=12pt][font=Times New Roman]IP[/font][/size][font=宋体][size=12pt]碎片重组和[/size][/font][size=12pt][font=Times New Roman]TCP[/font][/size][font=宋体][size=12pt]封装来减少错误。然而,当它们查询样本时,仍然只关注整个顺序化的数据流,这将引入以下两个问题:[/size][/font][size=12pt][/size]
[font=Symbol][size=12pt]¨
[/size][/font][font=宋体][size=12pt]性能非常差,因为要查询整个数据流。[/size][/font][font=Arial][size=12pt][/size][/font]
[font=Symbol][size=12pt]¨
[/size][/font][font=宋体][size=12pt]基于简单的事实,检测的数据越多,匹配不相关数据的可能性越大,因此假阳性时常发生。[/size][/font][font=Arial][size=12pt][/size][/font]
[font=Arial][size=12pt] [/size][/font]
[font=宋体][size=12pt]好消息是已经有了另外一种可以克服包签名检测性能问题缺乏精确性的不足,该方法叫做状态签名[/size][/font][size=12pt][font=Times New Roman]™[/font][/size][font=宋体][size=12pt]检测。其先进的检测机制通过使用状态监控和部分协议异常检测来鉴别攻击样本。结果,状态签名能够充分理解每个数据字节和内容和在传输时的客户机和服务器的状态。换句话说,状态签名只查询能够造成破坏的攻击,极大地提高了性能减小了误报率。[/size][/font][size=12pt][/size]
[font=Arial][size=12pt] [/size][/font]
[font=宋体][size=12pt]实例[/size][/font][font=Arial][size=12pt]3[/size][/font][font=宋体][size=12pt]:检测[/size][/font][font=Arial][size=12pt]SMTP Wiz[/size][/font][font=宋体][size=12pt]攻击[/size][/font][font=Arial][size=12pt][/size][/font]
[font=宋体][size=12pt]该例子描述了[/size][/font][size=12pt][font=Times New Roman]SMTP(Sendmail)’wiz’[/font][/size][font=宋体][size=12pt]攻击和状态签名检测和包签名检测如何对该攻击进行检测。[/size][/font][size=12pt][font=Times New Roman]Wiz[/font][/size][font=宋体][size=12pt]攻击允许攻击者获取[/size][/font][size=12pt][font=Times New Roman]SMTP[/font][/size][font=宋体][size=12pt]服务器上的根访问权限。一旦成功,攻击者可以完全控制被入侵主机,利用它作为平台来发起更多的攻击,偷电子邮件和其他数据以及更深的网络和系统访问权限。当客户端和服务器之间的[/size][/font][size=12pt][font=Times New Roman]sendmail[/font][/size][font=宋体][size=12pt]会话处在“命令模式”([/size][/font][size=12pt][font=Times New Roman]command mode[/font][/size][font=宋体][size=12pt]),攻击者通过向服务器发送“[/size][/font][size=12pt][font=Times New Roman]wiz[/font][/size][font=宋体][size=12pt]”命令来完成。[/size][/font][size=12pt][/size]
[font=Arial][size=12pt] [/size][/font]
[font=宋体][size=12pt]让我们来看一下典型的[/size][/font][size=12pt][font=Times New Roman]SMTP[/font][/size][font=宋体][size=12pt]会话来更深入地理解状态签名检测如何对攻击进行有效地检测。图[/size][/font][size=12pt][font=Times New Roman]4[/font][/size][font=宋体][size=12pt]所示为四个典型的[/size][/font][size=12pt][font=Times New Roman]SMTP[/font][/size][font=宋体][size=12pt]会话阶段:[/size][/font]


[font=宋体][size=12pt]
[/size][/font][size=12pt][img=361,296]http://www.netscreen.net.cn/UpFile/UpAttachment/2007-9/2007928182221.jpg[/img][/size]
[font=Arial][size=12pt] [/size][/font]
[font=Arial][size=12pt]1.
[/size][/font][font=宋体][size=12pt]建立[/size][/font][font=Arial][size=12pt]TCP[/size][/font][font=宋体][size=12pt]连接([/size][/font][font=Arial][size=12pt]3[/size][/font][font=宋体][size=12pt]次握手)[/size][/font][font=Arial][size=12pt][/size][/font]
[font=Arial][size=12pt]2.
[/size][/font][font=宋体][size=12pt]命令模式:[/size][/font][font=Arial][size=12pt][/size][/font]
[font=Arial][size=12pt]a)
[/size][/font][font=宋体][size=12pt]设置发送者[/size][/font][font=Arial][size=12pt](“MAIL FROM”[/size][/font][font=宋体][size=12pt]域[/size][/font][font=Arial][size=12pt])[/size][/font]
[font=Arial][size=12pt]b)
[/size][/font][font=宋体][size=12pt]设置接收者[/size][/font][font=Arial][size=12pt](“RCPT TO”[/size][/font][font=宋体][size=12pt]域[/size][/font][font=Arial][size=12pt])[/size][/font]
[font=Arial][size=12pt]c)
[/size][/font][font=宋体][size=12pt]执行其他命令
[/size][/font][font=Arial][size=12pt][/size][/font]
[font=Arial][size=12pt]3.
[/size][/font][font=宋体][size=12pt]数据模式(电子邮件内容)[/size][/font][font=Arial][size=12pt][/size][/font]
[font=Arial][size=12pt]4.
[/size][/font][font=宋体][size=12pt]关闭[/size][/font][font=Arial][size=12pt]TCP[/size][/font][font=宋体][size=12pt]连接[/size][/font][font=Arial][size=12pt][/size][/font]
[font=Arial][size=12pt] [/size][/font]
[font=宋体][size=12pt]基于包签名检测机制的系统针对样本查看每一个单独的数据包,而不关心通讯的内容和客户端和服务器的状态。在该模式下,任何包含[/size][/font][size=12pt][font=Times New Roman]’wiz’[/font][/size][font=宋体][size=12pt]字符的信息在任何通讯过程中都被检测。这将触发大量的错误警告,这是因为[/size][/font][size=12pt][font=Times New Roman]’wiz’[/font][/size][font=宋体][size=12pt]字符串可以在电子邮件体中(数据模式)或邮件接收列表(命令模式),以及[/size][/font][size=12pt][font=Times New Roman]’wiz’[/font][/size][font=宋体][size=12pt]命里模式(命令模式)中存在。这看起来微不足道,但实际上[/size][/font][size=12pt][font=Times New Roman]’wiz’[/font][/size][font=宋体][size=12pt]在电子邮件中出现非常频繁。实际上几乎它会发生在每个附件超过[/size][/font][size=12pt][font=Times New Roman]100K[/font][/size][font=宋体][size=12pt]的邮件中。因为所有电子邮件使用[/size][/font][size=12pt][font=Times New Roman]’base64’(RFC1421)[/font][/size][font=宋体][size=12pt]进行编码,它用[/size][/font][size=12pt][font=Times New Roman]64[/font][/size][font=宋体][size=12pt]个可打印字符来表示二进制数据[/size][/font][size=12pt][font=Times New Roman](Word[/font][/size][font=宋体][size=12pt],[/size][/font][size=12pt][font=Times New Roman]PowerPoint[/font][/size][font=宋体][size=12pt]和其他应用程序[/size][/font][size=12pt][font=Times New Roman])[/font][/size][font=宋体][size=12pt],这些字符中有六个为[/size][/font][size=12pt][font=Times New Roman]’w’[/font][/size][font=宋体][size=12pt]、[/size][/font][size=12pt][font=Times New Roman]’W’[/font][/size][font=宋体][size=12pt]、[/size][/font][size=12pt][font=Times New Roman]’i’[/font][/size][font=宋体][size=12pt]、[/size][/font][size=12pt][font=Times New Roman]’I’[/font][/size][font=宋体][size=12pt]、[/size][/font][size=12pt][font=Times New Roman]’z’[/font][/size][font=宋体][size=12pt]、[/size][/font][size=12pt][font=Times New Roman]’Z’[/font][/size][font=宋体][size=12pt],因为附件数据是很随机的,[/size][/font][size=12pt][font=Times New Roman]’wiz’[/font][/size][font=宋体][size=12pt]在随机的字符流(每个字符要么大写要么小写)中发生的数学概率为[/size][/font][size=12pt][font=Times New Roman]1[/font][/size][font=宋体][size=12pt]/[/size][/font][size=12pt][font=Times New Roman]32768[/font][/size][font=宋体][size=12pt]([/size][/font][size=12pt][font=Times New Roman]32[/font][/size][font=宋体][size=12pt]*[/size][/font][size=12pt][font=Times New Roman]32[/font][/size][font=宋体][size=12pt]*[/size][/font][size=12pt][font=Times New Roman]32[/font][/size][font=宋体][size=12pt])。另外,[/size][/font][size=12pt][font=Times New Roman]’wiz’[/font][/size][font=宋体][size=12pt]也可以出现在客户端到服务器的邮件中,[/size][/font][size=12pt][email=如[email]thewizard@company.com[/email]][font=宋体][size=10.5pt]如[/size][/font][size=10.5pt][font=Times New Roman]thewizard@company.com[/font][/size][/email][/size][font=宋体][size=12pt]或包含“[/size][/font][size=12pt][font=Times New Roman]wizardry”[/font][/size][font=宋体][size=12pt]或[/size][/font][size=12pt][font=Times New Roman]”Wizened”[/font][/size][font=宋体][size=12pt]等的邮件中,用包签名检测,所有这些实例都会触发报警。[/size][/font][size=12pt][/size]
[font=Arial][size=12pt] [/size][/font]
[font=宋体][size=12pt]使用状态签名的系统只检测客户端到服务器的[/size][/font][size=12pt][font=Times New Roman]SMTP[/font][/size][font=宋体][size=12pt]数据流在命令模式下的[/size][/font][size=12pt][font=Times New Roman]’wiz’[/font][/size][font=宋体][size=12pt]样本。此外,状态签名忽略邮件地址,因为它们处在攻击无法深透的区域。状态签名更具易受攻击的客户端到服务器的会话来进行样本比较,而不是武断地检测整个会话的字符串。结果,你可以花更少的时间调整系统和研究报警,并且通过报警的真实性来提高自信。[/size][/font]
页: [1]
查看完整版本: Juniper IDP入侵检测方法——状态签名