Windows PowerShell Keylogger Function Reference in Script Block Logging

Alerts on PowerShell script blocks containing keyboard IsKeyDown references associated with potential keystroke capture.

FreeReviewedSigma · Medium · v2
Product
windows
Category
ps_script
Author
Nasreddine Bencherchali (Nextron Systems) (SigmaHQ), DRL 1.1
Published
2023-01-04
Updated
2026-07-31

ATT&CK techniques

Cred Access → Collection
  1. Recon

  2. Resource Dev

  3. Initial Access

  4. Execution

  5. Persistence

  6. Priv Esc

  7. Defense Evasion

  8. Discovery

  9. Lateral Movement

  10. C2

  11. Exfiltration

  12. Impact

What it detects

This rule flags PowerShell script text that includes a specific reference to keyboard state checks using [Windows.Input.Keyboard]::IsKeyDown with [System.Windows.Input.Key]. Such code can be used by keyloggers to capture or infer user keystrokes. It relies on Script Block Logging telemetry capturing the script content processed by PowerShell.

Related detections9 linkedT1056.001 — drag to rearrange
Suspicious Keylogger Output File in Windows Themes Folder (via file_event)
Suspicious Keylogger Capture Database Written to macOS Temp Directory
Malicious Kong RAT Keylogger Capture File Creation
Malicious BRUSHLOGGER Rundll32 Execution from ProgramData (via process_creation)
Suspicious Keylog and Screenshot Files in windows-cache Directory (OtterCookie)
Suspicious WezRat Keylog File in Temp Directory
Suspicious Larva-24009 Keylogger Log Staging in OneDrive Path (via file_event)
Suspicious Kimsuky AlphaSeed Artifacts in edge Hidden Directory (via file_event)
In-Memory Remcos RAT Keylog Store Created Under ProgramData rema (via file_event)
Windows PowerShell Keylogger Function Reference in Script Block Logging
Pivot detection · T1056.001 · 9 related

Changelog

v2
  1. v2
    Candidate ingested via manual entry.2026-07-31
  2. v1
    No changelog recorded for this version.2026-07-30

Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.