I use PcapDotnet wrapper for sniff packets but it show just ip raw packets for example at clientside i send that packet
client_.Send(ASCIIEncoding.ASCII.GetBytes("test"));
and at serverside i want to capture "test" but packet.Buffer show different 66 bytes.Can i get just "test" packets ?
private static void PacketHandler(Packet packet)
{
IpV4Datagram ip = packet.Ethernet.IpV4;
TcpDatagram tcp = ip.Tcp;
if (tcp.DestinationPort == 28001 || tcp.SourcePort == 28001)
{
File.AppendAllText("return.txt", ASCIIEncoding.ASCII.GetString(packet.Buffer));
Console.WriteLine(ip.Source + ":" + tcp.SourcePort + " -> " + ip.Destination + ":" + tcp.DestinationPort);
}
}