I'm trying to create a valid TCP connection to my test server in order to simulate a GET request. Hopefully I'm pretty close to a solution.
Using Wireshark data from a real request, I've managed to get the SYN
& SYN-ACK
when sending one package using PacketCommunicator.SendPacket()
:
However, I can't seem to make the ACK
appear.
The first packets is constructed using EthernetLayer
, IpV4Layer
and a TcpLayer
, while the latter (currently non-working) uses the ones just mentioned + a HttpRequestLayer
.
The last packets TcpLayer
's ControlBits
is set to TcpControlBits.Acknowledgment
. Despite this, it's not showing up in WireShark like on my "real" GET requests.
Hopefully I've posted the relevant part of the code. If not - please let me know.
Here is a draft that works (I've checked).
Please change the values used when constructing HttpGetSender instance to whatever you need.
The tricky part is to get the sequence and acknowledgement numbers right.