Detection rules › Sigma
Privilege escalation via runas (command)
Detects scenarios where attack attempts to elevate privileges via the command runas.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Privilege Escalation | T1134.002 Access Token Manipulation: Create Process with Token |
Event coverage
| Provider | Event | Title |
|---|---|---|
| Security-Auditing | Event ID 4624 | An account was successfully logged on. |
| Security-Auditing | Event ID 4648 | A logon was attempted using explicit credentials. |
| Security-Auditing | Event ID 4688 | A new process has been created. |
Rule body yaml
title: Privilege escalation via runas (command)
description: Detects scenarios where attack attempts to elevate privileges via the command runas.
correlation: correlation between the 3 event IDs can be done over SubjectLogonId in order to get more context.
references:
- https://github.com/mdecrevoisier/EVTX-to-MITRE-Attack/tree/master/TA0004-Privilege%20Escalation/T1134-Access%20Token%20Manipulation
- https://www.elastic.co/fr/blog/how-attackers-abuse-access-token-manipulation
- http://www.pseale.com/pretend-youre-on-the-domain-with-runas-netonly
- https://blog.palantir.com/windows-privilege-abuse-auditing-detection-and-defense-3078a403d74e
tags:
- attack.privilege_escalation
- attack.t1134.002
author: mdecrevoisier
status: experimental
logsource:
product: windows
service: security
detection: # Full command: 'runas /user:<domain>\<user> cmd.exe'
selection_command:
EventID: 4688
NewProcessName|endswith: '\runas.exe'
CommandLine|contains|all:
- runas
- '/user:'
selection_login:
EventID: 4624
LogonType: 2
LogonProcessName: seclogo
#AuthenticationPackageName: Negotiate
ProcessName|endswith: '\svchost.exe'
IpAddress: '::1'
selection_swtich_cred:
EventID: 4648
TargetServerName: localhost
ProcessName|endswith: '\svchost.exe'
IpAddress: '::1 '
condition: selection_login and selection_command and selection_swtich_cred
falsepositives:
- Administrator activity
level: medium
Stages and Predicates
Stage 0: condition
selection_login and selection_command and selection_swtich_credStage 1: selection_login
selection_login:
EventID: 4624
LogonType: 2
LogonProcessName: seclogo
ProcessName|endswith: '\svchost.exe'
IpAddress: '::1'
Stage 2: selection_command
selection_command:
EventID: 4688
NewProcessName|endswith: '\runas.exe'
CommandLine|contains|all:
- runas
- '/user:'
Stage 3: selection_swtich_cred
selection_swtich_cred:
EventID: 4648
TargetServerName: localhost
ProcessName|endswith: '\svchost.exe'
IpAddress: '::1 '
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.
| Field | Kind | Values |
|---|---|---|
CommandLine | match |
|
IpAddress | eq |
|
LogonProcessName | eq |
|
LogonType | eq |
|
NewProcessName | ends_with |
|
ProcessName | ends_with |
|
TargetServerName | eq |
|