Detectionhightest

PSEXEC Remote Execution File Artefact

Detects creation of the PSEXEC key file. Which is created anytime a PsExec command is executed. It gets written to the file system and will be recorded in the USN Journal on the target system

Open in Detection LabConvert ruleBuild Package
Nasreddine BencherchaliCreated 2023-01-21Updated 2023-02-23304afd73-55a5-4bb9-8c21-0b1fc84ea9e4windows
Log Source
WindowsFile Event
ProductWindows← raw: windows
CategoryFile Event← raw: file_event

Events for file system activity including creation, modification, and deletion.

Detection Logic
Detection Logic1 selector
detection:
    selection:
        TargetFilename|startswith: 'C:\Windows\PSEXEC-'
        TargetFilename|endswith: '.key'
    condition: selection
False Positives
Unlikely

False positives are unlikely for most environments. High confidence detection.

Testing & Validation

Regression Tests

by frack113
Positive Detection Test1 matchevtx

Microsoft-Windows-Sysmon

Rule Metadata
Rule ID
304afd73-55a5-4bb9-8c21-0b1fc84ea9e4
Status
test
Level
high
Type
Detection
Created
2023-01-21
Modified
2023-02-23
Path
rules/windows/file/file_event/file_event_win_sysinternals_psexec_service_key.yml
Raw Tags
attack.lateral-movementattack.privilege-escalationattack.executionattack.persistenceattack.t1136.002attack.t1543.003attack.t1570attack.s0029
View on GitHub