Cross-platform active TCP and UDP socket scanner for .NET, inspecting listening ports, established connections, and binding owning process metadata across Windows and Linux.
📖 Framework Documentation: English Specification | Spécification en français
- Native Kernel Inspections:
- Windows: Uses Win32 IP Helper API (
GetExtendedTcpTable,GetExtendedUdpTable) for fast, non-blocking socket enumeration. - Linux: Parses kernel virtual filesystem entries (
/proc/net/tcp,/proc/net/tcp6,/proc/net/udp,/proc/net/udp6).
- Windows: Uses Win32 IP Helper API (
- Process Attribution: Binds local network endpoints to the specific process ID (PID) and process metadata responsible for network communication.
- Full Socket State Coverage:
- Listening endpoints (
Listen,Bind). - Active connections (
Established,TimeWait,CloseWait,SynSent).
- Listening endpoints (
- IPv4 & IPv6 Dual-Stack Support: Transparent handling of both IPv4 and IPv6 network sockets.
Add the package via the .NET CLI:
dotnet add package SocketForge --version 1.1.1using SocketForge.Scanning;
var scanner = new ActiveSocketScanner();
var sockets = await scanner.ScanActiveSocketsAsync();
foreach (var socket in sockets)
{
Console.WriteLine($"[{socket.Protocol}] {socket.LocalAddress}:{socket.LocalPort} -> {socket.RemoteAddress}:{socket.RemotePort} (PID: {socket.ProcessId}, State: {socket.State})");
}This project is licensed under the MIT License.