Windows Network Diagnostics Open Source • Console Utility

TcpInspector

A command-line TCP session inspection and termination utility for Windows. Matches active application sockets via regular expressions, with first-class support for managing and dropping both IPv4 and IPv6 TCP connections.

Platform: Windows (x64, x86, ARM64)
Protocols: TCP IPv4 • TCP IPv6 (TCP Only • No UDP)
License: MIT License • RegEx Process Matching

Precise Socket State Control

Inspired by Sysinternals TCPView, TcpInspector delivers programmatic control over active socket states from scripts and command prompts:

Full IPv6 Session Termination

Enumerates IPv4 and IPv6 TCP sessions through the IP Helper API and requests termination through NsiSetAllParameters in nsi.dll. Failed termination requests report a Windows error code.

RegEx Process Selection

Filter target network sessions by process name using standard C++ regular expressions (e.g. chrome.*, curl\.exe, or custom service names).

Scriptable Diagnostics

Ideal for automated CI/CD network test harnesses, simulating socket resets, protocol failure injection, and clearing hanging connections without process termination.

Command Syntax & Usage

# Syntax: TcpInspector <target_application_regex> <list|drop>


# List all active TCP connections for curl:

TcpInspector curl\.exe list


# Forcefully terminate all TCP connections matching an application:

TcpInspector "test_runner.*" drop