id | WIN-180815210510 |
author | Roberto Rodriguez @Cyb3rWard0g |
creation date | 2018/08/15 |
platform | Windows |
playbook link |
Active Directory replication is the process by which the changes that originate on one domain controller are automatically transferred to other domain controllers that store the same data. Active Directory data takes the form of objects that have properties, or attributes. Each object is an instance of an object class, and object classes and their respective attributes are defined in the Active Directory schema. The values of the attributes define the object, and a change to a value of an attribute must be transferred from the domain controller on which it occurs to every other domain controller that stores a replica of that object. An adversary can abuse this model and request information about a specific account via the replication request. This is done from an account with sufficient permissions (usually domain admin level) to perform that request. Usually the accounts performing replication operations in a domain are computer accounts (i.e dcaccount$). Therefore, it might be abnormal to see other non-dc-accounts doing it.
Additional reading
In [ ]:
from openhunt.mordorutils import *
spark = get_spark()
In [ ]:
mordor_file = "https://raw.githubusercontent.com/hunters-forge/mordor/master/small_datasets/windows/credential_access/credential_dumping_T1003/credentials_from_ad/empire_dcsync.tar.gz"
registerMordorSQLTable(spark, mordor_file, "mordorTable")
FP Rate | Log Channel | Description |
---|---|---|
Low | ['Security'] | Monitoring for non-dc machine accounts accessing active directory objects on domain controllers with replication rights might be suspicious |
In [ ]:
df = spark.sql(
'''
SELECT `@timestamp`, computer_name, SubjectUserName, SubjectLogonId
FROM mordorTable
WHERE channel = "Security"
AND event_id = 4662
AND AccessMask = "0x100"
AND (
Properties LIKE "%1131f6aa_9c07_11d1_f79f_00c04fc2dcd2%"
OR Properties LIKE "%1131f6ad_9c07_11d1_f79f_00c04fc2dcd2%"
OR Properties LIKE "%89e95b76_444d_4c62_991a_0facbeda640c%"
)
AND NOT SubjectUserName LIKE "%$"
'''
)
df.show(1,False)
FP Rate | Log Channel | Description |
---|---|---|
Low | ['Security'] | You can use successful authentication events on the domain controller to get information about the source of the AD Replication Service request |
In [ ]:
df = spark.sql(
'''
SELECT o.`@timestamp`, o.computer_name, o.SubjectUserName, o.SubjectLogonId, a.IpAddress
FROM mordorTable o
INNER JOIN (
SELECT computer_name,TargetUserName,TargetLogonId,IpAddress
FROM mordorTable
WHERE channel = "Security"
AND event_id = 4624
AND LogonType = 3
AND IpAddress is not null
AND NOT TargetUserName LIKE "%$"
) a
ON o.SubjectLogonId = a.TargetLogonId
WHERE o.channel = "Security"
AND o.event_id = 4662
AND o.AccessMask = "0x100"
AND (
o.Properties LIKE "%1131f6aa_9c07_11d1_f79f_00c04fc2dcd2%"
OR o.Properties LIKE "%1131f6ad_9c07_11d1_f79f_00c04fc2dcd2%"
OR o.Properties LIKE "%89e95b76_444d_4c62_991a_0facbeda640c%"
)
AND o.computer_name = a.computer_name
AND NOT o.SubjectUserName LIKE "%$"
'''
)
df.show(1,False)
Category | Type | Name |
---|---|---|
signature | SIGMA | win_ad_replication_non_machine_account |