c++ - libnet 可以用来注入(inject) tcp 数据包/数据包修改吗?

标签 c++ c libnet

我只是看了一眼libnet的介绍,

似乎提到了支持udpip,但没有提到tcp

它支持tcp吗?

最佳答案

寻找here ,好像有一个与tcp相关的功能,所以我想是的,你可以用libnet注入(inject)tcp段。

int libnet_build_tcp(u_short sport, u_short dport, u_long seq,
            u_long ack, u_char control, u_short win, u_short urg,
            const u_char *payload, int payload_s, u_char *buf);

libnet_build_tcp() builds a TCP (Transmission Control Protocol) packet. Supplied is the source port, destination port, the sequence and acknowledgement numbers, the control bits (which can be logically OR'd together to set multiple flags -- see the example below), the advertised window size, the urgent pointer, a pointer to an optional data payload, the payload size, and lastly, the pointer to a pre-allocated block of memory for the packet. To just build a TCP header with no data payload, only TCP_H bytes need be allocated.

关于c++ - libnet 可以用来注入(inject) tcp 数据包/数据包修改吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2872000/

相关文章:

c# - 为 CvMat.data union 创建 C# 结构或以任何方式在 C# 中访问它

c - 如何使用 C 从 Windows 中的文件句柄获取文件名?

c - Libnet基本使用

python - pylibnet安装报错ubuntu 14

php - 一个适合我的基准测试的线图生成器?

c - libnet tcp header 结果全为零

c++ - 为什么a[v] = v[a]?

c++ - 识别图像上字符的开始和结束 XY vector

c++ - Qt QList - removeAll 释放内存

c++ - 通过引用返回指针数组