sysmon -?Displays the basic usage help menu and command line switches for the Sysmon utility.
Microsoft Sysinternals System Monitor: logs process creation, network connections, file changes and more to the Windows (and Linux) event log.
sudo apt install sysmonforlinuxsysmon -sPrints the full supported configuration XML schema for the installed version of Sysmon.
sysmon -iInstalls the Sysmon driver and service with default settings (Process Create and Process Terminate only).
sysmon -i -nInstalls Sysmon with default settings plus Network Connection monitoring enabled.
sysmon -i -h sha256Installs Sysmon and configures the hashing algorithm to use SHA256 for image identification.
sysmon -i -h md5,sha256,imphashInstalls Sysmon configured to calculate MD5, SHA256, and IMPHASH for all process images.
sysmon -i config.xmlInstalls Sysmon using a specific XML configuration file to define rules and filters.
sysmon -dSets the name of the Sysmon driver during installation (requires uninstall/reinstall to change).
sysmon -i -l -nInstalls Sysmon with Image Loading (-l) and Network Connection (-n) monitoring enabled.
fltmc instancesLists loaded filesystem filter drivers to verify the Sysmon driver is attached to volumes.
Get-WinEvent -LogName "Microsoft-Windows-Sysmon/Operational" -MaxEvents 10Retrieves the 10 most recent events from the Sysmon Operational log using PowerShell.
Get-WinEvent -FilterHashtable @{LogName='Microsoft-Windows-Sysmon/Operational'; Id=1}Queries the Sysmon log specifically for Process Creation events (Event ID 1).
Get-WinEvent -FilterHashtable @{LogName='Microsoft-Windows-Sysmon/Operational'; Id=5}Queries for Process Termination events (Event ID 5) to track stopped processes.
Get-WinEvent -FilterHashtable @{LogName='Microsoft-Windows-Sysmon/Operational'; Id=11}Queries for File Create events (Event ID 11) to detect dropped files.
Get-WinEvent -FilterHashtable @{LogName='Microsoft-Windows-Sysmon/Operational'; Id=23}Queries for File Delete events (Event ID 23), often used for detecting wiping activity.
Get-WinEvent -FilterHashtable @{LogName='Microsoft-Windows-Sysmon/Operational'; Id=26}Queries for File Delete Detected events (Event ID 26) similar to ID 23 but logged via redirect.
Get-WinEvent -FilterHashtable @{LogName='Microsoft-Windows-Sysmon/Operational'; Id=12}Queries for Registry Event Object Create/Delete (Event ID 12).
Get-WinEvent -FilterHashtable @{LogName='Microsoft-Windows-Sysmon/Operational'; Id=13}Queries for Registry Value Set events (Event ID 13) to detect persistence changes.
Get-WinEvent -FilterHashtable @{LogName='Microsoft-Windows-Sysmon/Operational'; Id=14}Queries for Registry Key and Value Rename events (Event ID 14).
Get-WinEvent -FilterHashtable @{LogName='Microsoft-Windows-Sysmon/Operational'; Id=3}Queries for Network Connection events (Event ID 3) to trace C2 or lateral movement.
Get-WinEvent -FilterHashtable @{LogName='Microsoft-Windows-Sysmon/Operational'; Id=6}Queries for Driver Loaded events (Event ID 6) to detect rootkit or BYOVD attacks.
Get-WinEvent -FilterHashtable @{LogName='Microsoft-Windows-Sysmon/Operational'; Id=7}Queries for Image Loaded events (Event ID 7) to see DLLs loaded by processes.
Get-WinEvent -FilterHashtable @{LogName='Microsoft-Windows-Sysmon/Operational'; Id=8}Queries for CreateRemoteThread events (Event ID 8) to detect code injection.
Get-WinEvent -FilterHashtable @{LogName='Microsoft-Windows-Sysmon/Operational'; Id=9}Queries for RawAccessRead events (Event ID 9) often associated with credential dumping.
Get-WinEvent -FilterHashtable @{LogName='Microsoft-Windows-Sysmon/Operational'; Id=10}Queries for ProcessAccess events (Event ID 10) to view handle requests like LSASS access.
Get-WinEvent -FilterHashtable @{LogName='Microsoft-Windows-Sysmon/Operational'; Id=15}Queries for FileCreateStreamHash events (Event ID 15) to detect Alternate Data Streams (ADS).
Get-WinEvent -FilterHashtable @{LogName='Microsoft-Windows-Sysmon/Operational'; Id=16}Queries for ServiceConfigurationChange events (Event ID 16) to audit Sysmon rule updates.
Get-WinEvent -FilterHashtable @{LogName='Microsoft-Windows-Sysmon/Operational'; Id=17}Queries for PipeCreated events (Event ID 17) used in Cobalt Strike or lateral movement.
Get-WinEvent -FilterHashtable @{LogName='Microsoft-Windows-Sysmon/Operational'; Id=18}Queries for PipeConnected events (Event ID 18) to trace client connections to pipes.
Get-WinEvent -FilterHashtable @{LogName='Microsoft-Windows-Sysmon/Operational'; Id=19}Queries for WmiEventFilter activity (Event ID 19) to detect WMI persistence.
Get-WinEvent -FilterHashtable @{LogName='Microsoft-Windows-Sysmon/Operational'; Id=20}Queries for WmiEventConsumer activity (Event ID 20) often paired with filters for attacks.
Get-WinEvent -FilterHashtable @{LogName='Microsoft-Windows-Sysmon/Operational'; Id=21}Queries for WmiEventConsumerToFilter activity (Event ID 21) which binds consumer to filter.
Get-WinEvent -FilterHashtable @{LogName='Microsoft-Windows-Sysmon/Operational'; Id=22}Queries for DNS Query events (Event ID 22) to detect beaconing or malicious domains.
Get-WinEvent -FilterHashtable @{LogName='Microsoft-Windows-Sysmon/Operational'; Id=24}Queries for ClipboardChange events (Event ID 24) to see process clipboard capture activity.
Get-WinEvent -FilterHashtable @{LogName='Microsoft-Windows-Sysmon/Operational'; Id=25}Queries for ProcessTampering events (Event ID 25) identifying 'hollow' or 'herpaderp' images.
Get-WinEvent -FilterHashtable @{LogName='Microsoft-Windows-Sysmon/Operational'; Id=27}Queries for FileBlockExecutable events (Event ID 27) where Sysmon blocked a file write.
Get-WinEvent -FilterHashtable @{LogName='Microsoft-Windows-Sysmon/Operational'; Id=28}Queries for FileBlockShredding events (Event ID 28) typically related to SDelete activity.
Get-WinEvent -LogName Microsoft-Windows-Sysmon/Operational | Where-Object {$_.Id -eq 1 -and $_.Message -like "*powershell*"}Filters recent logs for Process Creation events involving PowerShell to detect script execution.
Get-WinEvent -LogName Microsoft-Windows-Sysmon/Operational | Group-Object Id -NoElementProvides a summary count of all Sysmon events grouped by Event ID to spot anomalies.
$Events = Get-WinEvent -LogName Microsoft-Windows-Sysmon/Operational; $Events | Where-Object {$_.Id -eq 3 -and $_.Message -match "DestinationPort: 443"}Searches for Network Connections over port 443 to correlate HTTPS traffic.
Get-WinEvent -FilterHashtable @{LogName='Microsoft-Windows-Sysmon/Operational'; Id=1} | Select-Object -First 5 | Format-ListDisplays full details of the last 5 process creation events in a readable list format.
fltmcChecks the Filter Manager Control to ensure SysmonDrv is properly registered.
reg query HKLM\SYSTEM\CurrentControlSet\Services\SysmonDrvInspects the Registry to verify the Sysmon Driver service configuration.
reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Channels\Microsoft-Windows-Sysmon/OperationalInspects the Registry settings for the Sysmon Event Log channel.
wevtutil cl Microsoft-Windows-Sysmon/OperationalClears the Sysmon Operational event log, useful when resetting a lab environment.
Copy-Item C:\Windows\System32\cmd.exe C:\Temp\mimikatz.exe; Start-Process C:\Temp\mimikatz.exeSimulates a masquerading attack (renaming cmd.exe) to test OriginalFileName detection in Event ID 1.
nslookup malicious-test-domain.comGenerates a DNS query to validate if Event ID 22 is correctly capturing domain lookups.
New-Item -Path "HKCU:\Software\TestKey" -Value "MaliciousValue"Creates a registry key to validate if Event ID 12 or 13 is capturing registry modifications.
Get-WinEvent -LogName Microsoft-Windows-Sysmon/Operational | Where-Object { $_.Id -eq 1 -and $_.Properties[13].Value -ne $_.Properties[20].Value }Compares OriginalFileName and current filename in Event ID 1 to detect masquerading programmatically.
Measure-Command { Get-WinEvent -LogName Microsoft-Windows-Sysmon/Operational -MaxEvents 1000 }Measures the time taken to query Sysmon logs to assess log volume impact on performance.
sysmon -mInstalls the event manifest manually, which can be useful if event logs are not rendering text descriptions.
sysmon -c > C:\current_sysmon_config.xmlExports the active configuration to a file for audit or backup purposes.
$p = Get-WinEvent -FilterHashtable @{LogName='Microsoft-Windows-Sysmon/Operational'; Id=1} -MaxEvents 1; Get-Process -Id $p.Properties[4].ValueRetrieves the ParentProcessId from the latest Sysmon event and looks up the running parent process.
Get-WinEvent -FilterHashtable @{LogName='Microsoft-Windows-Sysmon/Operational'; Id=15} | Select-Object -ExpandProperty MessageReads the message content of FileCreateStreamHash events to identify hidden data streams.
Get-WinEvent -LogName Microsoft-Windows-Sysmon/Operational | Where-Object { $_.Id -in 19,20,21 } | Format-Table TimeCreated,Id,Message -AutoSizeAggregates all WMI-related Sysmon events to visualize complete WMI persistence mechanisms.
sysmon -i config.xml -d mydriver -nInstalls Sysmon with a custom driver name 'mydriver' to obscure its presence from basic checks.
$hash = 'E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855'; Get-WinEvent -LogName Microsoft-Windows-Sysmon/Operational | Where-Object {$_.Message -match $hash}Searches the entire Sysmon log history for a specific SHA256 file hash.
Get-WinEvent -FilterHashtable @{LogName='Microsoft-Windows-Sysmon/Operational'; Id=10} | Where-Object {$_.Message -match 'lsass.exe'}Filters Process Access events specifically targeting lsass.exe, a key indicator of credential dumping.
wevtutil epl Microsoft-Windows-Sysmon/Operational C:\Evidence\sysmon_backup.evtxExports the current Sysmon log to an external EVTX file for offline analysis or evidence preservation.
Invoke-WebRequest -Uri 'https://internal.repo/sysmonconfig.xml' -OutFile 'C:\sysmon.xml'; sysmon -c C:\sysmon.xmlDownloads a remote configuration file and immediately updates the Sysmon configuration.
Get-WinEvent -FilterHashtable @{LogName='Microsoft-Windows-Sysmon/Operational'; Id=255}Checks for Sysmon Error events (Event ID 255) which indicate internal Sysmon failures.
sysmon -i -accepteulaInstalls Sysmon explicitly accepting the EULA (often required in automated non-interactive scripts).
sysmon -t config.xmlTests a configuration file for syntax errors without loading it (syntax depends on version, often requires dummy load).
Get-WinEvent -FilterHashtable @{LogName='Microsoft-Windows-Sysmon/Operational'; Id=18} | Group-Object -Property Properties -NoElementGroups pipe connection events to identify high-frequency pipe access which may indicate C2 beacons.
net stop sysmon; net start sysmonManually restarts the Sysmon service to clear temporary states or force a reload if hung.
sysmon -u; sc delete sysmon; del C:\Windows\Sysmon.exePerforms a manual deep clean of Sysmon artifacts if the uninstaller fails.
Exposes the operating system as a SQL database: query processes, users, ports, packages and more across Linux, macOS and Windows.
The endpoint agent for the open-source Wazuh SIEM/XDR: log collection, file-integrity monitoring and vulnerability detection.
The Linux Audit daemon: records system calls, file access and command execution according to rules, for compliance and detection.