Skip to content

Commit 8eeb66f

Browse files
committed
Fix undefined method error
[FixRM rapid7#8332]
1 parent 785f633 commit 8eeb66f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

modules/auxiliary/scanner/http/novell_mdm_creds.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ def get_creds(session_id,cmd_var)
6969
cmd_var => cmd
7070
}
7171
})
72+
73+
if res.nil?
74+
print_error("Connection timed out")
75+
return "", "" # Empty username & password
76+
end
77+
7278
creds = res.body.to_s.match(/.*:"(.*)";.*";/)[1]
7379
return creds.split(":")
7480
end
@@ -89,6 +95,7 @@ def run_host(ip)
8995
print_status("Found Version #{ver}")
9096
session_id,cmd = setup_session()
9197
user,pass = get_creds(session_id,cmd)
98+
return if user.empty? and pass.empty?
9299
print_good("Got creds. Login:#{user} Password:#{pass}")
93100
print_good("Access the admin interface here: #{ip}:#{rport}#{target_uri.path}dashboard/")
94101

0 commit comments

Comments
 (0)