Powershell Keylogging

Adversaries may log user keystrokes to intercept credentials as the user types them.

Sigma rule (View on GitHub)

 1title: Powershell Keylogging
 2id: 34f90d3c-c297-49e9-b26d-911b05a4866c
 3status: test
 4description: Adversaries may log user keystrokes to intercept credentials as the user types them.
 5references:
 6    - https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1218/T1218.md
 7    - https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1056.001/src/Get-Keystrokes.ps1
 8author: frack113
 9date: 2021-07-30
10modified: 2022-07-11
11tags:
12    - attack.collection
13    - attack.t1056.001
14logsource:
15    product: windows
16    category: ps_script
17    definition: 'Requirements: Script Block Logging must be enabled'
18detection:
19    selection_basic:
20        ScriptBlockText|contains: 'Get-Keystrokes'
21    selection_high: # want to run in background and keyboard
22        ScriptBlockText|contains|all:
23            - 'Get-ProcAddress user32.dll GetAsyncKeyState'
24            - 'Get-ProcAddress user32.dll GetForegroundWindow'
25    condition: 1 of selection_*
26falsepositives:
27    - Unknown
28level: medium

References

Related rules

to-top