Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3059 from Cyb3rWard0g/master
SCX RunAsProvider ExecuteShellCommand
- Loading branch information
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
Hunting Queries/Syslog/SCXRunAsProviderExecuteShellCommand.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
id: 0d298a1d-1a08-4f4b-8b28-687bfe0012e8 | ||
name: SCX RunAsProvider ExecuteShellCommand | ||
description: | | ||
'This hunting query uses Auditd security events collected via the Syslog data connector to explore the use of the SCX RunAsProvider Invoke_ExecuteShellCommand to execute any UNIX/Linux command using the /bin/sh shell. | ||
SCXcore, started as the Microsoft Operations Manager UNIX/Linux Agent, is now used in a host of products including Microsoft Operations Manager. Microsoft Azure, and Microsoft Operations Management Suite. | ||
' | ||
severity: High | ||
requiredDataConnectors: | ||
- connectorId: Syslog | ||
dataTypes: | ||
- Syslog | ||
queryFrequency: 1d | ||
queryPeriod: 1d | ||
triggerOperator: gt | ||
triggerThreshold: 0 | ||
tactics: | ||
- InitialAccess | ||
- Execution | ||
relevantTechniques: | ||
- T1190 | ||
- T1203 | ||
tags: | ||
- SimuLand | ||
query: | | ||
Syslog | ||
| parse SyslogMessage with "type=" EventType " audit(" * "): " EventData | ||
| where EventType =~ "AUOMS_EXECVE" and EventData has '/var/opt/microsoft/scx/tmp' | ||
| project TimeGenerated, EventType, Computer, EventData | ||
| parse EventData with * "syscall=" syscall " syscall_r=" * " success=" success " exit=" exit " a0" * " ppid=" ppid " pid=" pid " audit_user=" audit_user " auid=" auid " user=" user " uid=" uid " group=" group " gid=" gid "effective_user=" effective_user " euid=" euid " set_user=" set_user " suid=" suid " filesystem_user=" filesystem_user " fsuid=" fsuid " effective_group=" effective_group " egid=" egid " set_group=" set_group " sgid=" sgid " filesystem_group=" filesystem_group " fsgid=" fsgid " tty=" tty " ses=" ses " comm=\"" comm "\" exe=\"" exe "\"" * "cwd=\"" cwd "\"" * "name=\"" name "\"" * "cmdline=\"" cmdline "\" containerid=" containerid | ||
| where uid == '0' | ||
| where cwd == '/var/opt/microsoft/scx/tmp' | ||
| where comm == 'sh' | ||
| extend Timestamp = TimeGenerated, HostCustomEntity = Computer, AccountCustomEntity = user | ||
entityMappings: | ||
- entityType: Host | ||
fieldMappings: | ||
- identifier: FullName | ||
columnName: HostCustomEntity | ||
- entityType: Account | ||
fieldMappings: | ||
- identifier: FullName | ||
columnName: AccountCustomEntity | ||
version: 1.0.0 |