Network Sniffer Tool pktmon.exe in Windows 10
PktMon.exe or Packet Monitor is the new network sniffer or network diagnostic and packet monitoring tool. It is located in the Systems folder, which means you can invoke it from the Run or Command Prompt or PowerShell. If the program reminds you about Netsh Trace Command, then you are right. Netsh Trace command helps you to enable and configure network tracing to assist you when troubleshooting network connectivity problems.
What can PktMon can do?
If you run PktMon.exe Help on the command prompt. Here is what you get:
filter: Manage packet filters.comp: Manage registered components.reset: Reset counters to zero.start: Start packet monitoring.stop: Stop monitoring.format: Convert log file to text.unload: Unload PktMon driver.
And if you want further help on a specific command, then you can run help against that command. Here is how it looks like: PktMon.exe also comes with real-time monitoring and support for the PCAPNG file format. Read: How to enable and test DNS over HTTPS in Windows 10.
How to use PktMon to monitor network traffic
Here is an example of how to use it with a simple example. This example is assuming that you want to monitor a port number on the computer, which might be having issues often.
1. Create a Filter
The primary option which allows you to monitor traffic is —filter. Using this option, you can create a filter to control which packets are reported based on Ethernet Frame, IP header, TCP header, and Encapsulation. If you run the below-mentioned program, you will get full details on what you can do with the filter. So coming back to our topic, let’s assume that we are going to monitor TCP port no 1088. It can be a port used by your custom application, which is crashing, and PktMon can help you figure out if the network is the problem. Open Command Prompt or PowerShell with admin privileges Create a packet filter using the command: “pktmon filter add -p [port]” You can then run the command “pktmon filter list” to see a list of added filters.
To remove all the filters run the command “pktmon filter remove”
2. Start Monitoring
Since this is not an automated program running in the background but works on-demand, you need to start monitoring manually. Run the following command to start monitoring packets It will start the monitoring and created a log file at the mentioned location. You will have to manually stop using the “stop” argument to stop the logging, or it will end when the computer shuts down. If you run the command with “-p 0” then it will only capture 128 bytes of a packet.
3. Export Log into a readable format
The log file is saved into PktMon.ETL file which can be converted into a human-readable format using the following command Having done that, while you open the file in notepad, and read it, to make sense, you will have to use the Microsoft Network Monitor. It can directly read the ETL file. That said, Microsoft is expected to start rolling out support for real-time monitoring, which was expected in Windows 10 2004 – but I do not see that that option yet. Related read: Free Packet Sniffing Tools for Windows 10.