Repository navigation
Cmdlet Reference
All 20 exported cmdlets of WinSecHunter 2.1.0. For the same content rendered from live
metadata, run Show-WinSecHunterHelp -Markdown or see
docs/Command-Reference.md.
Tip
Show-WinSecHunterHelp -Cmdlet <name> prints syntax, every parameter and examples for one
cmdlet β always in sync with the installed build.
Sweeps local logs, remote hosts or EVTX files for every event that references an IP/CIDR.
Get-WinSecEventByIp [-IpAddress] <string[]> [-ComputerName <string[]>] [-CimSession <object[]>]
[-Credential <pscredential>] [-Authentication <string>] [-SessionOption <object>]
[-ThrottleLimit <int>] [-StartTime <datetime>] [-EndTime <datetime>] [-LastHours <int>]
[-LastDays <int>] [-Profile <string[]>] [-Category <string[]>] [-EventId <int[]>]
[-LogName <string[]>] [-MaxEvents <int>] [-DeepScan] [-NoServerSideIpFilter]
[-IncludeMessage] [-IncludeRawXml] [-PassHostStatus] [-RetryCount <int>]| Parameter | Notes |
|---|---|
-IpAddress |
IPv4, IPv6 or CIDR; multiple values allowed; pipeline-friendly |
-ComputerName / -CimSession
|
remote targets (parallel over WinRM; CIM sessions run sequentially) |
-Path |
offline .evtx files (wildcards allowed) |
-LastHours / -LastDays / -StartTime / -EndTime
|
time window; all optional |
-Profile |
hunt profile (default from configuration: IncidentResponse) |
-MaxEvents |
per-channel cap; 0 = unlimited |
-DeepScan |
drop the server-side IP gate and regex the whole record |
-PassHostStatus |
emit WinSecHostResult per target, with LogDetails per channel |
-IncludeMessage / -IncludeRawXml
|
heavier payload for deep analysis |
Get-WinSecEventByIp 203.0.113.7 -LastDays 2 -PassHostStatus
Get-WinSecEventByIp 203.0.113.0/24 -ComputerName SRV1, SRV2 -Credential (Get-Credential)
Get-WinSecEventByIp 198.51.100.9 -Path D:\Evidence\*.evtx -Profile All -DeepScanNear-real-time tail with per-log record bookmarks (polling by design).
Trace-WinSecIp [-IpAddress] <string[]> [-Profile <string[]>] [-Category <string[]>]
[-EventId <int[]>] [-LogName <string[]>] [-IntervalSeconds <int>] [-Duration <timespan>]
[-StartTime <datetime>] [-DeepScan] [-IncludeMessage]| Parameter | Notes |
|---|---|
-Duration |
total tracing time, e.g. ([timespan]::FromHours(2))
|
-IntervalSeconds |
poll interval, default from configuration |
-StartTime |
start of the first window (default: now) |
Trace-WinSecIp 203.0.113.7 -Duration ([timespan]::FromMinutes(30)) -IntervalSeconds 5Retention, size, wrap risk and accessibility per channel β proof of what the logs can answer.
Get-WinSecLogCoverage [-LogName <string[]>] [-CoveringFrom <datetime>]
Get-WinSecLogCoverage [-ComputerName <string[]>] [-Credential <pscredential>] [-ThrottleLimit <int>] ...
Get-WinSecLogCoverage -Path <string[]> ...Get-WinSecLogCoverage -LogName Security, System | Format-Table Computer, LogName, RecordCount, UsedPercent, Risk
Get-WinSecLogCoverage -Path .\Security.evtx -CoveringFrom (Get-Date).AddDays(-7)UTC buckets, ASCII histogram, top accounts and hosts, success-after-failure marker.
Get-WinSecIpTimeline [-Event] <WinSecEvent[]> [[-BucketSize] <timespan>] [[-MaxBarWidth] <int>]
[[-Top] <int>] [-AsciiChart]$events | Get-WinSecIpTimeline -BucketSize ([timespan]::FromHours(1)) -AsciiChartChains 4624 β 4672/4648 β 4634/4647 into sessions with duration and admin flag.
Get-WinSecLogonSession -Event <WinSecEvent[]> [-IncludeEnded]
Get-WinSecLogonSession -Event <WinSecEvent[]> [-ActiveOnly]
Get-WinSecLogonSession -Event <WinSecEvent[]> [-EndedOnly]| Switch | Result |
|---|---|
(none) / -IncludeEnded
|
all sessions |
-ActiveOnly |
sessions without a matching logoff β possible live footholds |
-EndedOnly |
closed sessions β dwell-time statistics |
$events | Get-WinSecLogonSession -ActiveOnly | Format-Table Account, Computer, LogonType, SourceIp, IsAdminDetects brute force, spraying, credential stuffing, lockout storms and success after failure.
Test-WinSecBruteForce [-Event] <WinSecEvent[]> [[-FailureThreshold] <int>] [[-WindowMinutes] <int>]
[[-SprayAccountThreshold] <int>] [[-SuccessWindowMinutes] <int>] [[-LockoutThreshold] <int>]
[[-MaxEvidencePerFinding] <int>]| Parameter | Default | Meaning |
|---|---|---|
-FailureThreshold |
5 (config) | failures per account before a brute-force finding |
-WindowMinutes |
10 (config) | sliding window for counting |
-SprayAccountThreshold |
5 (config) | distinct accounts that turns failures into spraying |
-SuccessWindowMinutes |
60 | how long after failures a success is still linked |
-LockoutThreshold |
3 | lockouts (4740) for a lockout storm |
$findings = $events | Test-WinSecBruteForce -WindowMinutes 30
$findings | Format-Table Pattern, Severity, TargetAccount, SourceIp, FailureCount, SuccessCountCompares effective audit policy with what the selected profiles need; emits ready-to-paste
auditpol remediation. Output is parsed positionally, so localized Windows works.
Test-WinSecAuditPolicy [[-ComputerName] <string[]>] [[-Credential] <pscredential>]
[[-ThrottleLimit] <int>] [[-Profile] <string[]>] [-IncludeCompliant]Test-WinSecAuditPolicy | Where-Object Severity -in 'High','Critical'
Test-WinSecAuditPolicy -ComputerName DC01, DC02 -IncludeCompliantOffline-first PTR and classification; optional AbuseIPDB / AlienVault OTX / ip-api.
Resolve-WinSecIpAttribution [-IpAddress] <string[]> [-Provider <string>] [-NoCache] [-CacheHours <int>]| Parameter | Notes |
|---|---|
-Provider |
None (default), AbuseIPDB, OTX, IpApi
|
-NoCache |
bypass the on-disk cache |
-CacheHours |
cache lifetime, default from configuration |
API keys come from environment variables (ABUSEIPDB_KEY, OTX_API_KEY), never parameters.
Invalid input produces a warning and does not abort a batch.
Resolve-WinSecIpAttribution 203.0.113.7 -Provider NoneExpands a CIDR into individual addresses with a safety limit.
Expand-WinSecIpRange [-Range] <string> [-MaxAddresses <int>] [-IncludeNetworkAddress] [-IncludeBroadcast]Expand-WinSecIpRange 10.0.0.0/29 -IncludeNetworkAddressExecutive, technical or full report to Markdown and self-contained HTML.
New-WinSecIncidentReport [[-Case] <WinSecCase>] [[-Event] <object[]>] [[-Finding] <object[]>]
[[-Session] <object[]>] [[-Coverage] <object[]>] [[-Attribution] <object[]>]
[[-Timeline] <object[]>] [[-Summary] <hashtable>] [[-Template] <string>]
[[-Format] <string>] [[-OutputDirectory] <string>] [[-FileName] <string>] [-PassThru]| Parameter | Values |
|---|---|
-Template |
Executive, Technical (default), Full
|
-Format |
Markdown, Html, Both (default) |
-OutputDirectory |
parent folder; files go to <CaseId>-reports/
|
New-WinSecIncidentReport -Case $case -Event $events -Finding $findings -Session $sessions `
-Template Full -Format Both -PassThruRFC 5322 .eml (plus Markdown and JSON) for the network that hosts the source address.
New-WinSecAbuseReport [[-Case] <WinSecCase>] [[-Event] <object[]>] [[-Finding] <object[]>]
[[-Attribution] <object[]>] [[-TargetIp] <string>] [[-Provider] <string>]
[[-ContactEmail] <string>] [[-ReporterName] <string>] [-ReporterEmail] <string>
[[-ReporterOrg] <string>] [[-Format] <string>] [[-OutputDirectory] <string>]
[[-FileName] <string>] [[-MaxEventsInBody] <int>] [-RedactAccounts] [-PassThru]| Parameter | Notes |
|---|---|
-ReporterEmail |
mandatory; becomes the From header |
-Provider |
Auto (default) or a provider name; Generic needs -ContactEmail
|
-Format |
Eml, Markdown, Json, All (default) |
-RedactAccounts |
consistent pseudonyms, including inside attachments |
New-WinSecAbuseReport -Case $case -Event $events -Attribution $attribution `
-ReporterEmail 'soc@contoso.com' -ReporterOrg 'Contoso SOC' -RedactAccountsIndicators as CSV, grep-friendly text, JSON or STIX 2.1.
Export-WinSecIocList [[-Case] <WinSecCase>] [[-Event] <object[]>] [[-Finding] <object[]>]
[[-Format] <string>] [[-OutputDirectory] <string>] [[-FileName] <string>] [-PassThru]Indicator types: TargetIp, SourceIp, DestinationIp, Account, Host, Process,
Service, Task, Path.
Export-WinSecIocList -Case $case -Event $events -Format Stix21 -PassThruCreates the case object that binds subject IPs, scope hosts, notes and findings.
New-WinSecCase [-SubjectIps] <string[]> [-Title <string>] [-Description <string>]
[-ScopeHosts <string[]>] [-Operator <string>]$case = New-WinSecCase -SubjectIps 203.0.113.7 -Title 'RDP brute force' -ScopeHosts VPN01
$case.AddNote('Lockouts reported 02:00-03:00 UTC')Writes the tamper-evident bundle and its SHA-256 manifest.
Export-WinSecInvestigation [[-Case] <WinSecCase>] [[-Event] <WinSecEvent[]>] [[-Finding] <object[]>]
[[-Session] <object[]>] [[-Coverage] <object[]>] [[-Attribution] <object[]>]
[[-Timeline] <object[]>] [[-Summary] <hashtable>] [[-OutputDirectory] <string>]
[[-Format] <WinSecExportFormat[]>] [[-MaxHtmlEventRows] <int>] [-PassThru]-Format: Csv, Json, Html, Markdown, CliXml, All.
Export-WinSecInvestigation -Case $case -Event $events -Finding $findings -Format All -PassThruReopens a bundle, rehydrates typed events and restores the case with its evidence table.
Import-WinSecCase [-Path] <string> [-SkipEvents]$b = Import-WinSecCase .\WSC-20261021-AB12CD34
$b.Events | Get-WinSecIpTimeline -AsciiChartVerifies manifest hashes and detects modified, missing and added files.
Test-WinSecEvidenceIntegrity [-Path] <string> [-Algorithm <string>] [-ProblemsOnly] [-Summary] [-Json]| Parameter | Notes |
|---|---|
-Algorithm |
SHA256 (default), SHA384, SHA512
|
-ProblemsOnly |
hide rows with Status = OK
|
-Summary |
one object with counts and Rows
|
-Json |
JSON document for pipelines |
$s = Test-WinSecEvidenceIntegrity .\WSC-20261021-AB12CD34 -Summary
if (-not $s.IsIntact) { $s.Rows | Where-Object Status -ne 'OK' | Format-Table }The whole toolkit at a glance, or one cmdlet in full.
Show-WinSecHunterHelp [[-Cmdlet] <string>] [[-OutFile] <string>] [-Detailed] [-Markdown] [-Plain] [-PassThru]Show-WinSecHunterHelp
Show-WinSecHunterHelp -Cmdlet New-WinSecAbuseReport
Show-WinSecHunterHelp -Markdown -OutFile .\docs\Command-Reference.mdThe catalog: 156 events, 14 profiles, ATT&CK mapping, IP-bearing fields.
Get-WinSecEventCatalog [-Category <string[]>] [-LogName <string[]>] [-Profile <string[]>]
[-EventId <int[]>] [-Importance <string>] [-AttackId <string>] [-IpMatchable]
Get-WinSecEventCatalog [-ListProfiles]Get-WinSecEventCatalog -AttackId T1021.001
Get-WinSecEventCatalog -Profile Rdp -LogName Security
Get-WinSecEventCatalog -ListProfilesGet-WinSecHunterOption [-Name] <string>
Get-WinSecHunterOption [-ShowResolved]
Set-WinSecHunterOption [-Name] <string> [-Value] <object>
Set-WinSecHunterOption -Options <hashtable>
Set-WinSecHunterOption [-Reset]Get-WinSecHunterOption
Get-WinSecHunterOption -ShowResolved # key PRESENCE, never values
Set-WinSecHunterOption -DefaultProfile BruteForce -DefaultMaxEvents 20000
Set-WinSecHunterOption -ResetSet-WinSecHunterOption supports -WhatIf and writes config.json atomically.
-ShowResolved reports whether an API key is present in the environment, never its value.
WinSecHunter v2.1.0 Β· PolyForm Noncommercial 1.0.0 Β· derivative of Get-SecurityEventsByIP.ps1 by Mikhail Deynekin
Repository Β· Changelog Β· Security policy Β· Contributing
π Home
π― Problem Domain π Getting Started π§ Architecture
π Cmdlet Reference π Detection and Analysis π Remote Collection π°οΈ Threat Intel and Attribution π‘οΈ Audit Policy Guide
π Reporting and Abuse π§Ύ Evidence and Reporting π Reference Tables
π§ Configuration π©Ί Troubleshooting and FAQ π§βπ» Development πΊοΈ Roadmap