Detection rules › Sigma

PSexec service installation

Status
experimental
Severity
medium
Log source
product windows, service ['system', 'security']
Author
mdecrevoisier
Source
github.com/mdecrevoisier/SIGMA-detection-rules

Detects scenarios where an attacker installs PSexec service.

MITRE ATT&CK coverage

Event coverage

Rule body yaml

title: PSexec service installation
description: Detects scenarios where an attacker installs PSexec service.
references:
- https://github.com/mdecrevoisier/EVTX-to-MITRE-Attack/tree/master/TA0003-Persistence/T1543.003-Create%20or%20Modify%20System%20Process-Windows%20Service
- https://attack.mitre.org/software/S0029/
- https://pentera.io/blog/135-is-the-new-145/
- https://nv2lt.github.io/windows/smb-psexec-smbexec-winexe-how-to/
- https://www.synacktiv.com/publications/traces-of-windows-remote-command-execution.html
tags:
- attack.privilege_execution
- attack.t1543.003
author: mdecrevoisier
status: experimental
logsource:
  product: windows
  service: 
    - system
    - security
detection:
  selection_service_install:
    EventID:
      - 4697 # SECURITY logs: new service
      - 7045 # SYSTEM logs: new service
    ServiceName|contains: PSEXESVC

  selection_service_privilege:
    EventID: 4674
    ObjectServer: 'SC Manager'
    ProcessName|endswith: '\services.exe' # full path 'C:\Windows\System32\services.exe'
    ObjectName: PSEXESVC

  condition: selection_service_install or selection_service_privilege
falsepositives:
- Administrator activity
level: medium

Stages and Predicates

Stage 0: condition

selection_service_install or selection_service_privilege

Stage 1: selection_service_install

selection_service_install:
  EventID:
    - 4697
    - 7045
  ServiceName|contains: PSEXESVC

Stage 2: selection_service_privilege

selection_service_privilege:
  EventID: 4674
  ObjectServer: 'SC Manager'
  ProcessName|endswith: '\services.exe'
  ObjectName: PSEXESVC

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
ObjectNameeq
  • PSEXESVC
ObjectServereq
  • SC Manager corpus 2 (sigma 1, kusto 1)
ProcessNameends_with
  • \services.exe
ServiceNamematch
  • PSEXESVC