怎样修改与WinPcap的一个HTTP响应包? [英] How do I modify a HTTP response packet with winpcap?

查看:745
本文介绍了怎样修改与WinPcap的一个HTTP响应包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在这里有两个问题:


  1. 如果内容是什么EN codeD:gzip的...

  2. 请我还需要改变头部分,使HTTP数据包有效(如果有的话校验?)

更新

有人用实际经验能否详细说明所涉及的步骤?

我用的WinPcap 和BPF tcp和源端口80 过滤流量,所以我的工作的谎言在这个回调函数:

 无效packet_handler(u_char *参数,const的结构pcap_pkthdr *头,常量u_char * pkt_data)


解决方案

WinPcap的不允许你改变一个已经发送的数据包。

如果该数据包被发送,WinPcap的距离将到达目的地没有prevent它。

如果您想发送另一个响应 - 除了所发送的响应 - 我不知道你想达到什么

There are two problems here:

  1. What if content is encoded:gzip...
  2. Do I also need to change the header part to make the HTTP packet valid(checksums if any?)

UPDATE

Can someone with actual experience elaborate the steps involved?

I'm using winpcap and bpf tcp and src port 80 to filter the traffic,so my job lies in this callback function:

void packet_handler(u_char *param, const struct pcap_pkthdr *header, const u_char *pkt_data)

解决方案

WinPcap doesn't allow you to change a packet that was already sent.

If the packet was sent, WinPcap won't prevent it from reaching its destination.

If you want to send another response - in addition to the response that was sent - I'm not sure what you're trying to achieve.

这篇关于怎样修改与WinPcap的一个HTTP响应包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆