Windows OS Hub
  • Windows
    • Windows 11
    • Windows Server 2022
    • Windows 10
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
  • PowerShell
  • Linux
  • Home
  • About

Windows OS Hub

  • Windows
    • Windows 11
    • Windows Server 2022
    • Windows 10
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
  • PowerShell
  • Linux

 Windows OS Hub / Windows 10 / Network Monitor: Capture and Analyze Network Traffic on Windows

November 12, 2024 Windows 10Windows 11Windows Server 2022

Network Monitor: Capture and Analyze Network Traffic on Windows

Microsoft Network Monitor (NetMon) is a classic network diagnostic tool for Windows that is used to capture and analyze all the incoming and outgoing traffic on a computer. Even though this product has not been developed or updated for over 3 years, it is often used by administrators when they need to diagnose network connections. NetMon offers fewer features than the popular capture and analysis tool WireShark and is not as good at complex packet analysis tasks. However, Network Monitor’s graphical interface is much simpler and more intuitive, and the product itself is lightweight. So its use is justified and practical in some scenarios.

This article shows how to use Network Monitor to capture and analyze network traffic in real-time and to dump traffic for later analysis.

The idea for this article was suggested by our subscriber who received a warning from his provider that his Windows VPS server was being used for mass email mailouts. It was not possible to track in real-time which process was initiating the SMTP sessions as the mailings took place at different times. To find the source, we need to capture all outgoing traffic on standard SMTP ports 25, 587, and 465, and identify the process executable or script that is performing the mailings.

Download the Microsoft Network Monitor 3.4 installer (NM34_x64.exe) from the Microsoft website or install it using the WinGet package manager:

winget install Microsoft.NetMon

Install Microsoft Network Monitor 3.4 on Windows

Run Network Monitor as an administrator when the installation is complete. In the NetMon window, click New Capture.

By default, Network Monitor collects all traffic that passes through a computer’s network interfaces. The size of such a network dump can be significant if you are capturing network traffic over a long time. In our case, we can set filters to only capture outgoing network packets on one of the known SMTP ports.

Click the Capture Settings button. Here you can configure filters that describe what traffic NetMon should capture. There are several filter templates for typical tasks in the Load Filter -> Standard Filters menu. In our case, we need a TCP port number filter. Select TCP-> TCP ports.

NetMon - add filter

The following template code is inserted into the Filter Editor window:

tcp.port == 80 OR Payloadheader.LowerProtocol.port == 80

Edit the template rule and add all three default SMTP port numbers:

(tcp.port == 25 OR Payloadheader.LowerProtocol.port == 25 OR
tcp.port == 587 OR Payloadheader.LowerProtocol.port == 587 OR
tcp.port == 465 OR Payloadheader.LowerProtocol.port == 465)

If your computer has more than one network interface, or if there are additional IP addresses (aliases) assigned to the adapter, you can add a filter by source IP address:

AND
(IPv4.SourceAddress == 192.168.18.111)

Network Monitor Filter frames by TCP port numbers

Network Monitor filters can be combined using brackets and OR / AND / NOT logical expressions, or you can use || , && , or ! instead.

Click the Apply button to save the filter.

Then go to Tools -> Options -> Parser profiles. Select Windows in the default parser profile (Set as active).

Configure active parser for NetMon

You are now ready to start capturing network traffic. Click the Start button on the toolbar.

Start capturing network packets with Netmon

Now you need to reproduce the problem, or if it happens randomly, just let NetMon run for a day/week.

Note that, depending on the capture filter settings, dumping network traffic over a long time will require a significant amount of RAM and disk space.

In our case, after some time, events corresponding to the filters applied appeared in the NetMon packet log. If you open the contents of the packets, you will see that an SMTP connection has been attempted. Inside the network frames, you will see the detailed commands of the SMTP protocol, the authentication attempt, the address of the target SMTP server, and the email address to which the message was sent (example of SMTP commands in Telnet to send email with authentication).

Dump the traffic in Network Monitor to identify the process initiating the outgoing connection.

The Process Name field displays the name of the process that initiated the network (SMTP) connection. In this case, it is clear that the SMTP mailings are sent from the blat.exe console tool.

The network dump also contains information about my powershell.exe session. This was used to check the availability of port 25 on the external server:

Test-NetConnection smtp.corpmail.com -port 25

Click the Stop button to stop capturing network traffic.

The resulting traffic dump can be saved as a *.CAP file for offline analysis.

You can add additional filters by IP or MAC destination/source address, different protocols, ports, and special filters to analyze the traffic of some popular protocols (SMB, HTTP, DNS). Filters can be applied either to the captured traffic or to filter only the displayed data within the current session (Display Filter window).

For example, if you want to filter network frames, you can click on any of the values in the list of packets and then choose Add [something] to Display Filter.

Filter network frames using display filters in Network Monitor

In the screenshot, I have added a filtering rule by destination IP address. The following code has been added to the filter prompt:

Destination == "ip_adress"

Network Monitor filter examples

Below are some examples of commonly used Network Monitor filters.

Filter by destination IP address:

IPv4.SourceAddress == 192.168.0.1

Filter by source or destination IP:

IPv4.Address == 192.168.0.1

Filter by TCP port number:

tcp.port == 443
OR
Payloadheader.LowerProtocol.port == 443

Port ranges can be specified:

(udp.Port>=10000 && udp.port<=19999)

In this article, we looked at how to capture and analyze network traffic in Windows using Microsoft Network Monitor. You can also use the built-in PktMon console command in Windows to dump traffic without having to install a Network Monitor on each computer. A dump taken with such a command line tool can be further analyzed on any computer with NetMon or Wireshark installed.

1 comment
2
Facebook Twitter Google + Pinterest
previous post
How to Install Node.js and NPM (Package Manager) on Windows
next post
Bridging Multiple Network Interfaces on Windows

Related Reading

Unable to Map Drive: An extended error has...

May 13, 2025

Map a Network Drive over SSH (SSHFS) in...

May 13, 2025

Configure NTP Time Source for Active Directory Domain

May 6, 2025

How to Cancel Windows Update Pending Restart Loop

May 6, 2025

View Windows Update History with PowerShell (CMD)

April 30, 2025

1 comment

Shlomi November 15, 2024 - 10:16 am

Many thanks man!
you always suprises

Reply

Leave a Comment Cancel Reply

join us telegram channel https://t.me/woshub
Join WindowsHub Telegram channel to get the latest updates!

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMware
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • Map a Network Drive over SSH (SSHFS) in Windows

    May 13, 2025
  • Configure NTP Time Source for Active Directory Domain

    May 6, 2025
  • Cannot Install Network Adapter Drivers on Windows Server

    April 29, 2025
  • Change BIOS from Legacy to UEFI without Reinstalling Windows

    April 21, 2025
  • How to Prefer IPv4 over IPv6 in Windows Networks

    April 9, 2025
  • Load Drivers from WinPE or Recovery CMD

    March 26, 2025
  • How to Block Common (Weak) Passwords in Active Directory

    March 25, 2025
  • Fix: The referenced assembly could not be found error (0x80073701) on Windows

    March 17, 2025
  • Exclude a Specific User or Computer from Group Policy

    March 12, 2025
  • AD Domain Join: Computer Account Re-use Blocked

    March 11, 2025

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • How to Allow Multiple RDP Sessions on Windows 10 and 11
  • How to Run Program without Admin Privileges and Bypass UAC Prompt
  • Fix: BSOD Error 0x0000007B (INACCESSABLE_BOOT_DEVICE) on Windows
  • Fixing ‘The Network Path Was Not Found’ 0x80070035 Error Code on Windows
  • How to Delete Old User Profiles in Windows
  • How to Install Remote Server Administration Tools (RSAT) on Windows
  • How to Backup and Copy Local Group Policy Settings to Another Computer
Footer Logo

@2014 - 2024 - Windows OS Hub. All about operating systems for sysadmins


Back To Top