Questions tagged [packetdotnet]

.NET assembly for dissecting and constructing network packets such as Ethernet, IP, TCP, UDP etc.

.NET assembly for dissecting and constructing network packets such as Ethernet, IP, TCP, UDP etc.

14 questions
3
votes
0 answers

C# SharpPcap send Tcp Packet

Im trying to send a Tcp Packet over SharpPcap to an Server but it dosent work, can someone help me or explain me how i can send TcpPackets with SharpPcap and Packet.Net. More Info's: Im sniffing a connection and trying to send a message to the…
Uther
  • 31
  • 1
1
vote
1 answer

Can't Run C# SharpPcap Program Under User Account

I code a C# program to catch and resolve packets using SharpPcap and PacketDotNet. It performs well when I run it in Administrator Account, still it will popup a window as below: The question means"Do you want to allow this app to make changes to…
1
vote
2 answers

How to Convert Packet to TcpPacket?

I'm using PacketDotNet to resolving captured packets. In PacketDotNet0.12.0, it provides a method called GetEncapsulated. TcpPacket tcppacket = TcpPacket.GetEncapsulated(this.packet); But now, I have to update PacketDotNet from version 0.12.0 to…
1
vote
4 answers

How to extract bytes from the UInt128 type

The PacketDotNet library defines a struct UInt128. See: How to convert this type into a simple byte array in C#?
Pythoneer
  • 87
  • 6
1
vote
1 answer

Packet size more than 1500

I'm trying to send more than 2000 bytes of data using SharpPcap and PacketDotNet. But, the MTU (1500 bytes) is less than the size of the data. I tried to set MTU (to 5000) using…
Ritesh S
  • 11
  • 3
1
vote
1 answer

Sniffing TCP packets of an android device on local network

I am writing a packet sniffer using C# and PcapDotNet, I've successfully implemented the feature and I was able to capture all the TCP packets from my laptop, the problem is if I target my android device I get no packets at all, I am a beginner at…
HMZ
  • 2,949
  • 1
  • 19
  • 30
1
vote
0 answers

SharpPcap - Getting information from packet

I'm trying to get information from packets, like GET/POST requests using SharpPcap and PacketDotNet. I looked different information here on stackoverflow, but I have encoding problems. Information from packets isn't shown properly in every taken…
0
votes
2 answers

How to get packet's specific value(src ip, dst ip, even port)?

Is there any way to show the packet's dst ip address, src ip address and both port only? var device = CaptureDeviceList.Instance.FirstOrDefault(dev => dev.Description.Contains("Ethernet"));//set capture interface to ethernet. var defaultOutputType =…
0
votes
1 answer

Can SharpPcap find Ethernet itself?

Can SharpPcap auto choose Ethernet for capturing packets? var device = CaptureDeviceList.Instance[3];//I don't want to hard-code it. Should I use "if, else" or "for-loop" to check it?
Sam1916
  • 11
  • 4
0
votes
2 answers

How to convert a script(Capture Packets and save it to log file) into Window Service?

I want to write a window service for keep capturing the network traffic and save the packets info into a log file, but I can't start it. "Error 1064: An exception occurred in the service when handling the control request." References: Capturing And…
0
votes
0 answers

How to build vlan tagged ethernet packet using PacketDotNet?

In my C# application I'm using the PacketDotNet lib. So, I'm trying to send a vlan tagged frame, but can't build it correctly. My code: public static void Main(string[] args) { const ushort udpSourcePort = 123; const ushort…
Mav17
  • 51
  • 4
0
votes
0 answers

Get Clear contents inside TCP Packet

I try to get clear contents from a packet using SharpPcap. Here is the code I have var packet = PacketDotNet.Packet.ParsePacket(e.Packet.LinkLayerType, e.Packet.Data); if (packet is PacketDotNet.EthernetPacket) { if…
king jia
  • 692
  • 8
  • 20
  • 43
0
votes
1 answer

Reading From Multiple PcapFiles In One Instance of the program

I am using Sharppcap wrapper for WinPcap and I am trying to read multiple pcap files, consecutively, in one instance of a program/ program lifetime foreach (FILENAME in LIST) // pseudocode { ICaptureDevice device; try { device…
Murph
  • 3
  • 5
0
votes
1 answer

Attempted to set a negative index while reading PCAP files

I have a randomly occurring problem on a set of PCAP files. I am trying to parse all the packets from the recorded PCAP files using SharpPcap and PacketDotNet. The errors seem to occur at random. I am not doing anything fancy. The following is my…
Igor Ševo
  • 5,459
  • 3
  • 35
  • 80