Score:0

How to get syn flags, ack flags, sequence number and acknowledgement number in tcp packets with nfqueue?

br flag

I am working on a project which can redirect the network traffic in tcp (packets sent by client to server1 will be redirected to server2) with netfilterqueue, so I need to classify the packets by their syn and ack flags, and I also needs to modify the sequence number and acknowledgement number in packets so that I can convince server2 to establish the connection with client. But I didn't find the method to get the syn, ack flags and seq, acknowledgement number in tcp packets (not just show the packet information, but get the syn and ack flags, and seq, ack number to print and modify them), if anyone can help me, I would be grateful for that!

Score:0
us flag

You need to parse the IP packet as included in the PAYLOAD attribute in the netlink message.

You can use kernel headers ip.h and tcp.h to parse the packets.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.