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

查看:29
本文介绍了如何在主机将数据包头(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天全站免登陆