pcap.net

PCAP Library Capabilities (writing new PCAP files)

与世无争的帅哥 提交于 2021-02-18 16:33:45
问题 I am stuck. I have used PCAP.NET to read .PCAP files and write the packets into a database. Now I can query the database and get packets back that match the constraints. I need a way to write the results to a new .PCAP file. The problem is that, as far as I can tell, the only way to generate a new PCAP file is via the DumpFile which can only be initialized via a PacketCommunicator that is itself tied to a PacketDevice. an example can be seen here: http://pcapdotnet.codeplex.com/wikipage?title

how can I parse a UDP packet in .NET?

我怕爱的太早我们不能终老 提交于 2020-01-02 17:18:48
问题 how can I parse a UDP packet in .NET? I'm using PCap.Net to capture packets, in this case UDP packets, which I can access from the PCap.net object via (PcapDotNet.packets.Ethernet.IpV4.Udp). How can I take the results, the Udp packet, and parse this? In particular to unbundle DNS requests and responses that occur that are housed within a UDP packet. Is there a library that could help here? EDIT : To be more specific what I want to be able to do is extract the IP address from the DNS response,

.NET writing PCAP files

故事扮演 提交于 2019-12-12 20:25:02
问题 All, I've spent a fair part of the day looking at various PCAP libraries and before I commit to writing a PCAP writer I'd like to describe my scenario and solicit input. I have a client that has asked that I provide a service that reads pcap files and writes the packets into their database of choice. The client then can query the database (datetime range) and the result should eventually be a pcap file containing the packets that matched that range criteria. What I have found with the

C# Pcap.net communication

百般思念 提交于 2019-12-11 06:06:50
问题 I would like to ask why is my communicator receiving sent frames. I'm trying to fix this problem using flag PacketDeviceOpenAttributes.NoCaptureLocal for receiving communicator but I'm still receiving sent frames. Could anyone know how to fix this problem? Thank you. Here is my code: using PcapDotNet.Core; using PcapDotNet.Packets; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using

C# PCAP.NET how to send a valid TCP request?

霸气de小男生 提交于 2019-12-11 05:35:57
问题 I wil try using PCAP.NET to send TCP Request from my computer to my server but i don't see request into the server? Send from my PC and showing in Wireshare here But can't see this TCP Request on my server, please help. here is my code using System; using System.Collections.Generic; using PcapDotNet.Base; using PcapDotNet.Core; using PcapDotNet.Packets; using PcapDotNet.Packets.Arp; using PcapDotNet.Packets.Dns; using PcapDotNet.Packets.Ethernet; using PcapDotNet.Packets.Gre; using PcapDotNet

Pcap.net vs Sharppcap

时间秒杀一切 提交于 2019-12-09 02:33:04
问题 I just want to listen a network device, capture packets and write the packets to a dummy file. Also i need to filter packets while listening so ill only write packets which passes the filter. I need to do these on .net c#. These are my requirements. So which one should i use? High transfer rate and minimum packet loss is really important. Thanks for reading. 回答1: As the author of SharpPcap I can say that you'll be able to perform all of those operations with the library. Performance was a

How I can grant permission for Pcap library in Windows 10 from C#?

雨燕双飞 提交于 2019-12-08 14:07:07
问题 I use SharpPcap library for realise GOOSE protocol listener (EtherType = 0x88B8). It works well, but only if I run Wireshark in parallel, otherwise my program does not catch GOOSE packets. SharpPcap examples also don't capture GOOSE packets while Wireshark is not running. But SharpPcap library captures my broadcast UDP packets. 回答1: I had to open my SharpPCap device in promiscuous mode: winPcap.Open(SharpPcap.WinPcap.OpenFlags.Promiscuous | SharpPcap.WinPcap.OpenFlags.NoCaptureLocal,

how can I parse a UDP packet in .NET?

我们两清 提交于 2019-12-06 08:37:52
how can I parse a UDP packet in .NET? I'm using PCap.Net to capture packets, in this case UDP packets, which I can access from the PCap.net object via (PcapDotNet.packets.Ethernet.IpV4.Udp). How can I take the results, the Udp packet, and parse this? In particular to unbundle DNS requests and responses that occur that are housed within a UDP packet. Is there a library that could help here? EDIT : To be more specific what I want to be able to do is extract the IP address from the DNS response, and based on examination using Wireshark it would be by: (a) Input: Payload of a UDP packet that is a

Split packet into 2 packets with pcapdotnet

南楼画角 提交于 2019-12-02 16:02:44
问题 How can I split a packet into two packets using pcapdotnet? This is what I tried, but I don't know whether it's correct: public IEnumerable<Packet> splitPacket(Packet packet) { EthernetLayer ethernet = (EthernetLayer)packet.Ethernet.ExtractLayer(); IpV4Layer ipV4Layer = (IpV4Layer)packet.Ethernet.IpV4.ExtractLayer(); DateTime packetTimestamp = packet.Timestamp; ILayer payload = packet.Ethernet.IpV4.Payload.ExtractLayer(); IpV4Fragmentation.Equals(packet, packet); yield return PacketBuilder

Pcap.net vs Sharppcap

人盡茶涼 提交于 2019-12-01 02:45:19
I just want to listen a network device, capture packets and write the packets to a dummy file. Also i need to filter packets while listening so ill only write packets which passes the filter. I need to do these on .net c#. These are my requirements. So which one should i use? High transfer rate and minimum packet loss is really important. Thanks for reading. As the author of SharpPcap I can say that you'll be able to perform all of those operations with the library. Performance was a critical design goal. Packet.Net has a range of packets that it can parse and is the library bundled along with