I know that there are domain record lists and whatnot, but I'm trying to understand the exact structure of how DNS works and where someone can potentially take over a domain name. Even if my web-app has absolutely no holes in it, can't someone just change the domain records to point elsewhere and hijack my traffic?

this question is only about DNS registrar issues or you would like to know about mitm attacks? Because those are two different questions from the technical point of view.
–
anonymousNov 21 '10 at 16:24

@Ams - I was asking more about mitm, not registrar issues, but I don't know enough to differentiate much.
–
MosheNov 21 '10 at 16:51

3 Answers
3

Domain hijacks don't happen via web application hacks, but are usually via vulnerabilities in the domain registrar's system, or by managing to intercept/take over the email accounts the domains are registered to - so the attacker can reset the passwords and intercept the transfer emails, agreeing to the transfer.

Normally it'll happen by managing to convince the domain registrar that the attacker is the owner of the domain, using personal information about the domain owner to access their account on the registrar and then either switch the DNS servers to an attacker's DNS servers from where they can redirect how they like, or by transferring the domain to the attacker.

Or of course there's simply waiting for the domain to expire and grabbing it before it's renewed.

ICANN produced a report in 2005 about this issue, covering the risks and actions you can take.

Man-in-the-middle attacks against DNS rely on being able to craft a reply to a victim machine's DNS request that gets received by the victim before a legitimate reply. So you might send UDP packets that claim to be from the victim's DNS server and claim that www.victimsbank.example has an A record of attacker.evilpeople.example's IP address. When the victim goes to visit that site, if your packet gets there before the real result, off they go to the attacker's server.

This requires more resources than actually changing the records though, because there is one record and many users.
–
MosheNov 22 '10 at 0:22

@Moshe that depends on whether the attacker is targeting a victim or being indiscriminate. It's probably easier to do this at a Starbucks than to go to the registrar. Besides, you did say you were interested in mitm...
–
user185Nov 22 '10 at 7:48

Hosts overwriting - on Windows there is a hosts file that overrides DNS. Entries put in there will not even ask DNS for an IP, but will go straight there. If I can do that in any way - interactive access, app flaw that lets me write to files, etc - I can effectively take over any website, accessed from that machine.