DNSpionage: When the registrar becomes the attack path
Summary
Brian Krebs traces the DNSpionage campaign through passive DNS data and shows that in late 2018 attackers redirected the DNS records of more than 50 government agencies and companies in the Middle East. The route ran through stolen registrar credentials, which the attackers used to send changes straight to the registries via EPP. Netnod and Packet Clearing House describe how far DNSSEC protected them and where it failed.
From the registrar to a valid certificate
Whoever has access to the registrar can change a domain's name servers. The attackers pointed mail and VPN names to their own servers in Europe and shortly afterwards obtained certificates from Comodo or Let's Encrypt. Domain validation only checks who currently controls the domain. Intercepted logins therefore looked properly encrypted to users.
At PCH, each redirection lasted only about an hour. That was enough, because smartphones constantly fetch new mail and send their credentials while doing so.
What DNSSEC did and did not do
Netnod suffered three attacks. The first two hit servers without DNSSEC. In the third, the attackers briefly disabled DNSSEC via the registrar access, obtained certificates and re-enabled it. When they actually redirected traffic, they forgot to disable it again, and the attack came to nothing.
PCH validates DNSSEC across its entire infrastructure, and the attack failed almost completely because of it. Only two travelling employees were caught: hotel captive portals forced their iPhones onto foreign DNS servers, and during that time their mail apps fetched new messages.
The US government's response
On 22 January 2019, CISA issued Emergency Directive 19-01. Within ten business days, federal agencies had to audit their DNS records, change the passwords of all DNS accounts, add multi-factor authentication there and monitor Certificate Transparency logs for certificates they had not requested. CISA explicitly advised against SMS as the second factor.
Ideas
- Stolen registrar credentials bypass every safeguard on your own servers.
- EPP carries changes from the registrar straight into the registry.
- Whoever controls a domain obtains domain-validated certificates without further checks.
- One-hour redirections suffice because mail apps constantly send credentials.
- Validating DNSSEC stopped almost the entire attack at PCH.
- Captive portals force devices onto foreign resolvers and so bypass DNSSEC validation.
- None of three commercial DNS monitoring services noticed the redirections at PCH.
Insights
- Domain management is part of every organisation's security perimeter.
- A valid certificate only proves who controlled the domain when it was issued.
- DNSSEC protects the data, but not against someone who can change the delegation at the registrar.
Quotes
- The two people who did get popped, both were traveling and were on their iPhones, and they had to traverse through captive portals during the hijack period. (Bill Woodcock)
- Luckily for us, they forgot to remove that when they launched their man-in-the-middle attack. (Lars Michael Jogbäck)
Facts
- Cisco Talos first described DNSpionage on 27 November 2018.
- According to APNIC, only about 20 percent of major networks and websites had enabled DNSSEC at the time.
- PCH counted four attacks between 13 December 2018 and 2 January 2019.
- PCH now polls its own DNS infrastructure several times an hour and alerts on any change.
- Netnod had not previously secured all of its domains with a registrar domain lock.
References
- Brian Krebs: A Deep Dive on the Recent Widespread DNS Hijacking Attacks
- Cisco Talos: DNSpionage.
- FireEye and CrowdStrike: technical indicators of the campaign.
- Netnod and Packet Clearing House: affected infrastructure operators.
- CISA: Emergency Directive 19-01, Mitigate DNS Infrastructure Tampering (2019)
- RFC 5730: Extensible Provisioning Protocol (EPP) (2009)
- RFC 4033: DNS Security Introduction and Requirements (2005)
- RFC 6962: Certificate Transparency (2013)
Critique
- Krebs describes DNSSEC as if DNS queries were signed and a name server checked whether a record had been modified in transit. In fact, the zone operator signs the answers, and a validating resolver checks the chain of signatures up to the root (RFC 4033). That is exactly why DNSSEC did not help against attackers who could change the delegation itself at the registrar.
Remarks
- The attribution to Iran comes from security firms and Bill Woodcock; the post itself speaks of "suspected Iranian hackers".
Recommendations
- Protect registrar accounts with phishing-resistant multi-factor authentication and Registry Lock.
- Monitor NS, MX and A records yourself several times an hour instead of once a day.
- Get notified about new certificates for your domains from Certificate Transparency logs.
- Sign zones with DNSSEC and validate on your own resolvers.
Found a mistake or have something to add? Get in touch.
Links to the original source and the Web Archive open in a new tab.