Monday, September 19, 2011

DNS ID Hacking -part -1



[1]-- DNS ID Hacking Presentation


Hi people you might be wondering what DNS ID Hacking (or Spoofing) is.
DNS ID Hacking isn't a usual way of hacking/spoofing such jizz
or any-erect. This method is based on a vulnerability on DNS Protocol.
More brutal, the DNS ID hack/spoof is very efficient is very strong
because there is no generation of DNS daemons that escapes from it (even
WinNT!).
--[1.1]-- DNS Protocol mechanism explanation
In the first step, you must know how the DNS works. I will only explain the
most important facts of this protocol. In order to do that, we will follow
the way of a DNS request packet from A to Z!
1: the client (bla.bibi.com) sends a request of resolution of the domain
"www.heike.com". To resolve the name, bla.bibi.com uses "dns.bibi.com" for
DNS. Let's take a look at the following picture..
/---------------------------------\
| 111.1.2.123 = bla.bibi.com |
| 111.1.2.222 = dns.bibi.com |
| format: |
| IP_ADDR:PORT->IP_ADDR:PORT |
| ex: |
| 111.1.2.123:2999->111.1.2.222:53|
\---------------------------------/
...
gethosbyname("www.heike.com");
...
[bla.bibi.com] [dns.bibi.com]
111.1.2.123:1999 --->[?www.heike.com]------> 111.1.2.222:53
Here we see our resolution name request from source port 1999 which is
asking to dns on port 53.
[note: DNS is always on port 53]
Now that dns.bibi.com has received the resolution request from bla.bibi.com,
dns.bibi.com will have to resolve the name, let's look at it...
[dns.bibi.com] [ns.internic.net]
111.1.2.222:53 -------->[dns?www.heike.com]----> 198.41.0.4:53
dns.bibi.com asks ns.internic.net who the root name server for the address
of www.heike.com is, and if it doesn't have it and sends the request to a
name server which has authority on '.com' domains.
[note: we ask to internic because it could have this request in its cache]


[ns.internic.net] [ns.bibi.com]
198.41.0.4:53 ------>[ns for.com is 144.44.44.4]------> 111.1.2.222:53
Here we can see that ns.internic.net answered to ns.bibi.com (which is the
DNS that has authority over the domain bibi.com), that the name server
of for.com has the IP 144.44.44.4 [let's call it ns.for.com]. Now our
ns.bibi.com will ask to ns.for.com for the address of www.heike.com,
but this one doesn't have it and will forward the request to the DNS of
heike.com which has authority for heike.com.
[ns.bibi.com] [ns.for.com]
111.1.2.222:53 ------>[?www.heike.com]-----> 144.44.44.4:53
answer from ns.for.com
[ns.for.com] [ns.bibi.com]
144.44.44.4:53 ------>[ns for heike.com is 31.33.7.4]---> 144.44.44.4:53
Now that we know which IP address has authority on the domain "heike.com"
[we'll call it ns.heike.com], we ask it what's the IP of the machine www
[www.heike.com then :)].
[ns.bibi.com] [ns.heike.com]
111.1.2.222:53 ----->[?www.heike.com]----> 31.33.7.4:53
And now we at least have our answer!!
[ns.heike.com] [ns.bibi.com]
31.33.7.4:53 ------->[www.heike.com == 31.33.7.44] ----> 111.1.2.222:53
Great we have the answer, we can forward it to our client bla.bibi.com.
[ns.bibi.com] [bla.bibi.com]
111.1.2.222:53 ------->[www.heike.com == 31.33.7.44]----> 111.1.2.123:1999
Hehe now bla.bibi.com knows the IP of www.heike.com :)
So.. now let's imagine that we'd like to have the name of a machine from its
IP, in order to do that, the way to proceed will be a little different
because the IP will have to be transformed:
example:
100.20.40.3 will become 3.40.20.100.in-addr.arpa
Attention!! This method is only for the IP resolution request (reverse DNS)
So let's look in practical when we take the IP of www.heike.com (31.33.7.44
or "44.7.33.31.in-addr.arpa" after the translation into a comprehensible
format by DNS).
...
gethostbyaddr("31.33.7.44");
...
[bla.bibi.com] [ns.bibi.com]
111.1.2.123:2600 ----->[?44.7.33.31.in-addr.arpa]-----> 111.1.2.222:53
We sent our request to ns.bibi.com
[ns.bibi.com] [ns.internic.net]
111.1.2.222:53 ----->[?44.7.33.31.in-addr.arpa]------> 198.41.0.4:53
ns.internic.net will send the IP of a name server which has authority on

'31.in-addr.arpa'.
[ns.internic.net] [ns.bibi.com]
198.41.0.4:53 --> [DNS for 31.in-addr.arpa is 144.44.44.4] -> 111.1.2.222:53
Now ns.bibi.com will ask the same question to the DNS at 144.44.44.4.
[ns.bibi.com] [ns.for.com]
111.1.2.222:53 ----->[?44.7.33.31.in-addr.arpa]------> 144.44.44.4:53
and so on...
In fact the mechanism is nearly the same that was used for name
resolution.
I hope you understood the dialog on how DNS works. Now let's study DNS
messages format.



0 comments:

Post a Comment

mobile here

Popular Posts