☼
⌃
☰

ProcMon

Table of Contents

ProcMon (Process Monitor)

Description

Process Monitor (ProcMon) is a free utility from Microsoft's Sysinternals suite. It is a powerful tool for dynamic analysis, the process of observing a program's behavior while it is running. Unlike static analysis (like PeStudio) which looks at the file structure, ProcMon provides a granular, chronological record of every action a process takes on the system.

Key Functions and Features

  • Event Logging: ProcMon captures and displays hundreds of thousands of events instantly, including:
    • File System Activity: Every read, write, and access attempt on files and directories (e.g., malware dropping a new file).
    • Registry Activity: Every query, set, and delete operation on registry keys and values (e.g., malware setting itself to run at startup).
    • Process and Thread Activity: Creation, start, exit, and load operations (e.g., malware injecting code into another legitimate process).
  • Filtering and Organization: Given the massive volume of data it collects, its most critical feature is the ability to set complex filters to isolate the activity of a single process (the suspected malware) or to show only specific types of events (e.g., only RegSetValue or CreateFile events).
  • Stack Tracing: It can capture the thread stack for each operation, allowing the analyst to determine where in the malicious program's code the action was initiated.

Examples

  • Identifying Persistence Mechanisms: An analyst runs a suspicious .exe file while monitoring with ProcMon.
    1. The analyst sets a filter to only show events from the malware's process ID (PID).
    2. The logs show a RegSetValue operation targeting the key HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run.
    3. Conclusion: The malware is attempting to establish persistence by setting a registry key that ensures it runs every time the user logs in.
  • Tracking Dropped Files and Command-and-Control (C2): A ransomware sample is executed.
    1. ProcMon logs show multiple CreateFile and WriteFile operations. The analyst notices the malware writing a file named key.dat to the %TEMP% directory. This is likely the encryption key.
    2. The logs also show the process attempting to load or execute a network-related DLL (though network activity is better tracked by other tools, the attempt is visible).
  • Troubleshooting Application Issues (Non-Malware Use): A legitimate application fails to start. ProcMon can be used to capture all events related to the application. If the logs show a NAME NOT FOUND result for a DLL file the program attempts to load, the analyst immediately knows the program is failing due to a missing dependency.