Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3286512
  • 博文数量: 266
  • 博客积分: 3081
  • 博客等级: 中校
  • 技术积分: 2640
  • 用 户 组: 普通用户
  • 注册时间: 2005-07-04 10:35
个人简介

没什么好介绍的!穷屌丝一个~

文章分类

全部博文(266)

文章存档

2021年(3)

2020年(1)

2019年(2)

2016年(5)

2015年(1)

2014年(1)

2011年(9)

2010年(16)

2009年(31)

2008年(58)

2007年(111)

2006年(2)

2005年(26)

我的朋友

分类: LINUX

2007-06-02 23:07:35



2.string

iptables -I FORWARD -m string --string "sex" --algo [bm|kmp] -j DROP

谁能告诉我bm|kmp代表什么意思?

以下是邮件列表的原文:

>     > Hi,
>     >    while  running this command
>     > # iptables -t nat -I PREROUTING -p tcp -s 192.168.2.20
>     < -m string
>     > --hex-string '0d0a0d0a594d5347' -j REJECT
>     >
>     > Not able to get the different options for '--algo' parameter .
>     > Kernel 2.6.14 iptables v1.3.4  thanks - Jasbir
>
>     --algo [bm|kmp]
>
>     bm: Boyer-Moore
>     kmp: Knuth-Pratt-Morris
>
>     Those are the algorithm implemented at the moment.
>
>     BTW, you should do that in the raw table, not nat. Nobody should use the
>     nat table for filtering purposes.
>
>     --
>     Pablo
>
>
>  
>
> Thankz Pablo for the reply and the "string" module :) . I redifined my
> rule now and after some googling found the right syntax for  using  the
> "--hex-string"
> # iptables -t raw -A PREROUTING -s $source_ip -m string --algo bm
> --hex-string "|0d 0a 59 4d 53 47|" -j DROP
> Whats the initial position/counter for the "--from" parameter  0 or 1
> and does it start from the IP header ?

Yes, the IP header. Use --from 0 for the initial position.

阅读(1920) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~