I am trying to use PCap.NET to send a SYN packet to a destination. When using the WinSock API I can see the TCP Options in Wireshark.... But when I use PCap.NET to build and send the packet, the options are not included. Here is the TCP layer I use to build the packet :
TcpLayer tcpLayer = new TcpLayer
{
SourcePort = _sourcePort,
DestinationPort = _destinationPort,
SequenceNumber = _seqNumber,
ControlBits = TcpControlBits.Synchronize,
Window = _windowSize,
};
This is the a WireShark ScreenGrab for sending a SYN using WinSock, where the TCP options are visible.
And this is the Wireshark ScreenGrab sending a SYN using PCap.NET, where the TCP options are not visible.
I understand that when building a Pcap TCP layer you can set the options property to None.... I haven't done that, thinking that by leaving it as its default that the options would send the same way it does for WinSock. Can anybody provide any explanation or advice for this problem. Thanks in advance for the help!
If you create a new TcpLayer
, you need to set the Options
property in order to have options in the TCP layer.
If you don't set the Options
property, it will, by default, set to None
.