summaryrefslogtreecommitdiff
path: root/exploits/7350bindnxt/vulninfo
diff options
context:
space:
mode:
Diffstat (limited to 'exploits/7350bindnxt/vulninfo')
-rw-r--r--exploits/7350bindnxt/vulninfo53
1 files changed, 53 insertions, 0 deletions
diff --git a/exploits/7350bindnxt/vulninfo b/exploits/7350bindnxt/vulninfo
new file mode 100644
index 0000000..ce794e4
--- /dev/null
+++ b/exploits/7350bindnxt/vulninfo
@@ -0,0 +1,53 @@
1--here is the offending code
2
3 n = dn_expand(msg, eom, cp, (char *)data, sizeof data);
4 if (n < 0) {
5 hp->rcode = FORMERR;
6 return (-1);
7 }
8 if (!ns_nameok((char *)data, class, NULL, response_trans,
9 domain_ctx, dname, from.sin_addr)) {
10 hp->rcode = FORMERR;
11 return (-1);
12 }
13 cp += n;
14 cp1 = data + strlen((char *)data) + 1;
15 memcpy(cp1, cp, dlen - n);
16
17--
18
19This implys three things.
20
21firstly the format of the rdata section - it is important that u form this
22correctly. in this case it is quite simple, a DNS domain name followed by
23any arbitrary data :) Yes, even nulls ;)
24
25secondly the buffer will already contain the data from the DNS domain
26name from the first part of the rdata section, and the arbitrary data
27appends this data, hence u must take account of this when calculating the
28ret distance.
29
30thirdly its just an ordinary stack overflow ('data' isn't declared
31static), so it should be easy enough to exploit.
32
33the buffer in this case is of size MAXDATA*2 which, if u follow the macros,
34evaluates to 4140 bytes. There are 12 other temporary variables in the
35stack, each of size 4 bytes so, making no assumptions about how the
36compiler decides to arrange them on the stack, u must send approx 14
37return addresses after the shellcode. note the buffer is fuqn huge so you
38should have virtually no problems with the offset =)
39
40So if you use a DNS domain name of length 6 (e.g. \006smiler\000 =)
41since it starts at 'data + strlen (data) + 1' then u need to put 4140 - 7
42= 4133 bytes in the buffer to start overflowing and u need to follow that
43with 14 ret addresses (56 bytes). In total that comes to 4190 bytes =)
44
45I haven't checked this out, but apparently u need to send this
46data via tcp, because BIND refuses to read more than 512 bytes from a udp
47packet, even if u fragment to allow it to be bigger than the MTU
48(I managed to do this before, with an rpc call, to exploit rpc.mountd -
49albeit only ~1100 bytes).
50
51
52-smiler
53