id | WIN-190625024610 |
author | Roberto Rodriguez @Cyb3rWard0g |
creation date | 2019/06/25 |
platform | Windows |
playbook link |
Every computer that runs Windows has its own local domain; that is, it has an account database for accounts that are specific to that computer. Conceptually,this is an account database like any other with accounts, groups, SIDs, and so on. These are referred to as local accounts, local groups, and so on. Because computers typically do not trust each other for account information, these identities stay local to the computer on which they were created. Adversaries might use tools like Mimikatz with lsadump::sam commands or scripts such as Invoke-PowerDump to get the SysKey to decrypt Security Account Mannager (SAM) database entries (from registry or hive) and get NTLM, and sometimes LM hashes of local accounts passwords. Adversaries can calculate the Syskey by using RegOpenKeyEx/RegQueryInfoKey API calls to query the appropriate class info and values from the HKLM:\SYSTEM\CurrentControlSet\Control\Lsa\JD, HKLM:\SYSTEM\CurrentControlSet\Control\Lsa\Skew1, HKLM:\SYSTEM\CurrentControlSet\Control\Lsa\GBG, and HKLM:\SYSTEM\CurrentControlSet\Control\Lsa\Data keys.
Additional reading
In [ ]:
from openhunt.mordorutils import *
spark = get_spark()
In [ ]:
mordor_file = "https://raw.githubusercontent.com/hunters-forge/mordor/master/small_datasets/windows/lateral_movement/remote_services_T1021/empire_find_local_admin.tar.gz"
registerMordorSQLTable(spark, mordor_file, "mordorTable")
FP Rate | Log Channel | Description |
---|---|---|
Low | ['Security'] | Look for handle requests and access operations to specific registry keys used to calculate the SysKey. SACLs are needed for them |
In [ ]:
df = spark.sql(
'''
SELECT `@timestamp`, ProcessName, ObjectName, AccessMask, event_id
FROM mordorTable
WHERE channel = "Security"
AND (event_id = 4656 OR event_id = 4663)
AND ObjectType = "Key"
AND (
lower(ObjectName) LIKE "%jd"
OR lower(ObjectName) LIKE "%gbg"
OR lower(ObjectName) LIKE "%data"
OR lower(ObjectName) LIKE "%skew1"
)
'''
)
df.show(1,False)
Category | Type | Name |
---|---|---|
signature | SIGMA | win_syskey_registry_access |