Skip to content

Commit 2fa75e0

Browse files
committed
Fix undefined method error
[FixRM rapid7#8325]
1 parent be29e44 commit 2fa75e0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

modules/auxiliary/scanner/http/wordpress_login_enum.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,15 @@ def do_enum(user=nil)
111111
'data' => post_data,
112112
}, 20)
113113

114+
if res.nil?
115+
print_error("Connection timed out")
116+
return :abort
117+
end
118+
114119

115120
valid_user = false
116121

117-
if (res and res.code == 200 )
122+
if res.code == 200
118123
if (res.body.to_s =~ /Incorrect password/ )
119124
valid_user = true
120125

@@ -150,7 +155,9 @@ def do_enum(user=nil)
150155
end
151156

152157
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout
158+
return :abort
153159
rescue ::Timeout::Error, ::Errno::EPIPE
160+
return :abort
154161
end
155162
end
156163

0 commit comments

Comments
 (0)