Detection rules › Splunk
PowerView_SharpView Commands (PowerShell)
Adversaries may attempt to identify the primary user, currently logged in user, set of users that commonly uses a system, or whether a user is actively using the system. PowerView and its C# implementation SharpView are a series of functions that perform network and Windows domain enumeration and exploitation
MITRE ATT&CK coverage
References
Event coverage
| Provider | Event | Title |
|---|---|---|
| PowerShell | Event ID 4103 | Payload Context: ContextInfo User Data: UserData. |
| PowerShell | Event ID 4104 | Creating Scriptblock text (MessageNumber of MessageTotal). |
Rule body yaml
id: '13472.19308'
title: PowerView_SharpView Commands
description: 'Adversaries may attempt to identify the primary user, currently logged
in user, set of users that commonly uses a system, or whether a user is actively
using the system. PowerView and its C# implementation SharpView are a series of
functions that perform network and Windows domain enumeration and exploitation.
-- Software Association: ALPHV/BlackCat, Rhysida -- Atomics T1033 Test #3 Atomics
T1069.002 Test #4 Atomics T1069.002 Test #5 Atomics T1069.002 Test #6 Atomics T1069.002
Test #12 Atomics T1069.002 Test #13 Atomics T1087.002 Test #10 Atomics T1087.002
Test #11 Atomics T1135 Test #7 Atomics T1201 Test #8 Atomics T1615 Test #2'
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_powershell` (TERM(EventCode=4104) OR
TERM(<EventID>4104<) OR TERM(EventCode=4103) OR TERM(<EventID>4103<)) (TERM(Get-IPAddress)
OR TERM(Resolve-IPAddress) OR TERM(Convert-NameToSid) OR TERM(ConvertTo-SID) OR
TERM(Convert-SidToName) OR TERM(ConvertFrom-SID) OR TERM(Request-SPNTicket) OR TERM(Get-DomainSPNTicket)
OR TERM(Get-DNSZone) OR TERM(Get-DomainDNSZone) OR TERM(Get-DNSRecord) OR TERM(Get-DomainDNSRecord)
OR TERM(Get-NetDomain) OR TERM(Get-Domain) OR TERM(Get-NetDomainController) OR TERM(Get-DomainController)
OR TERM(Get-NetForest) OR TERM(Get-Forest) OR TERM(Get-NetForestDomain) OR TERM(Get-ForestDomain)
OR TERM(Get-NetForestCatalog) OR TERM(Get-ForestGlobalCatalog) OR TERM(Get-NetUser)
OR TERM(Get-DomainUser) OR TERM(Get-UserEvent) OR TERM(Get-DomainUserEvent) OR TERM(Get-NetComputer)
OR TERM(Get-DomainComputer) OR TERM(Get-ADObject) OR TERM(Get-DomainObject) OR TERM(Set-ADObject)
OR TERM(Set-DomainObject) OR TERM(Get-ObjectAcl) OR TERM(Get-DomainObjectAcl) OR
TERM(Add-ObjectAcl) OR TERM(Add-DomainObjectAcl) OR TERM(Invoke-ACLScanner) OR TERM(Find-InterestingDomainAcl)
OR TERM(Get-GUIDMap) OR TERM(Get-DomainGUIDMap) OR TERM(Get-NetOU) OR TERM(Get-DomainOU)
OR TERM(Get-NetSite) OR TERM(Get-DomainSite) OR TERM(Get-NetSubnet) OR TERM(Get-DomainSubnet)
OR TERM(Get-NetGroup) OR TERM(Get-DomainGroup) OR TERM(Find-ManagedSecurityGroups)
OR TERM(Get-DomainManagedSecurityGroup) OR TERM(Get-NetGroupMember) OR TERM(Get-DomainGroupMember)
OR TERM(Get-NetFileServer) OR TERM(Get-DomainFileServer) OR TERM(Get-DFSshare) OR
TERM(Get-DomainDFSShare) OR TERM(Get-NetGPO) OR TERM(Get-DomainGPO) OR TERM(Get-NetGPOGroup)
OR TERM(Get-DomainGPOLocalGroup) OR TERM(Find-GPOLocation) OR TERM(Get-DomainGPOUserLocalGroupMapping)
OR TERM(Find-GPOComputerAdmin) OR TERM(Get-DomainGPOComputerLocalGroupMapping) OR
TERM(Get-LoggedOnLocal) OR TERM(Get-RegLoggedOn) OR TERM(Invoke-CheckLocalAdminAccess)
OR TERM(Test-AdminAccess) OR TERM(Get-SiteName) OR TERM(Get-NetComputerSiteName)
OR TERM(Get-Proxy) OR TERM(Get-WMIRegProxy) OR TERM(Get-LastLoggedOn) OR TERM(Get-WMIRegLastLoggedOn)
OR TERM(Get-CachedRDPConnection) OR TERM(Get-WMIRegCachedRDPConnection) OR TERM(Get-RegistryMountedDrive)
OR TERM(Get-WMIRegMountedDrive) OR TERM(Get-NetProcess) OR TERM(Get-WMIProcess)
OR TERM(Invoke-ThreadedFunction) OR TERM(New-ThreadedFunction) OR TERM(Invoke-UserHunter)
OR TERM(Find-DomainUserLocation) OR TERM(Invoke-ProcessHunter) OR TERM(Find-DomainProcess)
OR TERM(Invoke-EventHunter) OR TERM(Find-DomainUserEvent) OR TERM(Invoke-ShareFinder)
OR TERM(Find-DomainShare) OR TERM(Invoke-FileFinder) OR TERM(Find-InterestingDomainShareFile)
OR TERM(Invoke-EnumerateLocalAdmin) OR TERM(Find-DomainLocalGroupMember) OR TERM(Get-NetDomainTrust)
OR TERM(Get-DomainTrust) OR TERM(Get-NetForestTrust) OR TERM(Get-ForestTrust) OR
TERM(Find-ForeignUser) OR TERM(Get-DomainForeignUser) OR TERM(Find-ForeignGroup)
OR TERM(Get-DomainForeignGroupMember) OR TERM(Invoke-MapDomainTrust) OR TERM(Get-DomainTrustMapping)
OR TERM(Get-DomainPolicy) OR TERM(Get-DomainPolicyData) OR TERM(Find-LocalAdminAccess))
| table _time, host, user process, process_*, signature_id, user | bin span=60s
| stats values(*) as * by _time, host '
techniques:
- discovery:permission groups discovery:domain groups
- execution:command and scripting interpreter:powershell
- discovery:system owner/user discovery
- discovery:network share discovery
- discovery:system network connections discovery
technique_id:
- T1069.002
- T1059.001
- T1033
- T1135
- T1049
data_category:
- PowerShell logs
references:
- https://github.com/PowerShellMafia/PowerSploit/blob/master/Recon/PowerView.ps1
- https://powersploit.readthedocs.io/en/latest/Recon/
Stages and Predicates
Stage 1: search
`get_endpoint_data` `get_endpoint_data_powershell` (TERM(EventCode=4104) OR TERM(<EventID>4104<) OR TERM(EventCode=4103) OR TERM(<EventID>4103<)) (TERM(Get-IPAddress) OR TERM(Resolve-IPAddress) OR TERM(Convert-NameToSid) OR TERM(ConvertTo-SID) OR TERM(Convert-SidToName) OR TERM(ConvertFrom-SID) OR TERM(Request-SPNTicket) OR TERM(Get-DomainSPNTicket) OR TERM(Get-DNSZone) OR TERM(Get-DomainDNSZone) OR TERM(Get-DNSRecord) OR TERM(Get-DomainDNSRecord) OR TERM(Get-NetDomain) OR TERM(Get-Domain) OR TERM(Get-NetDomainController) OR TERM(Get-DomainController) OR TERM(Get-NetForest) OR TERM(Get-Forest) OR TERM(Get-NetForestDomain) OR TERM(Get-ForestDomain) OR TERM(Get-NetForestCatalog) OR TERM(Get-ForestGlobalCatalog) OR TERM(Get-NetUser) OR TERM(Get-DomainUser) OR TERM(Get-UserEvent) OR TERM(Get-DomainUserEvent) OR TERM(Get-NetComputer) OR TERM(Get-DomainComputer) OR TERM(Get-ADObject) OR TERM(Get-DomainObject) OR TERM(Set-ADObject) OR TERM(Set-DomainObject) OR TERM(Get-ObjectAcl) OR TERM(Get-DomainObjectAcl) OR TERM(Add-ObjectAcl) OR TERM(Add-DomainObjectAcl) OR TERM(Invoke-ACLScanner) OR TERM(Find-InterestingDomainAcl) OR TERM(Get-GUIDMap) OR TERM(Get-DomainGUIDMap) OR TERM(Get-NetOU) OR TERM(Get-DomainOU) OR TERM(Get-NetSite) OR TERM(Get-DomainSite) OR TERM(Get-NetSubnet) OR TERM(Get-DomainSubnet) OR TERM(Get-NetGroup) OR TERM(Get-DomainGroup) OR TERM(Find-ManagedSecurityGroups) OR TERM(Get-DomainManagedSecurityGroup) OR TERM(Get-NetGroupMember) OR TERM(Get-DomainGroupMember) OR TERM(Get-NetFileServer) OR TERM(Get-DomainFileServer) OR TERM(Get-DFSshare) OR TERM(Get-DomainDFSShare) OR TERM(Get-NetGPO) OR TERM(Get-DomainGPO) OR TERM(Get-NetGPOGroup) OR TERM(Get-DomainGPOLocalGroup) OR TERM(Find-GPOLocation) OR TERM(Get-DomainGPOUserLocalGroupMapping) OR TERM(Find-GPOComputerAdmin) OR TERM(Get-DomainGPOComputerLocalGroupMapping) OR TERM(Get-LoggedOnLocal) OR TERM(Get-RegLoggedOn) OR TERM(Invoke-CheckLocalAdminAccess) OR TERM(Test-AdminAccess) OR TERM(Get-SiteName) OR TERM(Get-NetComputerSiteName) OR TERM(Get-Proxy) OR TERM(Get-WMIRegProxy) OR TERM(Get-LastLoggedOn) OR TERM(Get-WMIRegLastLoggedOn) OR TERM(Get-CachedRDPConnection) OR TERM(Get-WMIRegCachedRDPConnection) OR TERM(Get-RegistryMountedDrive) OR TERM(Get-WMIRegMountedDrive) OR TERM(Get-NetProcess) OR TERM(Get-WMIProcess) OR TERM(Invoke-ThreadedFunction) OR TERM(New-ThreadedFunction) OR TERM(Invoke-UserHunter) OR TERM(Find-DomainUserLocation) OR TERM(Invoke-ProcessHunter) OR TERM(Find-DomainProcess) OR TERM(Invoke-EventHunter) OR TERM(Find-DomainUserEvent) OR TERM(Invoke-ShareFinder) OR TERM(Find-DomainShare) OR TERM(Invoke-FileFinder) OR TERM(Find-InterestingDomainShareFile) OR TERM(Invoke-EnumerateLocalAdmin) OR TERM(Find-DomainLocalGroupMember) OR TERM(Get-NetDomainTrust) OR TERM(Get-DomainTrust) OR TERM(Get-NetForestTrust) OR TERM(Get-ForestTrust) OR TERM(Find-ForeignUser) OR TERM(Get-DomainForeignUser) OR TERM(Find-ForeignGroup) OR TERM(Get-DomainForeignGroupMember) OR TERM(Invoke-MapDomainTrust) OR TERM(Get-DomainTrustMapping) OR TERM(Get-DomainPolicy) OR TERM(Get-DomainPolicyData) OR TERM(Find-LocalAdminAccess))
Stage 2: table
| table _time, host, user process, process_*, signature_id, user
Stage 3: bucket
| bin span=60s
Stage 4: 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.
| Field | Kind | Values |
|---|---|---|
EventCode | eq |
|
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.
| Stage | Term |
|---|---|
| 1 | TERM |
| 1 | "<EventID>4104<" |
| 1 | TERM |
| 1 | "<EventID>4103<" |
| 1 | "Get-IPAddress" |
| 1 | "Resolve-IPAddress" |
| 1 | "Convert-NameToSid" |
| 1 | "ConvertTo-SID" |
| 1 | "Convert-SidToName" |
| 1 | "ConvertFrom-SID" |
| 1 | "Request-SPNTicket" |
| 1 | "Get-DomainSPNTicket" |
| 1 | "Get-DNSZone" |
| 1 | "Get-DomainDNSZone" |
| 1 | "Get-DNSRecord" |
| 1 | "Get-DomainDNSRecord" |
| 1 | "Get-NetDomain" |
| 1 | "Get-Domain" |
| 1 | "Get-NetDomainController" |
| 1 | "Get-DomainController" |
| 1 | "Get-NetForest" |
| 1 | "Get-Forest" |
| 1 | "Get-NetForestDomain" |
| 1 | "Get-ForestDomain" |
| 1 | "Get-NetForestCatalog" |
| 1 | "Get-ForestGlobalCatalog" |
| 1 | "Get-NetUser" |
| 1 | "Get-DomainUser" |
| 1 | "Get-UserEvent" |
| 1 | "Get-DomainUserEvent" |
| 1 | "Get-NetComputer" |
| 1 | "Get-DomainComputer" |
| 1 | "Get-ADObject" |
| 1 | "Get-DomainObject" |
| 1 | "Set-ADObject" |
| 1 | "Set-DomainObject" |
| 1 | "Get-ObjectAcl" |
| 1 | "Get-DomainObjectAcl" |
| 1 | "Add-ObjectAcl" |
| 1 | "Add-DomainObjectAcl" |
| 1 | "Invoke-ACLScanner" |
| 1 | "Find-InterestingDomainAcl" |
| 1 | "Get-GUIDMap" |
| 1 | "Get-DomainGUIDMap" |
| 1 | "Get-NetOU" |
| 1 | "Get-DomainOU" |
| 1 | "Get-NetSite" |
| 1 | "Get-DomainSite" |
| 1 | "Get-NetSubnet" |
| 1 | "Get-DomainSubnet" |
| 1 | "Get-NetGroup" |
| 1 | "Get-DomainGroup" |
| 1 | "Find-ManagedSecurityGroups" |
| 1 | "Get-DomainManagedSecurityGroup" |
| 1 | "Get-NetGroupMember" |
| 1 | "Get-DomainGroupMember" |
| 1 | "Get-NetFileServer" |
| 1 | "Get-DomainFileServer" |
| 1 | "Get-DFSshare" |
| 1 | "Get-DomainDFSShare" |
| 1 | "Get-NetGPO" |
| 1 | "Get-DomainGPO" |
| 1 | "Get-NetGPOGroup" |
| 1 | "Get-DomainGPOLocalGroup" |
| 1 | "Find-GPOLocation" |
| 1 | "Get-DomainGPOUserLocalGroupMapping" |
| 1 | "Find-GPOComputerAdmin" |
| 1 | "Get-DomainGPOComputerLocalGroupMapping" |
| 1 | "Get-LoggedOnLocal" |
| 1 | "Get-RegLoggedOn" |
| 1 | "Invoke-CheckLocalAdminAccess" |
| 1 | "Test-AdminAccess" |
| 1 | "Get-SiteName" |
| 1 | "Get-NetComputerSiteName" |
| 1 | "Get-Proxy" |
| 1 | "Get-WMIRegProxy" |
| 1 | "Get-LastLoggedOn" |
| 1 | "Get-WMIRegLastLoggedOn" |
| 1 | "Get-CachedRDPConnection" |
| 1 | "Get-WMIRegCachedRDPConnection" |
| 1 | "Get-RegistryMountedDrive" |
| 1 | "Get-WMIRegMountedDrive" |
| 1 | "Get-NetProcess" |
| 1 | "Get-WMIProcess" |
| 1 | "Invoke-ThreadedFunction" |
| 1 | "New-ThreadedFunction" |
| 1 | "Invoke-UserHunter" |
| 1 | "Find-DomainUserLocation" |
| 1 | "Invoke-ProcessHunter" |
| 1 | "Find-DomainProcess" |
| 1 | "Invoke-EventHunter" |
| 1 | "Find-DomainUserEvent" |
| 1 | "Invoke-ShareFinder" |
| 1 | "Find-DomainShare" |
| 1 | "Invoke-FileFinder" |
| 1 | "Find-InterestingDomainShareFile" |
| 1 | "Invoke-EnumerateLocalAdmin" |
| 1 | "Find-DomainLocalGroupMember" |
| 1 | "Get-NetDomainTrust" |
| 1 | "Get-DomainTrust" |
| 1 | "Get-NetForestTrust" |
| 1 | "Get-ForestTrust" |
| 1 | "Find-ForeignUser" |
| 1 | "Get-DomainForeignUser" |
| 1 | "Find-ForeignGroup" |
| 1 | "Get-DomainForeignGroupMember" |
| 1 | "Invoke-MapDomainTrust" |
| 1 | "Get-DomainTrustMapping" |
| 1 | "Get-DomainPolicy" |
| 1 | "Get-DomainPolicyData" |
| 1 | "Find-LocalAdminAccess" |