Detection rules › Splunk

SharpHound Keywords (PowerShell)

Group by
_time, host
Source
github.com/anvilogic-forge/armory

Sharphound can be used to collect Active Directory information in order to easily identify highly complex attack paths that would otherwise be impossible to quickly identify. Once collected information can be utilized by BloodHound to apply graph theory in order to reveal the hidden and often unintended relationships within an Active Directory environment

MITRE ATT&CK coverage

References

Event coverage

Rule body yaml

id: '5528.5784'
title: SharpHound Keywords
description: 'Sharphound can be used to collect Active Directory information in order
  to easily identify highly complex attack paths that would otherwise be impossible
  to quickly identify. Once collected information can be utilized by BloodHound to
  apply graph theory in order to reveal the hidden and often unintended relationships
  within an Active Directory environment. -- Threat Actor Association: APT29/Nobelium/Cozy
  Bear, BlackMatter, Carbanak, DarkSide, FIN12, Muddled Libra - Software Association:
  ALPHV/BlackCat, Black Basta, LockBit, Play, Qakbot/Qbot, XingLocker -- #TrendingThreat
  #Russia #Ukraine Atomics T1069.001 Test #4'
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_powershell` (TERM(EventCode=4104) OR
  "<EventID>4104<") (((TERM(-c) OR TERM(collectionmethod)) (TERM(default) OR TERM(group)
  OR TERM(localadmin) OR TERM(rdp) OR TERM(dcom) OR TERM(psremote) OR TERM(GPOLocalGroup)
  OR TERM(Session) OR TERM(ComputerOnly) OR TERM(LoggedOn) OR TERM(Trusts) OR TERM(ACL)
  OR TERM(Container) OR TERM(DcOnly) OR TERM(all))) OR ((TERM(-domaincontroller) OR
  TERM(-d)) OR TERM(ldapport) OR TERM(secureldap) OR TERM(ldapusername) OR TERM(ldappassword)
  OR TERM(DisableKerberosSigning) OR TERM(Loop) OR TERM(LoopDuration) OR TERM(LoopInterval)
  OR TERM(-Domain) OR TERM(-Stealth) OR TERM(ExcludeDomainControllers) OR TERM(-ComputerFile)
  OR TERM(LdapFilter) OR TERM(OverrideUserName) OR TERM(RealDNSName) OR TERM(CollectAllProperties)
  OR TERM(WindowsOnly))) |regex process="(?i)(-d|domaincontroller|-c|collectionmethod|DisableKerberosSigning|ldappassword|ldapusername|secureldap|ldapport|loop|OverrideUserName|RealDNSName|CollectAllProperties|WindowsOnly|LdapFilter|ComputerFile|ExcludeDomainControllers|Stealth|Domain)\s"
  | table _time, host, user, process, process_*, signature_id | bin span=1s | stats
  values(*) as * by _time, host '
techniques:
- discovery:account discovery:local account
- discovery:account discovery:domain account
- discovery:domain trust discovery
- discovery:password policy discovery
- discovery:permission groups discovery:domain groups
- discovery:permission groups discovery:local groups
- discovery:system information discovery
technique_id:
- T1087.001
- T1087.002
- T1482
- T1201
- T1069.002
- T1069.001
- T1082
data_category:
- PowerShell logs
- Process command-line parameters
references:
- https://github.com/BloodHoundAD/SharpHound3/tree/ee437a5e596bf738b91bfae0aa35d2aab3544a8f

Stages and Predicates

Stage 1: search

`get_endpoint_data` `get_endpoint_data_powershell` (TERM(EventCode=4104) OR "<EventID>4104<") (((TERM(-c) OR TERM(collectionmethod)) (TERM(default) OR TERM(group) OR TERM(localadmin) OR TERM(rdp) OR TERM(dcom) OR TERM(psremote) OR TERM(GPOLocalGroup) OR TERM(Session) OR TERM(ComputerOnly) OR TERM(LoggedOn) OR TERM(Trusts) OR TERM(ACL) OR TERM(Container) OR TERM(DcOnly) OR TERM(all))) OR ((TERM(-domaincontroller) OR TERM(-d)) OR TERM(ldapport) OR TERM(secureldap) OR TERM(ldapusername) OR TERM(ldappassword) OR TERM(DisableKerberosSigning) OR TERM(Loop) OR TERM(LoopDuration) OR TERM(LoopInterval) OR TERM(-Domain) OR TERM(-Stealth) OR TERM(ExcludeDomainControllers) OR TERM(-ComputerFile) OR TERM(LdapFilter) OR TERM(OverrideUserName) OR TERM(RealDNSName) OR TERM(CollectAllProperties) OR TERM(WindowsOnly)))

Stage 2: regex

| regex process="(?i)(-d|domaincontroller|-c|collectionmethod|DisableKerberosSigning|ldappassword|ldapusername|secureldap|ldapport|loop|OverrideUserName|RealDNSName|CollectAllProperties|WindowsOnly|LdapFilter|ComputerFile|ExcludeDomainControllers|Stealth|Domain)\s"

Stage 3: table

| table _time, host, user, process, process_*, signature_id

Stage 4: bucket

| bin span=1s

Stage 5: stats

| stats values(*) as * by _time, host

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
EventCodeeq
  • 4104 corpus 268 (splunk 268)
processregex_match
  • "(?i)(-d|domaincontroller|-c|collectionmethod|DisableKerberosSigning|ldappassword|ldapusername|secureldap|ldapport|loop|OverrideUserName|RealDNSName|CollectAllProperties|WindowsOnly|LdapFilter|ComputerFile|ExcludeDomainControllers|Stealth|Domain)\s"

Search terms

Bare-string tokens in the SPL search body. Splunk matches each token against _raw (the untyped raw event text) anywhere it appears, not against a specific field. These don't surface in the Indicators table because they aren't predicates on a known field.

StageTerm
1TERM
1"<EventID>4104<"
1"-c"
1TERM
1collectionmethod
1TERM
1default
1TERM
1group
1TERM
1localadmin
1TERM
1rdp
1TERM
1dcom
1TERM
1psremote
1TERM
1GPOLocalGroup
1TERM
1Session
1TERM
1ComputerOnly
1TERM
1LoggedOn
1TERM
1Trusts
1TERM
1ACL
1TERM
1Container
1TERM
1DcOnly
1TERM
1all
1"-domaincontroller"
1"-d"
1TERM
1ldapport
1TERM
1secureldap
1TERM
1ldapusername
1TERM
1ldappassword
1TERM
1DisableKerberosSigning
1TERM
1Loop
1TERM
1LoopDuration
1TERM
1LoopInterval
1"-Domain"
1"-Stealth"
1TERM
1ExcludeDomainControllers
1"-ComputerFile"
1TERM
1LdapFilter
1TERM
1OverrideUserName
1TERM
1RealDNSName
1TERM
1CollectAllProperties
1TERM
1WindowsOnly