summaryrefslogtreecommitdiff
path: root/informationals/teso-i0030.txt
diff options
context:
space:
mode:
Diffstat (limited to 'informationals/teso-i0030.txt')
-rw-r--r--informationals/teso-i0030.txt53
1 files changed, 53 insertions, 0 deletions
diff --git a/informationals/teso-i0030.txt b/informationals/teso-i0030.txt
new file mode 100644
index 0000000..2b9593e
--- /dev/null
+++ b/informationals/teso-i0030.txt
@@ -0,0 +1,53 @@
10030 2000/10/14 exploitable format string problem in cfingerd <= 1.4.2
2
3==== TESO Informational =======================================================
4This piece of information is to be kept confidential.
5===============================================================================
6
7Description ..........: exploitable format string problem in cfingerd <= 1.4.2
8Date .................: 2000/10/14 12:00
9Author ...............: scut
10Publicity level ......: unknown
11Affected .............: cfingerd (The Configureable Finger Daemon) <= 1.4.2
12Type of entity .......: exploitable format string vulnerability
13Type of discovery ....: vulnerabilitiy
14Severity/Importance ..: high
15Found by .............: scut
16
17===============================================================================
18
19The Configureable Finger Daemon claims from itself to be quite secure, however
20it suffered from several buffer overflows in the past, and this time it suffers
21from a format string vulnerability when calling syslog, as in:
22
23snprintf(syslog_str, sizeof(syslog_str), "%s fingered (internal) from %s",
24 username, ident_user);
25syslog(LOG_NOTICE, (char *) syslog_str);
26
27And some other times in the code. Although it looks like it is trivial to
28exploit, this may not be as easy as it looks. We can supply both the username
29and the ident_user buffers, though the ident_user buffer is limited to 60
30arbitrary bytes. The username buffer has to survive very restrictive whitelist
31filtering, hence it is not suitable to store the shellcode in it. And 60 bytes
32is not enough usually to store the stackpop+addresses+write+shellcode (using
33"%.f" or the like to move esp) or the write+addresses+shellcode (using %..$n)
34in it, so we have to find another way to inject the data into the memory.
35
36Here is how we do it:
37sscanf(username, "%[^\r\n]\r\n", username);
38
39This line allows us to store an additional 70 arbitrary bytes, if we make
40username look like this: legit\rourdata, where legit is a normal finger query,
41and ourdata is arbitrary stuff. The \r char will be overwritten by a NUL byte
42and hence the following restrictive filtering only affects the legit content.
43
44This is how we exploit it on Linux (debian 2.1/2.2), on *BSD (and bsd libc
45based systems) we run into problems with the %..$n trick, because they deny
46large values. I currently know of no way to exploit this on BSD.
47
48An exploit is available as 7350cfingerd, with default offsets for some
49distributions. Cfingerd is not enabled on most distributions by default,
50however.
51
52===============================================================================
53