|
| 1 | +[metadata] |
| 2 | +creation_date = "2024/03/26" |
| 3 | +integration = ["system", "windows"] |
| 4 | +maturity = "production" |
| 5 | +min_stack_comments = "New fields added: required_fields, related_integrations, setup" |
| 6 | +min_stack_version = "8.3.0" |
| 7 | +updated_date = "2024/03/26" |
| 8 | + |
| 9 | +[rule] |
| 10 | +author = ["Elastic"] |
| 11 | +description = """ |
| 12 | +Active Directory Integrated DNS (ADIDNS) is one of the core components of AD DS, leveraging AD's access control and |
| 13 | +replication to maintain domain consistency. It stores DNS zones as AD objects, a feature that, while robust, introduces |
| 14 | +some security issues, such as wildcard records, mainly because of the default permission (Any authenticated users) to |
| 15 | +create DNS-named records. Attackers can create wildcard records to redirect traffic that doesn't explicitly match |
| 16 | +records contained in the zone, becoming the Man-in-the-Middle and being able to abuse DNS similarly to LLMNR/NBNS spoofing. |
| 17 | +""" |
| 18 | +from = "now-9m" |
| 19 | +index = ["winlogbeat-*", "logs-system.*", "logs-windows.*"] |
| 20 | +language = "eql" |
| 21 | +license = "Elastic License v2" |
| 22 | +name = "Potential ADIDNS Poisoning via Wildcard Record Creation" |
| 23 | +references = [ |
| 24 | + "https://www.netspi.com/blog/technical/network-penetration-testing/exploiting-adidns/", |
| 25 | + "https://www.thehacker.recipes/a-d/movement/mitm-and-coerced-authentications/adidns-spoofing" |
| 26 | +] |
| 27 | +risk_score = 73 |
| 28 | +rule_id = "8f242ffb-b191-4803-90ec-0f19942e17fd" |
| 29 | +setup = """## Setup |
| 30 | +
|
| 31 | +The 'Audit Directory Service Changes' logging policy must be configured for (Success, Failure). |
| 32 | +Steps to implement the logging policy with Advanced Audit Configuration: |
| 33 | +
|
| 34 | +``` |
| 35 | +Computer Configuration > |
| 36 | +Policies > |
| 37 | +Windows Settings > |
| 38 | +Security Settings > |
| 39 | +Advanced Audit Policies Configuration > |
| 40 | +Audit Policies > |
| 41 | +DS Access > |
| 42 | +Audit Directory Service Changes (Success,Failure) |
| 43 | +``` |
| 44 | +
|
| 45 | +The above policy does not cover the target object by default (we still need it to be configured to generate events), so we need to set up an AuditRule using https://github.com/OTRF/Set-AuditRule. |
| 46 | +
|
| 47 | +``` |
| 48 | +Set-AuditRule -AdObjectPath 'AD:\\CN=MicrosoftDNS,DC=DomainDNSZones,DC=Domain,DC=com' -WellKnownSidType WorldSid -Rights CreateChild -InheritanceFlags Descendents -AttributeGUID e0fa1e8c-9b45-11d0-afdd-00c04fd930c9 -AuditFlags Success |
| 49 | +``` |
| 50 | +""" |
| 51 | +severity = "high" |
| 52 | +tags = [ |
| 53 | + "Domain: Endpoint", |
| 54 | + "OS: Windows", |
| 55 | + "Use Case: Threat Detection", |
| 56 | + "Tactic: Credential Access", |
| 57 | + "Data Source: Active Directory", |
| 58 | + "Use Case: Active Directory Monitoring" |
| 59 | +] |
| 60 | +timestamp_override = "event.ingested" |
| 61 | +type = "eql" |
| 62 | + |
| 63 | +query = ''' |
| 64 | +any where host.os.type == "windows" and event.action == "Directory Service Changes" and |
| 65 | + event.code == "5137" and startsWith(winlog.event_data.ObjectDN, "DC=*,") |
| 66 | +''' |
| 67 | + |
| 68 | + |
| 69 | +[[rule.threat]] |
| 70 | +framework = "MITRE ATT&CK" |
| 71 | +[[rule.threat.technique]] |
| 72 | +id = "T1557" |
| 73 | +name = "Adversary-in-the-Middle" |
| 74 | +reference = "https://attack.mitre.org/techniques/T1557/" |
| 75 | + |
| 76 | + |
| 77 | + |
| 78 | +[rule.threat.tactic] |
| 79 | +id = "TA0006" |
| 80 | +name = "Credential Access" |
| 81 | +reference = "https://attack.mitre.org/tactics/TA0006/" |
| 82 | + |
0 commit comments