Files
splunk-security_content/detections/powershell_get_sedebug.yml

114 lines
4.2 KiB
YAML

asset_type: Windows
confidence: medium
creation_date: '2018-08-28'
data_metadata:
data_eventtypes:
- wineventlog_security
data_source:
- Windows Event Logs
providing_technologies:
- Microsoft Windows
description: This search looks for PowerShell requesting privileges consistent with
credential dumping.
detect:
splunk:
correlation_rule:
notable:
nes_fields: user, dest
rule_description: Possible attempt at credential dumping via PowerShell was
detected on $dest$ by $user$.
rule_title: Event Code 4703 Specifying PowerShell Acquiring A Token with SeDebugPrivilege
Identified on $dest$.
risk:
risk_object: dest
risk_object_type:
- system
risk_score: 40
schedule:
cron_schedule: 0 * * * *
earliest_time: -70m@m
latest_time: -10m@m
search: eventtype=wineventlog_security signature_id=4703 Process_Name=*powershell.exe
| rex field=Message "Enabled Privileges:\s+(?<privs>\w+)\s+Disabled Privileges:"
| where privs="SeDebugPrivilege" | stats count min(_time) as firstTime max(_time)
as lastTime by dest, Process_Name, privs, Process_ID, Message | rename privs
as "Enabled Privilege" | rename Process_Name as process | `security_content_ctime(firstTime)`|
`security_content_ctime(lastTime)`
suppress:
suppress_fields: user, dest, process
suppress_period: 86400s
eli5: This search looks for Windows Event Code(signature_id) 4703 (token right adjusted),
where the process requesting the token change is PowerShell.exe and the requested
privilege is "SeDebugPrivilege". This is consistent with the use of PowerShell to
execute Mimikatz using sekurlsa::logonpasswords. It will return the host where the
activity occurred, the process and associated id, the enabled privilege, and the
message in the event.
entities:
- dest
how_to_implement: 'You must be ingesting Windows Security logs. You must also enable
the account change auditing here: http://docs.splunk.com/Documentation/Splunk/7.0.2/Data/MonitorWindowseventlogdata.
Additionally, this search requires you to enable your Group Management Audit Logs
in your Local Windows Security Policy and to be ingesting those logs. More information
on how to enable them can be found here: http://whatevernetworks.com/auditing-group-membership-changes-in-active-directory/.
Finally, please make sure that the local administrator group name is "Administrators"
to be able to look for the right group membership changes.'
id: 98917be2-bfc8-475a-8618-a9bb06575188
investigations:
- id: bc91a8cf-35e7-4bb2-8140-e756cc06fd76
name: Get Authentication Logs For Endpoint
type: splunk
- id: fecf2918-670d-4f1c-872b-3d7317a41bf9
name: Get Parent Process Info
type: splunk
- id: fdcfb369-1725-4c24-824a-22972d7f0d55
name: Get Risk Modifiers For User
type: splunk
- id: bc91a8cf-35e7-4bb2-8140-e756cc06fd71
name: Get Process Info
type: splunk
- id: 3d6c3213-5fff-4a1e-b57d-b24c262171e7
name: Get Notable History
type: splunk
- id: f3fb4d1b-5f33-4b01-b541-c7af9534c242
name: Get Notable Info
type: splunk
- id: fdcfb369-1725-4c24-824a-22972d7f0d65
name: Get Risk Modifiers For Endpoint
type: splunk
- id: bc91a8cf-35e7-4bb2-8140-e756cc06fd74
name: Get User Information from Identity Table
type: splunk
known_false_positives: The activity may be legitimate. PowerShell is often used by
administrators to perform various tasks, and it's possible this event could be generated
in those cases. In these cases, false positives should be fairly obvious and you
may need to tweak the search to eliminate noise.
maintainers:
- company: Splunk
email: rvaldez@splunk.com
name: Rico Valdez
mappings:
cis20:
- CIS 3
- CIS 5
- CIS 16
kill_chain_phases:
- Actions on Objectives
mitre_attack:
- Credential Access
- Credential Dumping
nist:
- PR.IP
- PR.AC
- DE.CM
modification_date: '2019-02-27'
name: Detect Mimikatz Via PowerShell And EventCode 4703
original_authors:
- company: Splunk
email: rvaldez@splunk.com
name: Rico Valdez
references: []
security_domain: access
spec_version: 2
type: splunk
version: '2.0'