1 |
The following was sent to BUGTRAQ today... would be a good idea to |
2 |
convert to ssh if you havn't already ;) |
3 |
|
4 |
Could whoever is familiar with the netkit stuff please take a look at the |
5 |
patch they mentioned? Thanks. |
6 |
|
7 |
|
8 |
Begin forwarded message: |
9 |
|
10 |
Date: Fri, 10 Aug 2001 00:14:03 +1200 (NZST) |
11 |
From: <zen-parse@×××.net> |
12 |
To: <bugtraq@×××××××××××××.com> |
13 |
Subject: ADV/EXP: netkit <=0.17 in.telnetd remote buffer overflow |
14 |
|
15 |
|
16 |
************************************************************************ |
17 |
Product: netkit telnet protocol daemon, in.telnetd |
18 |
|
19 |
Version: netkit-telnet-0.17 (and previous) /usr/sbin/in.telnetd |
20 |
|
21 |
Severity: High |
22 |
|
23 |
Remote: Yes |
24 |
|
25 |
Allows: Remote ROOT level access. |
26 |
|
27 |
Workaround: Disable telnet access. |
28 |
|
29 |
Fix: Check with your vendor for an updated package. |
30 |
|
31 |
************************************************************************ |
32 |
<from http://www.securityfocus.com/archive/1/197804, posted by |
33 |
<scut@××××××××××××.de>. |
34 |
|
35 |
To: BugTraq |
36 |
Subject: multiple vendor telnet daemon vulnerability |
37 |
Date: Wed Jul 18 2001 22:15:10 |
38 |
... |
39 |
System | vulnerable | exploitable * |
40 |
----------------------------------------+--------------+------------ |
41 |
... | | |
42 |
Linux netkit-telnetd >= 0.14 | no | |
43 |
... | | |
44 |
The bug has been discovered by scut. (It is easy to spot, so I do not |
45 |
want to rule out discoveries by other persons) |
46 |
... |
47 |
The tests and further analysis were done by smiler, lorian, zip and |
48 |
scut. |
49 |
... |
50 |
|
51 |
<end of message> |
52 |
|
53 |
TESO were wrong about netkit >=0.14 not being vulnerable. |
54 |
|
55 |
************************************************************************ |
56 |
Requires: Currently running telnet daemon (often on by default) |
57 |
|
58 |
/usr/in.telnetd <= netkit-telnet-0.17 |
59 |
(telnet-0.17-7 is the default in.telnetd for Redhat 7.0) |
60 |
|
61 |
GLIBC > 2.0.6 |
62 |
|
63 |
************************************************************************ |
64 |
Description of problem: |
65 |
|
66 |
The version of /usr/sbin/in.telnetd that comes as default on Redhat 7.0, |
67 |
and many other distributions contains an exploitable overflow in the |
68 |
handling of its output, allowing execution of arbitrary commands. |
69 |
|
70 |
The problem is in the handling of the AYT commands, as described in the |
71 |
advisory already linked. |
72 |
|
73 |
************************************************************************ |
74 |
Exploit details: (the attached file zp-exp-telnetd.c) |
75 |
|
76 |
If the user has local access to the system, it is possilble to get the |
77 |
program to set arbitrary environment variables in the environment of |
78 |
/bin/login. |
79 |
e.g. LD_PRELOAD=/tmp/make-rootshell.so |
80 |
|
81 |
By filling the heap, in a similar way to the teso exploit, it its possible |
82 |
to set 2 or more environment variables. |
83 |
|
84 |
If the user doesn't have local access, it is possible to overwrite the |
85 |
chunk header information for a pointer used by setenv(3), and store a new |
86 |
chunk in a user controllable location, so when the envrionement gets |
87 |
reallocated it will change the value of arbitrary memory locations. |
88 |
|
89 |
e.g. You could cause the pointer to set the length of the previous chunk |
90 |
to the distance back from the chunk to a point in netibuf, which itself |
91 |
contains a chunk to set the address of a function in the GOT to point to |
92 |
shellcode, which could also be stored in the network input buffer. |
93 |
|
94 |
Sometimes bad things happen that you have to kludge to fix. e.g. |
95 |
push_clean() in the proof of concept exploit. Sometimes I got some |
96 |
characters from the previous input being sent again, and when that was a |
97 |
command to set an environment variable or something else that changed the |
98 |
environment, it kinda messed with malloc calculations a little. |
99 |
|
100 |
As it is, this exploit will probably not work on your machine, but |
101 |
carefully modifying appropriate values should fix that. |
102 |
|
103 |
|
104 |
-- zen-parse |
105 |
____ http://mp3.com/cosv _______ |
106 |
/ ___\ __ _______ / _____/ __ |
107 |
/ /_____/ \ / ____ \ / / ______/ \__________ |
108 |
\______ /\ \__\ \ \ \ / / /_gone_\__/_platinum_\ |
109 |
\ \/ ______/ \ \/ / \______/ \__________/ |
110 |
\__/ \__/ \__/ |
111 |
-- ObPlug: Buy our CD! |
112 |
|
113 |
-- Available: For work in the security industry. (email for details) |
114 |
|
115 |
------------------------------------------------------------------------- |
116 |
The preceding information, unless directly posted by zen-parse@×××.net to |
117 |
an open forum is confidential information and not to be distributed |
118 |
(without explicit permission being given by zen-parse@×××.net). Legal |
119 |
action may be taken to enforce this. If you are mum or dad, this probably |
120 |
doesn't apply to you. |
121 |
|
122 |
|
123 |
|
124 |
|
125 |
|
126 |
--------------------------------------------------------------------- |
127 |
Bruce A. Locke |
128 |
blocke@××××××.org |