Skip to content

Commit 81bb864

Browse files
committed
fix tcp headers
1 parent 0fe7b28 commit 81bb864

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

providers/http/nfqueue/nfqueue.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,13 @@ func craftReplyPacketBytes(keyAuth string, inputpacket gopacket.Packet) []byte {
6161

6262
httplayer := gopacket.Payload(craftkeyauthresponse(keyAuth))
6363
tcplayer := &layers.TCP{
64-
Seq: inputTcp.Ack + 1,
6564
// we reply back so reverse src and dst ports
66-
SrcPort: inputTcp.DstPort,
67-
DstPort: inputTcp.SrcPort,
68-
Ack: inputTcp.Seq + 1,
69-
Window: 100,
65+
SrcPort: inputTcp.DstPort,
66+
DstPort: inputTcp.SrcPort,
67+
Ack: inputTcp.Seq + uint32(len(inputTcp.Payload)),
68+
Seq: inputTcp.Ack - 1,
69+
DataOffset: 5,
70+
PSH: true,
7071
}
7172
//check network layer
7273
// this is reply so we reverse sorce and dst ip

0 commit comments

Comments
 (0)