Sigma rule: Metasploit Or Impacket Service Installation Via SMB PsExec

A detection rule from the SigmaHQ repository, shown as its author published it. Dataset version ref-0cb431b71616, updated 2022-10-05T00:00:00.000Z.

Rule

Title
Metasploit Or Impacket Service Installation Via SMB PsExec
Status
test
Level
high
Author
Bartlomiej Czyz, Relativity
Date
2021-01-21
Modified
2022-10-05
File
rules/windows/builtin/security/win_security_metasploit_or_impacket_smb_psexec_service_install.yml
Commit
ccbb0369507f796db0b0ae6854c8a2be471b9d84

Detects usage of Metasploit SMB PsExec (exploit/windows/smb/psexec) and Impacket psexec.py by triggering on specific service installation

Log source

product
windows
service
security
definition
The 'System Security Extension' audit subcategory need to be enabled to log the EID 4697

Detection

selection:
    EventID: 4697
    ServiceFileName|re: '^%systemroot%\\[a-zA-Z]{8}\.exe$'
    ServiceName|re: '(^[a-zA-Z]{4}$)|(^[a-zA-Z]{8}$)|(^[a-zA-Z]{16}$)'
    ServiceStartType: 3  # on-demand start, see https://www.ultimatewindowssecurity.com/securitylog/encyclopedia/event.aspx?eventID=4697
    ServiceType: '0x10'
filter:
    ServiceName: 'PSEXESVC'
condition: selection and not filter

False positives (as the rule lists them)

  • Possible, different agents with a 8 character binary and a 4, 8 or 16 character service name

Tags

  • attack.lateral-movement
  • attack.t1021.002
  • attack.t1570
  • attack.execution
  • attack.t1569.002

MITRE ATT&CK ids this rule names

Related rules

References

Read on 2026-11-03T00:58:21.399Z under licence sigma-drl-1.1@d5f4c36a from https://github.com/SigmaHQ/sigma/blob/ccbb0369507f796db0b0ae6854c8a2be471b9d84/rules/windows/builtin/security/win_security_metasploit_or_impacket_smb_psexec_service_install.yml

Sources and licences

  • SigmaHQ

    "Metasploit Or Impacket Service Installation Via SMB PsExec" by Bartlomiej Czyz, Relativity (SigmaHQ). Rule: https://github.com/SigmaHQ/sigma/blob/ccbb0369507f796db0b0ae6854c8a2be471b9d84/rules/windows/builtin/security/win_security_metasploit_or_impacket_smb_psexec_service_install.yml.
    Licensed under the Detection Rule License (DRL) 1.1: https://github.com/SigmaHQ/Detection-Rule-License

    Detection Rule License (DRL) 1.1

Cite this page

Dragons Eye Ransomware Tracker, "Sigma rule: Metasploit Or Impacket Service Installation Via SMB PsExec",
entity page, dataset version ref-0cb431b71616, updated 2022-10-05T00:00:00.000Z,
https://ransomware-tracker.com/detections/sigma/6fb63b40-e02a-403e-9ffd-3bcc1d749442 (accessed 2026-11-03).
Underlying source: SigmaHQ rule 6fb63b40-e02a-403e-9ffd-3bcc1d749442, commit ccbb0369507f796db0b0ae6854c8a2be471b9d84.

Pages change. The dataset version identifies the data, but no archive of old versions is kept, so this citation cannot be replayed later.