
Interpreting Procmon Captured Operations and Underlying Mechanisms
Article Overview and Navigation
- I. Introduction Brief overview of Process Monitor (Procmon) and the purpose of this technical document.
- II. Key Table: Procmon Captured Operations Detailed explanation of the table structure and the comprehensive table listing operations captured by Procmon.
- III. Detailed Explanation of Capture Mechanisms Elucidation of the kernel-mode techniques Procmon uses to intercept system activity across different categories.
- IV. Limitations of Procmon Discussion of the constraints and limitations of Process Monitor in capturing system events.
1. Introduction
1.1. Overview of Procmon
Process Monitor (Procmon), a cornerstone utility from the Sysinternals suite, provides unparalleled real-time observation capabilities for file system, registry, process and thread, and network activities within the Microsoft Windows operating system. It represents an amalgamation and significant enhancement of legacy Sysinternals tools, namely Filemon (for file system monitoring) and Regmon (for registry monitoring), extending their features with a rich, non-destructive filtering mechanism, comprehensive event properties including session IDs and user names, reliable process information, and full thread stacks with integrated symbol support. This document delves into its advanced application for profound system analysis, targeting users who seek to understand the intricacies of its data capture.
1.2. Purpose of this Document
This article is intended as a definitive technical reference for advanced practitioners. Its primary objective is to deliver an exhaustive analysis of the operations that Process Monitor is capable of capturing. A significant emphasis is placed on detailing the precise actions performed on Windows kernel objects and their associated system data structures. Furthermore, this document elucidates the underlying NT Native APIs, kernel mechanisms (such as I/O Request Packets - IRPs, and callbacks), and the specific Windows components involved in these operations.
2. Key Table: Procmon Captured Operations
2.1. Table Structure Explanation
To ensure clarity and facilitate in-depth understanding, the table is structured with the following columns for each captured operation:
- Operation Class: This column denotes the broad category to which the operation belongs (e.g., File System, Registry, Process and Thread, Network Activity, Profiling Events). This classification aligns with how Procmon typically groups events and allows for a more organized approach to analysis.
- Operation Name: This column lists the precise name of the operation as it is commonly displayed by Process Monitor in its event listing (e.g., CreateFile, RegOpenKey, Process Create, TCP Connect).
- Specific Action(s), Target Object, and System-Level Effect: This is the most critical column, demanding and providing extreme detail. For each operation, it offers a granular breakdown of:
- The specific actions the operation can perform. If an operation serves multiple purposes (e.g., CreateFile can open, create, query attributes, etc.), these distinct sub-actions are enumerated.
- The primary type of Windows kernel object (e.g., FILE_OBJECT, KEY_OBJECT, EPROCESS, ETHREAD, DEVICE_OBJECT, SECTION_OBJECT, TOKEN_OBJECT, Named Pipe, Mailslot) or logical entity being acted upon is clearly identified.
- The specific kernel-level data structures, attributes, or system states that are typically read, created, queried, or modified are detailed. Examples include Access Control Lists (ACLs) within Security Descriptors, file allocation information (e.g., in the Master File Table - MFT for NTFS), stream data (default $DATA stream, Alternate Data Streams - ADS), registry value data within hive cells, process token attributes, Object Manager namespace entries, and fields within the Process Environment Block (PEB) or Thread Environment Block (TEB).
- It explicitly states if the operation is commonly used for critical system interactions such as:
- Modifying permissions (e.g., changing a Discretionary Access Control List - DACL or System Access Control List - SACL).
- Creating, reading, writing, or deleting Alternate Data Streams (ADS).
- Querying specific file or registry key attributes or metadata without requiring full access to the object's data.
- Opening or creating device objects or their control interfaces (e.g., for IOCTL operations).
- Interacting with synchronization objects (though direct observation of synchronization primitives is often limited in Procmon, related operations might be captured).
- Key Parameters Captured: This column lists notable parameters that Procmon logs for the operation, providing context for the event. Examples include Path, Desired Access, Disposition, Options, Result, Key Name, Value Name, Data, Image Path, Command Line, Destination Address, and Port. These parameters are crucial for filtering and understanding the specifics of each event.
- Underlying Windows API/Kernel Mechanism: This column specifies the primary NT Native API function(s) (e.g., NtCreateFile, NtOpenKeyEx, NtQuerySystemInformation), I/O Request Packet (IRP) Major/Minor Function codes (e.g., IRP_MJ_CREATE, IRP_MJ_READ, IRP_MN_QUERY_DIRECTORY), kernel callback routine context (e.g., CmRegistryCallback with a specific REG_NOTIFY_CLASS value), or Event Tracing for Windows (ETW) event provider that enables Procmon to intercept and log the operation.
- Device Destination/Component: This column identifies the primary Windows component, subsystem, or driver stack that is ultimately responsible for handling the operation or is the target of the operation. Examples include the File System Driver Stack (e.g., NTFS.SYS or FASTFAT.SYS, often via the Filter Manager FltMgr.sys), the Configuration Manager (for registry operations), the Process Manager (kernel component ntoskrnl.exe), the Object Manager (ntoskrnl.exe), or the TCP/IP Driver Stack (e.g., afd.sys, tcpip.sys, often via Winsock ETW or Windows Filtering Platform - WFP).
List of Captured Operations (Quick Navigation)
- CreateFile
- CloseFile
- ReadFile
- WriteFile
- QueryDirectory
- QueryBasicInformationFile
- QueryStandardInformationFile
- QueryNameInformationFile
- QueryNetworkOpenInformationFile
- QueryPositionInformationFile
- QueryEAFile
- QueryStreamInformationFile
- QueryAttributeTagFile
- QueryNormalizedNameInformationFile
- QueryFileInternalInformationFile
- QueryAllInformationFile (File System)
- SetBasicInformationFile
- SetDispositionInformationFile
- SetRenameInformationFile
- SetEndOfFileInformationFile
- SetAllocationInformationFile
- SetPositionInformationFile
- QuerySecurityFile
- SetSecurityFile
- FlushBuffersFile
- LockFile
- UnlockFileSingle
- DeviceIoControl
- FileSystemControl
- CreateFileMapping
- NotifyChangeDirectory
- QueryAllInformationFile (File System - Duplicate, ensure context if needed or merge)
- QueryAttributeInformationVolume
- QueryFullSizeInformationVolume
- QuerySizeInformationVolume
- QueryObjectIdInformationVolume
- QueryDeviceInformationVolume
- QueryOpen
- QueryRemoteProtocolInformation
- RegOpenKey
- RegCreateKey
- RegCloseKey
- RegQueryValue
- RegSetValue
- RegDeleteKey
- RegDeleteValue
- RegEnumKey
- RegEnumValue
- RegQueryKey
- RegSetInfoKey
- RegQueryKeySecurity
- RegSetKeySecurity
- RegLoadKey
- RegUnloadKey
- RegFlushKey
- RegQueryMultipleValueKey
- Process Create
- Process Start
- Process Exit
- Thread Create
- Thread Exit
- Load Image
- TCP Connect
- TCP Accept
- TCP Disconnect
- TCP Receive
- TCP Send
- TCP Reconnect
- TCP Retransmit
- TCP TCPCopy
- UDP Send
- UDP Receive
- Process Profiling
Operation Class | Operation Name | Specific Action(s), Target Object, and System-Level Effect | Key Parameters Captured | Underlying Windows API/Kernel Mechanism | Device Destination/Component |
---|---|---|---|---|---|
File System | CreateFile |
|
Path, Result, Desired Access, Disposition, Options, ShareMode, AllocationSize, FileAttributes, Impersonation, Security QOS, EaBuffer. | NtCreateFile / ZwCreateFile . This generates an IRP_MJ_CREATE. Parameters.Create.Options in the IRP contains CreateDisposition (high 8 bits) and CreateOptions (low 24 bits). Parameters.Create.SecurityContext->DesiredAccess holds access flags. Parameters.Create.ShareAccess holds sharing flags. |
I/O Manager, File System Driver Stack (e.g., NTFS.SYS, FASTFAT.SYS via FltMgr.sys ), NPFS (npfs.sys) for named pipes, MSFS (msfs.sys) for mailslots, or specific Device Driver. |
File System | CloseFile |
|
Path, Result. | NtClose / ZwClose . This initiates IRP_MJ_CLEANUP followed by IRP_MJ_CLOSE if it's the last handle/reference to the kernel object. |
I/O Manager, Object Manager, File System Driver Stack, or specific Device Driver. |
File System | ReadFile |
|
Path, Result, Offset, Length, I/O Flags (e.g., Paging I/O, Non-cached), Priority, Buffer. | NtReadFile / ZwReadFile . This generates an IRP_MJ_READ. Parameters.Read.Length, Parameters.Read.ByteOffset, Parameters.Read.Key are key IRP parameters. Data transfer uses Irp->AssociatedIrp.SystemBuffer for buffered I/O or Irp->MdlAddress for direct I/O. |
I/O Manager, Cache Manager, File System Driver Stack (e.g., NTFS.SYS via FltMgr.sys), or specific Device Driver. |
File System | WriteFile |
|
Path, Result, Offset, Length, I/O Flags (e.g., Paging I/O, Non-cached, Write Through), Priority, Buffer. | NtWriteFile / ZwWriteFile . This generates an IRP_MJ_WRITE. Parameters.Write.Length, Parameters.Write.ByteOffset, Parameters.Write.Key are key IRP parameters. Data transfer uses Irp->AssociatedIrp.SystemBuffer for buffered I/O or Irp->MdlAddress for direct I/O. |
I/O Manager, Cache Manager, File System Driver Stack (e.g., NTFS.SYS via FltMgr.sys), or specific Device Driver. |
File System | QueryDirectory |
|
Path, Result, Filter (wildcard pattern), FileInformationClass, Length (of buffer). | NtQueryDirectoryFile / ZwQueryDirectoryFile , NtQueryDirectoryFileEx / ZwQueryDirectoryFileEx . This generates an IRP_MJ_DIRECTORY_CONTROL with minor function IRP_MN_QUERY_DIRECTORY. Key IRP parameters include IrpSp->Parameters.QueryDirectory.Length, IrpSp->Parameters.QueryDirectory.FileName, IrpSp->Parameters.QueryDirectory.FileInformationClass, IrpSp->Parameters.QueryDirectory.FileIndex, and IrpSp->Parameters.QueryDirectory.DirectoryBuffer or MdlAddress. |
I/O Manager, File System Driver Stack (e.g., NTFS.SYS via FltMgr.sys). |
File System | QueryBasicInformationFile |
|
Path, Result, FileInformationClass (FileBasicInformation), Length, Buffer (receives FILE_BASIC_INFORMATION). | NtQueryInformationFile / ZwQueryInformationFile . This generates an IRP_MJ_QUERY_INFORMATION. Parameters.QueryFile.FileInformationClass is FileBasicInformation. |
I/O Manager, File System Driver Stack. |
File System | QueryStandardInformationFile |
|
Path, Result, FileInformationClass (FileStandardInformation), Length, Buffer (receives FILE_STANDARD_INFORMATION). | NtQueryInformationFile / ZwQueryInformationFile . This generates an IRP_MJ_QUERY_INFORMATION. Parameters.QueryFile.FileInformationClass is FileStandardInformation. |
I/O Manager, File System Driver Stack. |
File System | QueryNameInformationFile |
|
Path, Result, FileInformationClass (FileNameInformation), Length, Buffer (receives FILE_NAME_INFORMATION). | NtQueryInformationFile / ZwQueryInformationFile . This generates an IRP_MJ_QUERY_INFORMATION. Parameters.QueryFile.FileInformationClass is FileNameInformation. |
I/O Manager, File System Driver Stack. |
File System | QueryNetworkOpenInformationFile |
|
Path, Result, FileInformationClass (FileNetworkOpenInformation), Length, Buffer. | NtQueryInformationFile / ZwQueryInformationFile . Generates an IRP_MJ_QUERY_INFORMATION. Parameters.QueryFile.FileInformationClass is FileNetworkOpenInformation. |
I/O Manager, File System Driver Stack, Network Redirector. |
File System | QueryPositionInformationFile |
|
Path, Result, FileInformationClass (FilePositionInformation), Length, Buffer. | NtQueryInformationFile / ZwQueryInformationFile . Generates an IRP_MJ_QUERY_INFORMATION. Parameters.QueryFile.FileInformationClass is FilePositionInformation. |
I/O Manager. |
File System | QueryEAFile |
|
Path, Result, FileInformationClass (FileEaInformation or related), Length, Buffer. | NtQueryEaFile / ZwQueryEaFile (more likely than NtQueryInformationFile for full EA query). NtQueryInformationFile with FileEaInformation retrieves a summary (FILE_EA_INFORMATION structure: EaSize). Generates IRP_MJ_QUERY_EA. |
I/O Manager, File System Driver Stack. |
File System | QueryStreamInformationFile |
|
Path, Result, FileInformationClass (FileStreamInformation), Length, Buffer. | NtQueryInformationFile / ZwQueryInformationFile . Generates an IRP_MJ_QUERY_INFORMATION. Parameters.QueryFile.FileInformationClass is FileStreamInformation. |
I/O Manager, File System Driver Stack (primarily NTFS). |
File System | QueryAttributeTagFile |
|
Path, Result, FileInformationClass (FileAttributeTagInformation), Length, Buffer. | NtQueryInformationFile / ZwQueryInformationFile . Generates an IRP_MJ_QUERY_INFORMATION. Parameters.QueryFile.FileInformationClass is FileAttributeTagInformation. |
I/O Manager, File System Driver Stack. |
File System | QueryNormalizedNameInformationFile |
|
Path, Result, FileInformationClass (FileNormalizedNameInformation), Length, Buffer. | NtQueryInformationFile / ZwQueryInformationFile . Generates an IRP_MJ_QUERY_INFORMATION. Parameters.QueryFile.FileInformationClass is FileNormalizedNameInformation. |
I/O Manager, File System Driver Stack. |
File System | QueryFileInternalInformationFile |
|
Path, Result, FileInformationClass (FileInternalInformation), Length, Buffer. | NtQueryInformationFile / ZwQueryInformationFile . Generates an IRP_MJ_QUERY_INFORMATION. Parameters.QueryFile.FileInformationClass is FileInternalInformation. |
I/O Manager, File System Driver Stack. |
File System | QueryAllInformationFile |
|
Path, Result, FileInformationClass (FileAllInformation), Length, Buffer. | NtQueryInformationFile / ZwQueryInformationFile . Generates an IRP_MJ_QUERY_INFORMATION. Parameters.QueryFile.FileInformationClass is FileAllInformation. |
I/O Manager, File System Driver Stack. |
File System | SetBasicInformationFile |
|
Path, Result, FileInformationClass (FileBasicInformation), Length, Buffer (contains FILE_BASIC_INFORMATION). | NtSetInformationFile / ZwSetInformationFile . Generates an IRP_MJ_SET_INFORMATION. Parameters.SetFile.FileInformationClass is FileBasicInformation. |
I/O Manager, File System Driver Stack. |
File System | SetDispositionInformationFile |
|
Path, Result, FileInformationClass (FileDispositionInformation or FileDispositionInformationEx), DeleteFile (BOOLEAN). | NtSetInformationFile / ZwSetInformationFile . Generates an IRP_MJ_SET_INFORMATION. Parameters.SetFile.FileInformationClass is FileDispositionInformation or FileDispositionInformationEx. |
I/O Manager, File System Driver Stack. |
File System | SetRenameInformationFile |
|
Path, Result, FileInformationClass (FileRenameInformation or FileRenameInformationEx), ReplaceIfExists, TargetFileName. | NtSetInformationFile / ZwSetInformationFile . Generates an IRP_MJ_SET_INFORMATION. Parameters.SetFile.FileInformationClass is FileRenameInformation or FileRenameInformationEx. |
I/O Manager, File System Driver Stack. |
File System | SetEndOfFileInformationFile |
|
Path, Result, FileInformationClass (FileEndOfFileInformation), EndOfFile. | NtSetInformationFile / ZwSetInformationFile . Generates an IRP_MJ_SET_INFORMATION. Parameters.SetFile.FileInformationClass is FileEndOfFileInformation. |
I/O Manager, File System Driver Stack. |
File System | SetAllocationInformationFile |
|
Path, Result, FileInformationClass (FileAllocationInformation), AllocationSize. | NtSetInformationFile / ZwSetInformationFile . Generates an IRP_MJ_SET_INFORMATION. Parameters.SetFile.FileInformationClass is FileAllocationInformation. |
I/O Manager, File System Driver Stack. |
File System | SetPositionInformationFile |
|
Path, Result, FileInformationClass (FilePositionInformation), Position. | NtSetInformationFile / ZwSetInformationFile . Generates an IRP_MJ_SET_INFORMATION. Parameters.SetFile.FileInformationClass is FilePositionInformation. |
I/O Manager. |
File System | QuerySecurityFile |
|
Path, Result, SecurityInformation, Length, Buffer (receives SECURITY_DESCRIPTOR). | NtQuerySecurityObject / ZwQuerySecurityObject . This generates an IRP_MJ_QUERY_SECURITY. |
I/O Manager, File System Driver Stack, Security Reference Monitor. |
File System | SetSecurityFile |
|
Path, Result, SecurityInformation, SecurityDescriptor. | NtSetSecurityObject / ZwSetSecurityObject . This generates an IRP_MJ_SET_SECURITY. Key IRP parameters are IrpSp->Parameters.SetSecurity.SecurityInformation and IrpSp->Parameters.SetSecurity.SecurityDescriptor. |
I/O Manager, File System Driver Stack, Security Reference Monitor. |
File System | FlushBuffersFile |
|
Path, Result, Flags (for Ex version). | NtFlushBuffersFile / ZwFlushBuffersFile , NtFlushBuffersFileEx / ZwFlushBuffersFileEx . This generates an IRP_MJ_FLUSH_BUFFERS. |
I/O Manager, Cache Manager, File System Driver Stack. |
File System | LockFile |
|
Path, Result, Offset, Length, ExclusiveLock (BOOLEAN), FailImmediately (BOOLEAN), Key. | NtLockFile / ZwLockFile . This generates an IRP_MJ_LOCK_CONTROL with minor function IRP_MN_LOCK. Key IRP parameters include IrpSp->Parameters.LockControl.Length, ByteOffset, Key, FailImmediately, ExclusiveLock. |
I/O Manager, File System Driver Stack. |
File System | UnlockFileSingle |
|
Path, Result, Offset, Length, Key. | NtUnlockFile / ZwUnlockFile . This generates an IRP_MJ_LOCK_CONTROL with minor function IRP_MN_UNLOCK_SINGLE. Key IRP parameters are IrpSp->Parameters.LockControl.Length, ByteOffset, Key. |
I/O Manager, File System Driver Stack. |
File System | DeviceIoControl |
|
Path, Result, IoControlCode (Control Code), InputBuffer, OutputBuffer, InputBufferLength, OutputBufferLength. | NtDeviceIoControlFile / ZwDeviceIoControlFile . This generates an IRP_MJ_DEVICE_CONTROL. Key IRP parameters are IrpSp->Parameters.DeviceIoControl.IoControlCode, InputBufferLength, OutputBufferLength, and buffer pointers depending on buffering method. |
I/O Manager, specific Device Driver (e.g., disk driver disk.sys, volume manager volmgr.sys, partition manager partmgr.sys, custom device driver). |
File System | FileSystemControl |
|
Path, Result, FsControlCode (Control Code), InputBuffer, OutputBuffer, InputBufferLength, OutputBufferLength. | NtFsControlFile / ZwFsControlFile . This generates an IRP_MJ_FILE_SYSTEM_CONTROL. Key IRP parameters are IrpSp->Parameters.FileSystemControl.FsControlCode (for common parameters) and buffer details. Minor function codes like IRP_MN_USER_FS_REQUEST or IRP_MN_MOUNT_VOLUME can be involved. |
I/O Manager, File System Driver Stack (e.g., NTFS.SYS, FltMgr.sys). |
File System | CreateFileMapping |
|
Path (of the file being mapped), Result, Name (of the section object, if named), Protection (SectionPageProtection), MaximumSize, AllocationAttributes. | NtCreateSection / ZwCreateSection , or NtCreateSectionEx / ZwCreateSectionEx . This may involve the file system via an IRP_MJ_ACQUIRE_FOR_SECTION_SYNCHRONIZATION to ensure cache coherency and proper file locking before the section is created. |
Memory Manager, Object Manager, File System Driver Stack (for file access, cache coherency, and synchronization). |
File System | NotifyChangeDirectory |
|
Path, Result, CompletionFilter (Watch Filter), WatchTree (BOOLEAN), Buffer, Length. | NtNotifyChangeDirectoryFile / ZwNotifyChangeDirectoryFile . This generates an IRP_MJ_DIRECTORY_CONTROL with minor function IRP_MN_NOTIFY_CHANGE_DIRECTORY. Key IRP parameters are IrpSp->Parameters.NotifyDirectory.CompletionFilter and IrpSp->Parameters.NotifyDirectory.WatchTree (implicitly via ZwNotifyChangeDirectoryFile parameter). |
I/O Manager, File System Driver Stack. |
File System | QueryAllInformationFile |
|
Path, Result, FileInformationClass (FileAllInformation), Length, Buffer (receives FILE_ALL_INFORMATION). | NtQueryInformationFile / ZwQueryInformationFile . This generates an IRP_MJ_QUERY_INFORMATION. Parameters.QueryFile.FileInformationClass is FileAllInformation. |
I/O Manager, File System Driver Stack. |
File System | QueryAttributeInformationVolume |
|
Path (of file/dir on volume), Result, FsInformationClass (FileFsAttributeInformation), Length, Buffer. | NtQueryVolumeInformationFile / ZwQueryVolumeInformationFile . Generates an IRP_MJ_QUERY_VOLUME_INFORMATION. Parameters.QueryVolume.FsInformationClass is FileFsAttributeInformation. |
I/O Manager, File System Driver Stack. |
File System | QueryFullSizeInformationVolume |
|
Path, Result, FsInformationClass (FileFsFullSizeInformation), Length, Buffer. | NtQueryVolumeInformationFile / ZwQueryVolumeInformationFile . Generates an IRP_MJ_QUERY_VOLUME_INFORMATION. Parameters.QueryVolume.FsInformationClass is FileFsFullSizeInformation. |
I/O Manager, File System Driver Stack. |
File System | QuerySizeInformationVolume |
|
Path, Result, FsInformationClass (FileFsSizeInformation), Length, Buffer. | NtQueryVolumeInformationFile / ZwQueryVolumeInformationFile . Generates an IRP_MJ_QUERY_VOLUME_INFORMATION. Parameters.QueryVolume.FsInformationClass is FileFsSizeInformation. |
I/O Manager, File System Driver Stack. |
File System | QueryObjectIdInformationVolume |
|
Path, Result, FsInformationClass (FileFsObjectIdInformation), Length, Buffer. | NtQueryVolumeInformationFile / ZwQueryVolumeInformationFile . Generates an IRP_MJ_QUERY_VOLUME_INFORMATION. Parameters.QueryVolume.FsInformationClass is FileFsObjectIdInformation. |
I/O Manager, File System Driver Stack. |
File System | QueryDeviceInformationVolume |
|
Path, Result, FsInformationClass (FileFsDeviceInformation), Length, Buffer. | NtQueryVolumeInformationFile / ZwQueryVolumeInformationFile . Generates an IRP_MJ_QUERY_VOLUME_INFORMATION. Parameters.QueryVolume.FsInformationClass is FileFsDeviceInformation. |
I/O Manager, File System Driver Stack, underlying Storage Driver. |
File System | QueryOpen |
|
Path, Result, Desired Access, Disposition, Options. | NtCreateFile / ZwCreateFile . IRP_MJ_CREATE. |
I/O Manager, File System Driver Stack. |
File System | QueryRemoteProtocolInformation |
|
Path, Result, FileInformationClass (FileRemoteProtocolInformation), Length, Buffer. | NtQueryInformationFile / ZwQueryInformationFile . Generates IRP_MJ_QUERY_INFORMATION. Parameters.QueryFile.FileInformationClass is FileRemoteProtocolInformation. |
I/O Manager, Network Redirector (e.g., mrxsmb.sys), File System Driver Stack on the remote server. |
Registry | RegOpenKey |
|
Path (Key Name), Result, Desired Access, Options (for Ex version). | NtOpenKey / ZwOpenKey , NtOpenKeyEx / ZwOpenKeyEx . Intercepted via CmRegisterCallbackEx using REG_NOTIFY_CLASS values like RegNtPreOpenKey(Ex) / RegNtPostOpenKey(Ex). Callback receives structures like REG_PRE_OPEN_KEY_INFORMATION (contains PUNICODE_STRING CompleteName) or REG_POST_OPEN_KEY_INFORMATION (contains PUNICODE_STRING CompleteName, PVOID Object which is the KEY_OBJECT pointer, NTSTATUS Status). |
Configuration Manager (Registry - ntoskrnl.exe component). |
Registry | RegCreateKey |
|
Path (Key Name), Result, Desired Access, Options, Disposition. | NtCreateKey / ZwCreateKey . Intercepted via CmRegisterCallbackEx using REG_NOTIFY_CLASS like RegNtPreCreateKey(Ex) / RegNtPostCreateKey(Ex). Callback receives structures like REG_PRE_CREATE_KEY_INFORMATION (contains PUNICODE_STRING CompleteName ) or REG_CREATE_KEY_INFORMATION (contains PUNICODE_STRING CompleteName, PVOID RootObject, CreateOptions, DesiredAccess, PULONG Disposition, PVOID *ResultObject etc. ), or REG_POST_CREATE_KEY_INFORMATION (contains PUNICODE_STRING CompleteName, PVOID Object, NTSTATUS Status ). |
Configuration Manager (Registry). |
Registry | RegCloseKey |
|
Path (Key Name), Result. | NtClose / ZwClose on a registry key handle. Intercepted via CmRegisterCallbackEx using REG_NOTIFY_CLASS like RegNtPreKeyHandleClose / RegNtPostKeyHandleClose. Callback receives REG_KEY_HANDLE_CLOSE_INFORMATION (contains PVOID Object). |
Configuration Manager (Registry), Object Manager. |
Registry | RegQueryValue |
|
Path (Key Name), Value Name, Result, Type, Length (of data), Data. | NtQueryValueKey / ZwQueryValueKey . Intercepted via CmRegisterCallbackEx using REG_NOTIFY_CLASS like RegNtPreQueryValueKey / RegNtPostQueryValueKey. Callback receives REG_QUERY_VALUE_KEY_INFORMATION (contains PVOID Object, PUNICODE_STRING ValueName, KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass, PVOID KeyValueInformation, ULONG Length, PULONG ResultLength). |
Configuration Manager (Registry). |
Registry | RegSetValue |
|
Path (Key Name), Value Name, Result, Type, Length (of data), Data. | NtSetValueKey / ZwSetValueKey . Intercepted via CmRegisterCallbackEx using REG_NOTIFY_CLASS like RegNtPreSetValueKey / RegNtPostSetValueKey. Callback receives REG_SET_VALUE_KEY_INFORMATION (contains PVOID Object, PUNICODE_STRING ValueName, ULONG TitleIndex, ULONG Type, PVOID Data, ULONG DataSize). |
Configuration Manager (Registry). |
Registry | RegDeleteKey |
|
Path (Key Name), Result. | NtDeleteKey / ZwDeleteKey . Intercepted via CmRegisterCallbackEx using REG_NOTIFY_CLASS like RegNtPreDeleteKey / RegNtPostDeleteKey. Callback receives REG_DELETE_KEY_INFORMATION (contains PVOID Object). |
Configuration Manager (Registry). |
Registry | RegDeleteValue |
|
Path (Key Name), ValueName, Result. | NtDeleteValueKey / ZwDeleteValueKey . Intercepted via CmRegisterCallbackEx using REG_NOTIFY_CLASS like RegNtPreDeleteValueKey / RegNtPostDeleteValueKey. Callback receives REG_DELETE_VALUE_KEY_INFORMATION (contains PVOID Object, PUNICODE_STRING ValueName). |
Configuration Manager (Registry). |
Registry | RegEnumKey |
|
Path (Key Name), Index, Result, Name (of enumerated subkey), KeyInformationClass. | NtEnumerateKey / ZwEnumerateKey . Intercepted via CmRegisterCallbackEx using REG_NOTIFY_CLASS like RegNtPreEnumerateKey / RegNtPostEnumerateKey. Callback receives REG_ENUMERATE_KEY_INFORMATION (contains PVOID Object, ULONG Index, KEY_INFORMATION_CLASS KeyInformationClass, PVOID KeyInformation, ULONG Length, PULONG ResultLength). |
Configuration Manager (Registry). |
Registry | RegEnumValue |
|
Path (Key Name), Index, Result, Name (of enumerated value), Type, Length, Data. | NtEnumerateValueKey / ZwEnumerateValueKey . Intercepted via CmRegisterCallbackEx using REG_NOTIFY_CLASS like RegNtPreEnumerateValueKey / RegNtPostEnumerateValueKey. Callback receives REG_ENUMERATE_VALUE_KEY_INFORMATION (contains PVOID Object, ULONG Index, KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass, PVOID KeyValueInformation, ULONG Length, PULONG ResultLength). |
Configuration Manager (Registry). |
Registry | RegQueryKey |
|
Path (Key Name), Result, KeyInformationClass, Length, Buffer (containing specific KEY_XXX_INFORMATION structure). | NtQueryKey / ZwQueryKey . Intercepted via CmRegisterCallbackEx using REG_NOTIFY_CLASS like RegNtPreQueryKey / RegNtPostQueryKey. Callback receives REG_QUERY_KEY_INFORMATION (contains PVOID Object, KEY_INFORMATION_CLASS KeyInformationClass, PVOID KeyInformation, ULONG Length, PULONG ResultLength). |
Configuration Manager (Registry). |
Registry | RegSetInfoKey |
|
Path (Key Name), Result, KeySetInformationClass, Length, Buffer (containing specific KEY_SET_XXX_INFORMATION structure). | NtSetInformationKey / ZwSetInformationKey . Intercepted via CmRegisterCallbackEx using REG_NOTIFY_CLASS like RegNtPreSetInformationKey / RegNtPostSetInformationKey. Callback receives REG_SET_INFORMATION_KEY_INFORMATION (contains PVOID Object, KEY_SET_INFORMATION_CLASS KeySetInformationClass, PVOID KeySetInformation, ULONG KeySetInformationLength). |
Configuration Manager (Registry). |
Registry | RegQueryKeySecurity |
|
Path (Key Name), Result, SecurityInformation, Length, Buffer (receives SECURITY_DESCRIPTOR). | NtQuerySecurityObject / ZwQuerySecurityObject . Intercepted via CmRegisterCallbackEx using REG_NOTIFY_CLASS like RegNtPreQueryKeySecurity / RegNtPostQueryKeySecurity. Callback receives REG_QUERY_KEY_SECURITY_INFORMATION (contains PVOID Object, PSECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR SecurityDescriptor, PULONG LengthNeeded). |
Configuration Manager (Registry), Security Reference Monitor. |
Registry | RegSetKeySecurity |
|
Path (Key Name), Result, SecurityInformation, SecurityDescriptor. | NtSetSecurityObject / ZwSetSecurityObject . Intercepted via CmRegisterCallbackEx using REG_NOTIFY_CLASS like RegNtPreSetKeySecurity / RegNtPostSetKeySecurity. Callback receives REG_SET_KEY_SECURITY_INFORMATION (contains PVOID Object, PSECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR SecurityDescriptor). |
Configuration Manager (Registry), Security Reference Monitor. |
Registry | RegLoadKey |
|
Path (Target Key Name), Source File Path, Result, Flags. | NtLoadKey / ZwLoadKey , NtLoadKeyEx / ZwLoadKeyEx . Intercepted via CmRegisterCallbackEx using REG_NOTIFY_CLASS like RegNtPreLoadKey / RegNtPostLoadKey. Callback receives REG_LOAD_KEY_INFORMATION (contains PVOID Object (parent key object if loading under an existing key, or NULL), PUNICODE_STRING KeyName (target path), PUNICODE_STRING SourceFile, ULONG Flags, PHANDLE RootHandle (out)). |
Configuration Manager (Registry), File System Driver Stack (to read the hive file). |
Registry | RegUnloadKey |
|
Path (Key Name of hive root), Result. | NtUnloadKey / ZwUnloadKey , NtUnloadKeyEx / ZwUnloadKeyEx . Intercepted via CmRegisterCallbackEx using REG_NOTIFY_CLASS like RegNtPreUnLoadKey / RegNtPostUnLoadKey. Callback receives REG_UNLOAD_KEY_INFORMATION (contains PVOID Object (hive root key object), PVOID UserEvent). |
Configuration Manager (Registry). |
Registry | RegFlushKey |
|
Path (Key Name), Result. | NtFlushKey / ZwFlushKey . Intercepted via CmRegisterCallbackEx using REG_NOTIFY_CLASS like RegNtPreFlushKey / RegNtPostFlushKey. Callback receives REG_FLUSH_KEY_INFORMATION (which is a typedef for REG_DELETE_KEY_INFORMATION, containing PVOID Object). |
Configuration Manager (Registry), File System Driver Stack (to write the hive file). |
Registry | RegQueryMultipleValueKey |
|
Path (Key Name), Result, Number of Values requested/returned, Buffer (containing KEY_VALUE_ENTRY array and concatenated value data). | NtQueryMultipleValueKey / ZwQueryMultipleValueKey . Intercepted via CmRegisterCallbackEx using REG_NOTIFY_CLASS like RegNtPreQueryMultipleValueKey / RegNtPostQueryMultipleValueKey. Callback receives REG_QUERY_MULTIPLE_VALUE_KEY_INFORMATION (contains PVOID Object, PKEY_VALUE_ENTRY ValueEntries (input array), ULONG EntryCount, PVOID ValueBuffer (output buffer), PULONG BufferLength, PULONG RequiredBufferLength). |
Configuration Manager (Registry). |
Process and Thread | Process Create |
|
Image Path, Command Line, PID, Parent PID, Result, Session ID, Authentication ID, User. | NtCreateUserProcess or older NtCreateProcess(Ex) . Procmon uses PsSetCreateProcessNotifyRoutineEx or PsSetCreateProcessNotifyRoutine to register a PCREATE_PROCESS_NOTIFY_ROUTINE(_EX) callback. This callback receives ProcessId, ParentId, a BOOLEAN Create flag (TRUE for creation), and for the Ex version, a PPS_CREATE_NOTIFY_INFO structure. |
Process Manager (Kernel Executive component in ntoskrnl.exe), Object Manager, Memory Manager, Security Reference Monitor. |
Process and Thread | Process Start |
|
PID, Parent PID, Image Path, Command Line, User, Session ID. | Captured via the PCREATE_PROCESS_NOTIFY_ROUTINE(_EX) callback (from PsSetCreateProcessNotifyRoutine(Ex) ), specifically when the Create flag is TRUE and the PPS_CREATE_NOTIFY_INFO->CreationStatus indicates success, just before or as the initial thread is released to run user code. |
Process Manager (Kernel), Loader (ntdll.dll). |
Process and Thread | Process Exit |
|
PID, Exit Status, CPU Time (User and Kernel), Private Bytes, Working Set Size, Handle Count. | Captured via the PCREATE_PROCESS_NOTIFY_ROUTINE(_EX) callback (from PsSetCreateProcessNotifyRoutine(Ex) ), when the Create flag is FALSE. The PPS_CREATE_NOTIFY_INFO (if Ex version) will have its relevant fields indicating exit. |
Process Manager (Kernel), Object Manager, Memory Manager, I/O Manager (for handle cleanup). |
Process and Thread | Thread Create |
|
TID, PID, Thread Start Address, Stack Base, Stack Limit, User Stack Base, User Stack Limit, Win32 Start Address. | NtCreateThreadEx or older NtCreateThread . Procmon uses PsSetCreateThreadNotifyRoutine to register a PCREATE_THREAD_NOTIFY_ROUTINE callback. This callback receives ProcessId, ThreadId, and a BOOLEAN Create flag (TRUE for creation). |
Process Manager (Kernel), Object Manager, Memory Manager. |
Process and Thread | Thread Exit |
|
TID, PID, Exit Status, Kernel Time, User Time, Context Switches. | Captured via the PCREATE_THREAD_NOTIFY_ROUTINE callback (from PsSetCreateThreadNotifyRoutine ), when the Create flag is FALSE. |
Process Manager (Kernel), Object Manager, Memory Manager. |
Process and Thread | Load Image |
|
Image Path, Image Base, Image Size, Signed, Signature Level, Signature Type, PID (of loading process), Version, Company, Description. | Procmon uses PsSetLoadImageNotifyRoutine to register a PLOAD_IMAGE_NOTIFY_ROUTINE callback. This callback receives FullImageName (UNICODE_STRING), ProcessId (for user-mode loads), and a pointer to an IMAGE_INFO structure. |
Memory Manager (Kernel), Process Manager (Kernel), Loader (ntdll.dll for user-mode images; I/O Manager for kernel-mode drivers). |
Network Activity | TCP Connect |
|
PID, Source IP, Source Port, Destination IP, Destination Port, Result, SequenceNumber, Sent, Path (often n/a or process path). | Winsock connect() API. Intercepted via Event Tracing for Windows (ETW) events from kernel providers like Microsoft-Windows-Kernel-Network (for TCP/IP events) or Microsoft-Windows-Winsock-AFD (for AFD events). tcpip.sys handles TCP protocol logic. |
afd.sys, tcpip.sys, Network Interface Card (NIC) Driver. |
Network Activity | TCP Accept |
|
PID, Source IP (of client), Source Port (of client), Destination IP (local), Destination Port (local), Result, SequenceNumber, Received, Path. | Winsock accept() API. Intercepted via ETW events (e.g., Microsoft-Windows-Kernel-Network, Microsoft-Windows-Winsock-AFD). tcpip.sys handles TCP protocol logic. |
afd.sys, tcpip.sys, NIC Driver. |
Network Activity | TCP Disconnect |
|
PID, Source IP, Source Port, Destination IP, Destination Port, Result, SequenceNumber, Sent/Received. | Winsock closesocket() or shutdown() API. Intercepted via ETW. tcpip.sys handles TCP protocol logic. |
afd.sys, tcpip.sys, NIC Driver. |
Network Activity | TCP Receive |
|
PID, Source IP, Source Port, Destination IP, Destination Port, Result, SequenceNumber, Length (of data received), Data (first few bytes often shown). | Winsock recv() , WSARecv() etc. APIs. Intercepted via ETW. tcpip.sys handles TCP protocol logic. |
afd.sys, tcpip.sys, NIC Driver. |
Network Activity | TCP Send |
|
PID, Source IP, Source Port, Destination IP, Destination Port, Result, SequenceNumber, Length (of data sent), Data (first few bytes often shown). | Winsock send() , WSASend() etc. APIs. Intercepted via ETW. tcpip.sys handles TCP protocol logic. |
afd.sys, tcpip.sys, NIC Driver. |
Network Activity | TCP Reconnect |
|
PID, Source IP, Source Port, Destination IP, Destination Port, Result. | Application-level logic or higher-level network library behavior, ultimately using Winsock APIs like connect() . Intercepted via ETW as separate connect events. |
Application, Winsock, afd.sys, tcpip.sys. |
Network Activity | TCP Retransmit |
|
PID (of process owning the socket), Source IP, Source Port, Destination IP, Destination Port, SequenceNumber, Length. | Internal to tcpip.sys. Intercepted via ETW events from Microsoft-Windows-Kernel-Network that specifically flag retransmissions. | tcpip.sys. |
Network Activity | TCP TCPCopy |
|
PID, Source/Destination context (may not be IP/Port), Length. | Internal kernel operations within afd.sys or tcpip.sys. Intercepted via specific, low-level ETW events if available, or inferred by Procmon's network filter driver if it hooks at a point where such copies are visible. | afd.sys, tcpip.sys. |
Network Activity | UDP Send |
|
PID, Source IP, Source Port, Destination IP, Destination Port, Result, Length, Data (first few bytes). | Winsock sendto() , send() APIs. Intercepted via ETW (Microsoft-Windows-Kernel-Network, Microsoft-Windows-Winsock-AFD). tcpip.sys handles UDP protocol. |
afd.sys, tcpip.sys, NIC Driver. |
Network Activity | UDP Receive |
|
PID, Source IP, Source Port, Destination IP, Destination Port, Result, Length, Data (first few bytes). | Winsock recvfrom() , recv() APIs. Intercepted via ETW. tcpip.sys handles UDP protocol. |
afd.sys, tcpip.sys, NIC Driver. |
Profiling Events | Process Profiling |
|
PID, TID, User Time, Kernel Time, Context Switches. | Procmon driver directly queries kernel structures or uses kernel APIs like NtQuerySystemInformation with SystemPerformanceInformation or per-thread information classes. |
Process Manager (Kernel), Scheduler. |
3. Detailed Explanation of Capture Mechanisms
Process Monitor employs a sophisticated array of kernel-mode techniques to intercept and record system activity. Its ability to provide a comprehensive view of system behavior stems from its deep integration with the Windows operating system, primarily through a custom kernel-mode driver (typically named PROCMONXX.SYS, where XX is a version number). This driver utilizes several distinct mechanisms depending on the class of operation being monitored.
3.1. File System Operations
Procmon's file system monitoring capabilities are predominantly implemented using a file system minifilter driver. This driver registers with the Filter Manager (FltMgr.sys), a kernel component that provides a structured framework for third-party drivers to observe and modify I/O requests targeting file systems.
- Filter Manager and Altitudes: The Filter Manager allows multiple minifilters to attach to the file system stack for a given volume. Each minifilter is assigned a unique altitude, which is a numerical value determining its position in the I/O stack relative to other filters. A lower numerical altitude means the driver is positioned closer to the file system, while a higher altitude places it further away, closer to the I/O Manager. Procmon's driver registers itself within an appropriate load order group, likely "FSFilter Activity Monitor" (altitude range 360000-389999 ), to ensure it can see I/O requests before or after other filters like antivirus or encryption drivers. The altitude is crucial as it dictates the order in which filters process IRPs.
- IRP Interception: Once registered, Procmon's minifilter can intercept I/O Request Packets (IRPs) for various file system operations. Key IRP major functions monitored include:
- IRP_MJ_CREATE: Captured for CreateFile operations. The minifilter's pre-operation callback (PFLT_PRE_OPERATION_CALLBACK) can inspect parameters like DesiredAccess, CreateOptions, CreateDisposition, and FileName from the FLT_CALLBACK_DATA structure (specifically Data->Iopb->Parameters.Create). Post-operation callbacks (PFLT_POST_OPERATION_CALLBACK) can see the result of the operation, including the IoStatus.Status and IoStatus.Information (e.g., FILE_CREATED, FILE_OPENED).
- IRP_MJ_READ and IRP_MJ_WRITE: Captured for ReadFile and WriteFile operations. Callbacks can inspect parameters like Length, ByteOffset, and buffer details (via MdlAddress for direct I/O or by accessing system buffers for buffered I/O).
- IRP_MJ_SET_INFORMATION and IRP_MJ_QUERY_INFORMATION: Captured for operations like SetBasicInformationFile, QueryNameInformationFile, etc. The FileInformationClass parameter dictates the specific information being set or queried.
- IRP_MJ_DIRECTORY_CONTROL: Captured for QueryDirectory (IRP_MN_QUERY_DIRECTORY) and NotifyChangeDirectory (IRP_MN_NOTIFY_CHANGE_DIRECTORY).
- IRP_MJ_CLEANUP and IRP_MJ_CLOSE: Captured for CloseFile operations, allowing observation of handle closure and resource deallocation.
- IRP_MJ_QUERY_SECURITY and IRP_MJ_SET_SECURITY: Captured for QuerySecurityFile and SetSecurityFile operations, involving SECURITY_INFORMATION and SECURITY_DESCRIPTOR structures.
- IRP_MJ_DEVICE_CONTROL and IRP_MJ_FILE_SYSTEM_CONTROL: Captured for DeviceIoControl and FileSystemControl operations, respectively, allowing inspection of IOCTL and FSCTL codes.
- IRP_MJ_LOCK_CONTROL: Captured for LockFile and UnlockFileSingle operations (IRP_MN_LOCK, IRP_MN_UNLOCK_SINGLE).
- IRP_MJ_FLUSH_BUFFERS: Captured for FlushBuffersFile.
- Data Structures: The minifilter accesses IRP parameters through the FLT_CALLBACK_DATA and FLT_IO_PARAMETER_BLOCK structures provided by the Filter Manager. For example, Data->Iopb->TargetFileObject provides the FILE_OBJECT.
3.2. Registry Operations
Procmon monitors registry activity by registering a registry filtering callback routine with the Configuration Manager (the kernel component responsible for the registry).
- CmRegisterCallbackEx: The primary mechanism is the
CmRegisterCallbackEx
function. This function allows a driver to register a RegistryCallback routine. Similar to file system minifilters, an Altitude string is provided to determine the callback's position relative to other registered registry filters, ensuring an orderly notification sequence. - REG_NOTIFY_CLASS and Callback Structures: The RegistryCallback routine is invoked for various registry operations, identified by a REG_NOTIFY_CLASS enumeration value passed as an argument. This enumeration includes values for pre- and post-notifications for operations such as:
- Key creation: RegNtPreCreateKey(Ex), RegNtPostCreateKey(Ex)
- Key opening: RegNtPreOpenKey(Ex), RegNtPostOpenKey(Ex)
- Value setting: RegNtPreSetValueKey, RegNtPostSetValueKey
- Value querying: RegNtPreQueryValueKey, RegNtPostQueryValueKey
- Key deletion: RegNtPreDeleteKey, RegNtPostDeleteKey
- Value deletion: RegNtPreDeleteValueKey, RegNtPostDeleteValueKey
- Key enumeration: RegNtPreEnumerateKey, RegNtPostEnumerateKey
- Value enumeration: RegNtPreEnumerateValueKey, RegNtPostEnumerateValueKey
- Querying key information: RegNtPreQueryKey, RegNtPostQueryKey
- Setting key information: RegNtPreSetInformationKey, RegNtPostSetInformationKey
- Querying/setting security: RegNtPreQueryKeySecurity, RegNtPostQueryKeySecurity, RegNtPreSetKeySecurity, RegNtPostSetKeySecurity
- Loading/unloading hives: RegNtPreLoadKey, RegNtPostLoadKey, RegNtPreUnLoadKey, RegNtPostUnLoadKey
- Flushing keys: RegNtPreFlushKey, RegNtPostFlushKey
- Querying multiple values: RegNtPreQueryMultipleValueKey, RegNtPostQueryMultipleValueKey
- Closing key handles: RegNtPreKeyHandleClose, RegNtPostKeyHandleClose For each notification type, a specific structure (e.g., REG_PRE_CREATE_KEY_INFORMATION , REG_POST_SET_VALUE_KEY_INFORMATION , REG_QUERY_VALUE_KEY_INFORMATION ) is passed to the callback, containing operation-specific parameters like the key name, value name, data, desired access, etc. Procmon's driver inspects these structures to log the event details.
3.3. Process and Thread Operations
Monitoring of process and thread creation, deletion, and image loading is achieved through dedicated kernel notification routines:
- Process Creation/Deletion:
PsSetCreateProcessNotifyRoutineEx
(or the olderPsSetCreateProcessNotifyRoutine
) allows a driver to register a callback (PCREATE_PROCESS_NOTIFY_ROUTINE_EX). This callback is invoked by the Process Manager whenever a process is created or exits.- For creation, the callback receives the ProcessId of the new process, its ParentId, and a PPS_CREATE_NOTIFY_INFO structure (for the Ex version) containing detailed information such as the image file name (ImageFileName), command line (CommandLine), and creation status.
- For exit, the Create flag passed to the callback is FALSE.
- Thread Creation/Deletion:
PsSetCreateThreadNotifyRoutine
registers a callback (PCREATE_THREAD_NOTIFY_ROUTINE) that is notified when a thread is created or terminates. The callback receives the ProcessId and ThreadId, and a BOOLEAN flag indicating creation or deletion. - Image Loading:
PsSetLoadImageNotifyRoutine
registers a callback (PLOAD_IMAGE_NOTIFY_ROUTINE) that is invoked whenever an executable image (EXE, DLL, SYS) is mapped into memory (either user or kernel space). The callback receives the FullImageName (UNICODE_STRING), the ProcessId into which the image is loaded (0 for kernel-mode images), and a pointer to an IMAGE_INFO or IMAGE_INFO_EX structure. This structure provides the image's base address, size, signature level, and other properties.
3.4. Network Activity
Procmon captures network activity, specifically TCP and UDP operations, primarily by leveraging Event Tracing for Windows (ETW).
- ETW Providers: Windows includes several ETW providers that emit detailed events related to network operations. Key providers include:
- Microsoft-Windows-Kernel-Network: Provides low-level TCP/IP events, including connection establishment, data transfer (send/receive), disconnections, and retransmissions.
- Microsoft-Windows-Winsock-AFD: Provides events from the Ancillary Function Driver (afd.sys), which sits between user-mode Winsock applications and the kernel-mode TCP/IP stack.
- ETW Consumers: Procmon's driver acts as an ETW consumer for these network events. It creates an ETW trace session, enables the relevant providers and keywords (event types), and processes the real-time event stream. Each ETW event contains a structured payload with operation-specific data (e.g., source/destination IP addresses and ports, data length, sequence numbers for TCP). Procmon parses this payload to display network operations.
- Windows Filtering Platform (WFP): While ETW is a primary source, WFP also provides extensive capabilities for network traffic inspection and filtering at various layers of the network stack. It's plausible Procmon might also leverage WFP callout drivers for certain network data, although ETW is more commonly cited for its general network activity logging.
3.5. Profiling Events
Profiling events in Procmon provide a periodic snapshot of thread CPU usage and context switches.
- Kernel/Thread Data Structures: Procmon's driver likely accesses kernel data structures associated with each thread (KTHREAD or ETHREAD) that store performance counters. The KTHREAD structure, for instance, maintains fields for KernelTime and UserTime (accumulated CPU time spent in kernel and user mode, respectively) and ContextSwitches.
- Periodic Sampling: When profiling is enabled, the driver periodically iterates through active threads in the system. For each thread, it queries these performance metrics. The difference between the current values and the previously sampled values (or initial values for a new thread) represents the activity during that sampling interval.
- API/Mechanism: This could involve direct reading of these KTHREAD fields (requiring kernel privileges and careful synchronization) or using kernel APIs like
NtQuerySystemInformation
with specific information classes that expose thread performance data, or KeQueryRuntimeThread.
By combining these diverse kernel-mode interception techniques, Process Monitor achieves its comprehensive system monitoring capabilities, providing a detailed trace of system events that is invaluable for diagnostics, troubleshooting, and security analysis.
4. Limitations of Procmon
Despite its extensive capabilities, Process Monitor is not without limitations. Understanding these constraints is crucial for accurate interpretation of its output and for knowing when alternative tools or techniques might be necessary.
4.1. File System Operations
- Boot-Time Activity (Early Boot): While Procmon offers boot logging , it relies on its driver (PROCMONXX.SYS) being loaded. Operations occurring very early in the boot process, before the Procmon driver itself is initialized by the Filter Manager (FltMgr.sys), may not be captured. This includes activities by the bootloader, ntoskrnl.exe during its earliest initialization phases, and critical boot-start drivers loaded before FltMgr.sys and Procmon's driver.
- IRPs Bypassing FltMgr.sys: Certain specialized I/O operations or IRPs generated by kernel components might, in rare cases, bypass the standard Filter Manager stack where Procmon's minifilter resides. This is uncommon for standard file I/O but could occur with direct device interactions or non-standard FSDs.
- Data Content: Procmon logs metadata about file operations (e.g., path, offset, length) but typically does not log the actual data content of ReadFile or WriteFile operations by default, primarily for performance and log size reasons. While some data might be shown in the detail view for small operations, full data capture is not its design.
- Memory-Mapped I/O: While CreateFileMapping (backed by
NtCreateSection
) is captured, the subsequent data accesses via direct memory manipulation of the mapped view are not logged as distinct ReadFile or WriteFile operations by Procmon. Only the initial mapping and eventual unmapping/cache flushes might be visible. Page faults satisfied from the mapped file might appear as Paging I/O if the "Show Paging File I/O" option is enabled, but these are distinct from explicit file read operations. - Cache Manager Operations: Internal operations performed by the Cache Manager (e.g., read-aheads, lazy writes) are generally not directly visible as distinct Procmon events unless they result in IRPs being sent to the FSD that Procmon intercepts. The effects (e.g., data being written to disk later) are visible, but the internal Cache Manager decision-making is not.
- ReFS Dev Drives: Some user reports suggest that by default, Procmon (as of version 4.01) might not capture all file system events on Windows Dev Drives formatted with ReFS without specific configuration or due to how ReFS interacts with filter drivers for these specialized volumes.
- Filter Conflicts/Ordering: If another filter driver at a similar or conflicting altitude improperly