WindivertUtil 2.0.1
dotnet add package WindivertUtil --version 2.0.1
NuGet\Install-Package WindivertUtil -Version 2.0.1
<PackageReference Include="WindivertUtil" Version="2.0.1" />
<PackageVersion Include="WindivertUtil" Version="2.0.1" />
<PackageReference Include="WindivertUtil" />
paket add WindivertUtil --version 2.0.1
#r "nuget: WindivertUtil, 2.0.1"
#:package WindivertUtil@2.0.1
#addin nuget:?package=WindivertUtil&version=2.0.1
#tool nuget:?package=WindivertUtil&version=2.0.1
WindivertUtil
A lightweight Windows network packet interception library based on WinDivert. Capture and inject network traffic with a simple event-driven API.
Features
- WinDivertInterceptor - Intercept packets destined for specific IP:Port
- Configurable target IP and port
- Event-driven asynchronous architecture
- Zero external dependencies
Installation
dotnet add package WindivertUtil
Requirements
- Administrator privileges (required to run)
- WinDivert driver must be installed
Installing WinDivert Driver
Download and install WinDivert from: https://reqrypt.org/windivert.html
Alternatively, include WinDivert.dll and WinDivert64.sys files in your project output directory.
Quick Start
Basic Usage
API Reference
WinDivertInterceptor
| Member | Description |
|---|---|
WinDivertInterceptor(ip, port) |
Constructor - specify target IP and port |
StartAsync() |
Start packet interception |
Stop() |
Stop packet interception |
InjectPacketFromCloud(byte[]) |
Inject packet into local network stack |
OnPacketIntercepted |
Event raised when packet is intercepted |
OnLog |
Event raised for log messages |
OnError |
Event raised on errors |
PacketsIntercepted |
Count of intercepted packets |
BytesTransmitted |
Total bytes transmitted |
Native Dependencies
This library requires WinDivert native libraries:
- WinDivert.dll - x86/x64 DLL
- WinDivert64.sys - x64 driver file
Ensure these files are in your application's output directory, or install the WinDivert driver.
FAQ
Q: "Failed to open WinDivert handle" error?
A: Ensure:
- Run your application as Administrator
- WinDivert driver is installed
License
This library is licensed under the MIT License.
Note: WinDivert is licensed under GPLv3. If you distribute this library, you may need to comply with WinDivert's license terms.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0-windows7.0 is compatible. net7.0-windows was computed. net8.0-windows was computed. net9.0-windows was computed. net10.0-windows was computed. |
-
net6.0-windows7.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
v2.0.0 - Initial release
- WinDivertInterceptor: Intercept packets to specified IP:Port
- WinDivertNative: P/Invoke wrapper for WinDivert API
- TcpPayloadExtractor: TCP payload extraction utility
- Configurable IP and Port
- Event-driven asynchronous architecture