如何在主机将数据包发送到网络之前修改数据包头(IP 头、TCP 头) [英] how to modify packet header(IP header, TCP Header) before the host send them into the network

查看:24
本文介绍了如何在主机将数据包发送到网络之前修改数据包头(IP 头、TCP 头)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在主机将它们发送到网络之前修改数据包头(IP头,TCP头).

I want to modify packet header(IP header, TCP Header) before the host send them into the network.

比如我用firefox浏览,那么我想截取firefox的所有数据包,修改IP/TCP头,然后发送到网络中.

For example, if I'm using firefox for browsing, then I want to intercept all the packets from firefox and modify the IP/TCP header and then send them into the network.

所以基本上,有两个要求:1 拦截来自 Firefox 的所有数据包(但不是其他程序).如果这是不可能的,是否可以拦截来自特定端口或 IP/端口对的数据包

so basically, there are two requirements: 1 intercept all the packets from firefox(but not other programs). if this is not possible, is it possible to intercept the packets from a specific port or ip/port pair

2 修改IP/TCP头然后注入网络

2 modify the IP/TCP header and then inject them into the network

有没有办法、API 来实现这一点?libpcap怎么样?有没有类似的源代码片段?我正在使用 linux c

are there ways, APIs to achieve this? how about libpcap? are there similar source code snippets? I'm working with linux c

谢谢!

推荐答案

Razorback 是用于深度数据包注入的开源 API.您可以在以下位置找到来源:

Razorback is an open source API for deep packet injection. You can find the source at:

http://sourceforge.net/projects/razorbacktm/files/Razorback/

您也可以向他们索取他们提议的系统的源代码.

You can also request them for the source code for their proposed system.

http://www.icir.org/vern/papers/pktd-pam03.pdf

这篇关于如何在主机将数据包发送到网络之前修改数据包头(IP 头、TCP 头)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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