Network

How to use the new Network Sniffer Tool PktMon.exe in Windows 10

How to use the new Network Sniffer Tool PktMon.exe in Windows 10

Windows 10 offers an inbuilt Network Sniffer Tool - PktMon.exe - to monitor internal packet propagation and packet drop reports. This tool can help you snoop around. The network and help you resolve the cause of network latency, identify impacted applications, and, when used with an additional set of tools, can provide insight into top metrics. In this post, we will show how you can use the new Network Sniffer Tool (PktMon.exe) in Windows 10.

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:

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 filter help pktmon filter  list | add | remove  [OPTIONS | help]
Commands list Display active packet filters. add Add a filter to control which packets are reported. remove Removes all filters.

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.

  1. Create a Filter to monitor a port
  2. Start Monitoring
  3. Export Log into a readable format

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.

pktmon filter add help

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]”

pktmon filter add -p 1088

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

pktmon start --etw - p 0

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.

Log filename: C:\Windows\system32\PktMon.etl Logging mode: Circular Maximum file size: 512 MB

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

pktmon format PktMon.etl -o port-monitor-1088.txt

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.

Instrumente utile pentru jucătorii Linux
Dacă vă place să jucați jocuri pe Linux, este posibil să fi folosit aplicații și utilitare precum Wine, Lutris și OBS Studio pentru a îmbunătăți exper...
Jocuri HD remasterizate pentru Linux care nu au avut niciodată lansare Linux mai devreme
Mulți dezvoltatori și editori de jocuri vin cu remasterizarea HD a jocurilor vechi pentru a prelungi durata de viață a francizei, vă rog fanilor să so...
Cum se utilizează AutoKey pentru automatizarea jocurilor Linux
AutoKey este un utilitar de automatizare desktop pentru Linux și X11, programat în Python 3, GTK și Qt. Folosind funcțiile sale de scriptare și MACRO,...