Skip to content

Commit db36789

Browse files
committed
Land rapid7#4491, Fix test modules
2 parents 9bcb3b9 + 0c94536 commit db36789

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

test/modules/exploits/test/cmdweb.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class Metasploit3 < Msf::Exploit::Remote
1010
# =( need more targets and perhaps more OS specific return values OS specific would be preferred
1111

1212
include Msf::Exploit::Remote::HttpClient
13-
include Msf::Exploit::CmdStagerVBS
13+
include Rex::Exploitation::CmdStagerVBS
1414

1515
def initialize(info = {})
1616
super(update_info(info,

test/modules/post/test/services.rb

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def initialize(info={})
2929
register_options(
3030
[
3131
OptString.new("QSERVICE" , [true, "Service (keyname) to query", "winmgmt"]),
32-
OptString.new("NSERVICE" , [true, "New Service (keyname) to create/del", "testes"]),
32+
OptString.new("NSERVICE" , [true, "New Service (keyname) to create/del", "test"]),
3333
OptString.new("SSERVICE" , [true, "Service (keyname) to start/stop", "W32Time"]),
3434
OptString.new("DNAME" , [true, "Display name used for create test", "Cool display name"]),
3535
OptString.new("BINPATH" , [true, "Binary path for create test", "C:\\WINDOWS\\system32\\svchost.exe -k netsvcs"]),
@@ -69,7 +69,18 @@ def test_list
6969

7070
ret &&= results.kind_of? Array
7171
ret &&= results.length > 0
72-
ret &&= results.include? datastore["QSERVICE"]
72+
73+
# Adjust the QSERVICE to match the case of the service name. This is used
74+
# later in test_info, which is case-sensitive.
75+
found = false
76+
results.each do |service|
77+
if service.downcase == datastore["QSERVICE"].downcase
78+
datastore["QSERVICE"] = service.to_s
79+
found = true
80+
break
81+
end
82+
end
83+
ret &&= found
7384

7485
ret
7586
end
@@ -83,7 +94,8 @@ def test_info
8394
ret &&= results.kind_of? Hash
8495
if ret
8596
ret &&= results.has_key? "Name"
86-
ret &&= (results["Name"] == "Windows Management Instrumentation")
97+
ret &&= ([results["Name"]] &
98+
["Windows Management Instrumentation", "@%Systemroot%\\system32\\wbem\\\wmisvc.dll,-205"]).any?
8799
ret &&= results.has_key? "Startup"
88100
ret &&= results.has_key? "Command"
89101
ret &&= results.has_key? "Credentials"

0 commit comments

Comments
 (0)