Skip to content

Commit 0561928

Browse files
committed
Fix undefined method error
[FixRM rapid7#8336]
1 parent 2597c71 commit 0561928

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

modules/auxiliary/scanner/http/majordomo2_directory_traversal.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ def run_host(ip)
7171
'uri' => uri + payload,
7272
}, 25)
7373

74+
if res.nil?
75+
print_error("Connection timed out")
76+
return
77+
end
78+
7479
print_status("#{rhost}:#{rport} Trying URL " + payload )
7580

7681
if (res and res.code == 200 and res.body)
@@ -93,6 +98,7 @@ def run_host(ip)
9398
print_error("#{rhost}:#{rport} No HTML was returned")
9499
end
95100
else
101+
# if res is nil, we hit this
96102
print_error("#{rhost}:#{rport} Unrecognized #{res.code} response")
97103
end
98104
i += 1;

0 commit comments

Comments
 (0)