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
RegSetValueorCreateFileevents). - 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
.exefile while monitoring with ProcMon.- The analyst sets a filter to only show events from the malware's process ID (PID).
- The logs show a
RegSetValueoperation targeting the keyHKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run. - 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.
- ProcMon logs show multiple
CreateFileandWriteFileoperations. The analyst notices the malware writing a file namedkey.datto the%TEMP%directory. This is likely the encryption key. - 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).
- ProcMon logs show multiple
- 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 FOUNDresult for a DLL file the program attempts to load, the analyst immediately knows the program is failing due to a missing dependency.