This can be accomplished in the following ways:
- A legitimate DNS server gets compromised
- A DNS client gets pointed to a malicious DNS server (using DNS changer malware or by changing the router's DNS settings)
- By a malicious actor at an ISP or DNS provider (using his access to make unauthorized changes)
With the Rogue DNS server in place, the original DNS query never reaches the legitimate Authoritative Name server. In fact it never reaches any server other than the compromised DNS resolver (that may not be exactly correct since usually any sizable recursive DNS infrastructure will have multiple layers of resolvers, forwarders and caching servers).
Let’s look at an example.
For this purpose we will spin up a simple Unbound DNS server instance that will act as a recursive resolver. Later we will configure it with static entries of our choosing.
I have used unbound-docker image and exposed the service on localhost.
Let’s confirm it works.
dig www.securesenses.net @127.0.0.1
; <<>> DiG 9.10.6 <<>> www.securesenses.net @127.0.0.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 54715
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;www.securesenses.net. IN A
;; ANSWER SECTION:
www.securesenses.net. 1736 IN CNAME ghs.google.com.
ghs.google.com. 236 IN A 172.217.16.51
We've confirmed we got the correct response and that the response is not authoritative. Our local DNS server works as expected. Now we’ll make it turn rogue…
To configure Unbound with a static entry we simply add the following line to the configuration:
local-data: "www.securesenses.net. IN A 1.2.3.4"
When we retry the query again, we receive an authoritative answer for the targeted domain name.
dig www.securesenses.net @127.0.0.1
; <<>> DiG 9.10.6 <<>> www.securesenses.net @127.0.0.1
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 40437
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;www.securesenses.net. IN A
;; ANSWER SECTION:
www.securesenses.net. 3600 IN A 1.2.3.4
As seen above we turned our local DNS server into an illegitimate authoritative name server for securesenses.net. domain.
Anyone can setup a local DNS server and make it authoritative for any domain. A DNS server becomes rogue when someone either sets one up and then points unsuspecting DNS clients to it or compromises an existing legitimate server that is in use and re-configures it.
Comments
Post a Comment