Version: 1.0.0
Author: 0xAllow
License: MIT
SysmonLens is a PowerShell-based Sysmon analysis, threat-hunting, and forensic investigation tool for Windows.
It can analyze live Sysmon telemetry or offline .evtx files, preserve all available Sysmon EventData fields, filter activity across multiple Sysmon Event IDs, build timelines and process trees, correlate activity using ProcessGuid, and export investigation results.
- Live Sysmon event analysis
- Offline
.evtxanalysis - Full Sysmon
EventDatapreservation - Process, network, DNS, registry, file, WMI, pipe, and process-access filters
- ProcessGuid-based correlation
- Process tree reconstruction
- Timeline mode
- MITRE ATT&CK context
- Renamed executable hunting
- TXT, CSV, and JSON export
detail,compact, andrawoutput views- Built-in self-test and diagnostics
- Windows PowerShell 5.1 compatibility
SysmonLens/
├── SysmonLens.ps1
├── README.md
├── LICENSE
├── CHANGELOG.md
└── examples/
└── Community-Examples.ps1
- Windows 10 / 11 or Windows Server
- Windows PowerShell 5.1+ or PowerShell 7+
- Sysmon installed for live analysis
- Permission to read:
Microsoft-Windows-Sysmon/Operational
Offline .evtx analysis does not require the Sysmon service to be running.
Run the built-in parser test:
.\SysmonLens.ps1 --self-testCheck access to the Sysmon event source:
.\SysmonLens.ps1 --diagnoseDisplay the version:
.\SysmonLens.ps1 --versionShow all available options:
.\SysmonLens.ps1 --helpStart Notepad:
notepad.exeSearch for its Sysmon Process Create event:
.\SysmonLens.ps1 `
--event 1 `
--name notepad.exeDisplay all available fields:
.\SysmonLens.ps1 `
--event 1 `
--name notepad.exe `
--view rawCompact output:
.\SysmonLens.ps1 `
--event 1 `
--view compactSysmonLens accepts several PowerShell-friendly forms:
.\SysmonLens.ps1 --event 8,10,25.\SysmonLens.ps1 --event "8,10,25".\SysmonLens.ps1 --event 8 10 25Example with MITRE ATT&CK context:
.\SysmonLens.ps1 `
--event 8,10,25 `
--mitre `
--view detailRegistry-related events:
.\SysmonLens.ps1 `
--event 12,13,14 `
--target-object '\CurrentVersion\Run'SysmonLens does not depend on a small hard-coded field list.
Each Sysmon event is converted from XML and all named EventData fields are preserved.
For Process Create events, depending on the installed Sysmon version and schema, fields can include:
RuleName
UtcTime
ProcessGuid
ProcessId
Image
FileVersion
Description
Product
Company
OriginalFileName
CommandLine
CurrentDirectory
User
LogonGuid
LogonId
TerminalSessionId
IntegrityLevel
Hashes
ParentProcessGuid
ParentProcessId
ParentImage
ParentCommandLine
ParentUser
To inspect the Sysmon schema installed on the local system:
sysmon -sLive Sysmon hunting uses a conservative default window of the newest 50 matching events.
Example:
.\SysmonLens.ps1 --event 1To expand the live search:
.\SysmonLens.ps1 `
--event 1 `
--last 5000--last is an explicit event-read limit.
Offline forensic analysis searches the complete EVTX file by default.
.\SysmonLens.ps1 `
--evtx .\case.evtx `
--timelineFilter Process Create events:
.\SysmonLens.ps1 `
--evtx .\case.evtx `
--event 1 `
--name powershell.exe `
--view rawOnly use --last when you intentionally want to restrict the offline search:
.\SysmonLens.ps1 `
--evtx .\case.evtx `
--event 1 `
--last 500The standard Sysmon log filename can also be resolved against the Windows Event Log directory:
.\SysmonLens.ps1 `
--evtx .\Microsoft-Windows-Sysmon%4Operational.evtx `
--timelineBuild a process tree from live Sysmon telemetry:
.\SysmonLens.ps1 `
--tree `
--last 1000Build a process tree from an offline EVTX:
.\SysmonLens.ps1 `
--evtx .\case.evtx `
--treeSysmonLens uses:
ProcessGuid
ParentProcessGuid
for process-tree relationships instead of relying only on PIDs.
Find a process GUID:
.\SysmonLens.ps1 `
--event 1 `
--name powershell.exe `
--fields TimeCreated,ProcessId,ProcessGuid,Image,CommandLineFollow related Sysmon activity:
.\SysmonLens.ps1 `
--guid "{PROCESS-GUID}" `
--follow-guid `
--timeline `
--last 1000For offline EVTX analysis, omit --last to correlate across the complete file.
Sysmon Network Connect events use Event ID 3.
.\SysmonLens.ps1 `
--event 3 `
--dst-port 443Filter by destination IP:
.\SysmonLens.ps1 `
--event 3 `
--dst-ip 1.1.1.1Filter by protocol:
.\SysmonLens.ps1 `
--event 3 `
--protocol tcpEvent ID 3 must be enabled in the active Sysmon configuration.
Sysmon DNS Query events use Event ID 22.
.\SysmonLens.ps1 `
--event 22 `
--query-name example.comCommon registry telemetry uses Event IDs 12, 13, and 14.
.\SysmonLens.ps1 `
--event 12,13,14 `
--target-object '\CurrentVersion\Run'Sysmon File Create events use Event ID 11.
.\SysmonLens.ps1 `
--event 11 `
--target-filename '\Temp\'You can also use:
.\SysmonLens.ps1 --preset Files --timelineSysmon Process Access uses Event ID 10.
Example:
.\SysmonLens.ps1 `
--event 10 `
--target-image lsass.exeEvent ID 10 can generate high-volume telemetry. Narrow filters are recommended.
WMI telemetry:
.\SysmonLens.ps1 `
--preset WMI `
--timelineNamed pipe telemetry:
.\SysmonLens.ps1 `
--preset Pipes `
--timelineAvailable presets:
Process
Network
DNS
Persistence
Injection
Files
WMI
Pipes
All
Example:
.\SysmonLens.ps1 `
--preset Persistence `
--since 2h `
--timelineCompare Image against OriginalFileName:
.\SysmonLens.ps1 `
--event 1 `
--renamedThis can help identify executables whose current filename differs from the original PE metadata filename.
A mismatch is not automatically malicious and should be investigated in context.
Add basic ATT&CK context:
.\SysmonLens.ps1 `
--event 8,10,25 `
--mitre `
--view detailThe MITRE field is contextual.
A Sysmon Event ID alone is not enough to determine that a technique occurred. Always evaluate the complete activity chain.
--view detailDisplays events in a readable field-by-field format.
--view compactDisplays one event per line for fast hunting.
--view rawDisplays all available PowerShell properties.
Sort results chronologically:
.\SysmonLens.ps1 `
--preset Persistence `
--timelineOffline:
.\SysmonLens.ps1 `
--evtx .\case.evtx `
--timelineDisplay selected fields:
.\SysmonLens.ps1 `
--event 1 `
--fields TimeCreated,ProcessGuid,ProcessId,Image,CurrentDirectory,CommandLine,ParentImageGroup events by a field:
.\SysmonLens.ps1 `
--event 1 `
--unique Image.\SysmonLens.ps1 `
--event 1 `
--count.\SysmonLens.ps1 `
--event 1 `
--output .\processes.json `
--format json `
--overwrite.\SysmonLens.ps1 `
--event 3 `
--output .\network.csv `
--format csv `
--overwrite.\SysmonLens.ps1 `
--preset Persistence `
--output .\persistence.txt `
--format txt `
--overwriteMonitor new live Sysmon events:
.\SysmonLens.ps1 `
--event 1 `
--watchNetwork monitoring:
.\SysmonLens.ps1 `
--preset Network `
--watch `
--poll 2Press Ctrl+C to stop.
--watch is available only for the live Sysmon event channel.
A valid Windows Event Log query can return no matching records.
SysmonLens treats this as a valid empty result:
[*] Scanned: 0 Matches: 0
0 matches.
It does not automatically treat an empty result as a Sysmon failure.
Additional commands are available in:
examples/Community-Examples.ps1
SysmonLens is intended for:
- Blue Team labs
- DFIR
- threat hunting
- detection engineering
- incident investigation
- authorized security testing
Sysmon telemetry should be treated as evidence to investigate, not as an automatic malicious/benign verdict.
0xAllow
SysmonLens is released under the MIT License.
See:
LICENSE