Netsh
Introduction
Netsh is a command-line scripting utility that allows you to display or modify the network configuration of a computer that is currently running. Netsh commands can be run by typing commands at the netsh shell and be used in batch files or scripts. Remote computers and the local computer can be configured by using netsh commands.
Installation
Requirements:
Functional computer running Windows
Syntax
netsh [-a AliasFile] [-c Context] [-r RemoteMachine] [-u [DomainName\]UserName] [-p Password | *] [Command | -f ScriptFile]
Usage
Network Trace
Open Command Prompt as Administrator
Execute the following command to start the network capture and output to file
netsh trace start capture=yes tracefile=pathtofile\icmp_trace.etl
Execute the following command to stop the network capture
netsh trace stop
Convert .etl to .pcapng
Download etl2pcapng from the official GitHub repository
Execute the following command to convert the .etl file to .pcapng format
etl2pcapng.exe in.etl out.pcapng
Viewing the PCAP
Use a packet analysis tool such as Wireshark
Official Manual
https://learn.microsoft.com/en-us/windows-server/networking/technologies/netsh/netsh-contexts
References
https://learn.microsoft.com/en-us/windows-server/networking/technologies/netsh/netsh-contexts
Last updated