gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-30 18:09:03 26 4
gpt4 key购买 nike

我只是看了一眼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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com