Questions tagged [pcap.net]

Pcap.Net is a .NET wrapper for WinPcap written in C++/CLI and C#. It Features almost all WinPcap features and includes a packet interpretation framework.

Pcap.Net is a .NET wrapper for WinPcap written in C++/CLI and C#. It Features almost all WinPcap features and includes a packet interpretation framework. See http://pcapdot.net

139 questions
22
votes
7 answers

Casting a byte array to a managed structure

Update: Answers to this question helped me code the open sourced project AlicanC's Modern Warfare 2 Tool on GitHub. You can see how I am reading these packets in MW2Packets.cs and the extensions I've coded to read big endian data in Extensions.cs. I…
AlicanC
  • 863
  • 1
  • 8
  • 12
13
votes
2 answers

Pcap.net vs Sharppcap

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.…
Emre Erisgen
  • 147
  • 1
  • 1
  • 6
9
votes
2 answers

Packet Redirection on Windows

We currently run windows on all of our machines due to software limitation. Within this however, we are needing to redirect certain packets that come into an IP and Port to a different Port (same IP). We have software listening on the "Proxy…
7
votes
2 answers

.net packet capture: pcap.net vs sharppcap

interested in any comments anyone has around the various .net tools which can be used for passive packet capture. In terms of winpcap the choice seems to be between pcap.net and sharppcap. Another potential offering is Microsoft's NetworkMonitor and…
Patrick
  • 8,175
  • 7
  • 56
  • 72
7
votes
1 answer

Windows forward packets to c# application

Is there any way to forward tcp packets to my c# application on windows (10) and let TcpListener/HttpListener handle the requests? In linux I can do that by setting up iptables (iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT…
Orestis P.
  • 805
  • 7
  • 27
7
votes
3 answers

How to prevent Windows from sending RST packet when trying to connect to somebody via Pcap.net?

I'm trying to use Pcap.Net to open a tcp connection. I'm sending following package: The server is responding with: After this, Windows on its own sends the reset packet: Why is this happening, and how do I block this behavior? I'm doing this on…
Arsen Zahray
  • 24,367
  • 48
  • 131
  • 224
4
votes
1 answer

Creating a valid TCP connection in Pcap.NET

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…
Johan
  • 35,120
  • 54
  • 178
  • 293
3
votes
2 answers

Unable to load file or assembly 'PcapDotNet.Core.dll'

I had a working Solution on my computer using "visual studio community" and a win7 x32 install. (it uses PcapDotNet package) I migrated my system to another computer and installed a win7 x64. Now, my program using the PcapDotNet package does not…
3
votes
3 answers

Aborting task that contains never-ending library method (no ability of checking cancellation requests)

I use Pcap.Net for traffic monitoring, and I need it to receive packets until user requests cancellation. I create monitoring task this way (simplified): var task1 = Task.Run(() => { communicator.ReceivePackets(0, PacketHandlerCallback); } /*,…
3
votes
5 answers

Forward UDP packets to several IPs maintaining the original source address

I have a working system that receives data via UDP packets sent to a fixed IP:Port and I want to use a program (some kind of proxy?) to send a copy of those packets to a new IP:Port (or a list of IP:Ports, but all inside the same LAN as the…
Opera362
  • 51
  • 1
  • 4
3
votes
1 answer

how can I parse a UDP packet in .NET?

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…
Greg
  • 34,042
  • 79
  • 253
  • 454
3
votes
1 answer

Pcap.Net BadImageFormatException was unhandled

Hello I'm new in using PCAP.net and I'm having this error.
user2530833
  • 1,008
  • 1
  • 10
  • 25
3
votes
1 answer

Failed to open file after many attempts

I am using PcapDotNet DLL's in my application, and I am encountering a problem: My application takes a PCap file (Wireshark file) and sends the packets to the network card. If I send a file or files many times (usually ~500 times), my application…
user1710944
  • 1,419
  • 4
  • 16
  • 17
3
votes
1 answer

How to stop receiving packets from pcap.net?

I'm looking at pcap.net's ability to intercept packets from various devices. Starting the process is really straightforward: communicator.ReceivePackets(0, PacketHandler); But after that, the process does not stop. Ever. How do I forcibly close the…
Arsen Zahray
  • 24,367
  • 48
  • 131
  • 224
3
votes
3 answers

PCAP Library Capabilities (writing new PCAP files)

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…
Chris Keller
  • 235
  • 3
  • 9
1
2 3
9 10