Skip to content

Commit d7c0ce4

Browse files
committed
Fix 'check()' in glossword_upload_exec
1 parent 1f46b3a commit d7c0ce4

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

modules/exploits/multi/http/glossword_upload_exec.rb

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,14 @@ def check
6060
print_status("#{peer} - Authenticating as user '#{user}'")
6161
begin
6262
res = login(base, user, pass)
63-
if res and res.code == 200
64-
print_error("#{peer} - Authentication failed")
65-
return Exploit::CheckCode::Unknown
66-
elsif res.code == 301 and res.headers['set-cookie'] =~ /sid([\da-f]+)=([\da-f]{32})/
67-
print_good("#{peer} - Authenticated successfully")
68-
return Exploit::CheckCode::Appears
63+
if res
64+
if res.code == 200
65+
print_error("#{peer} - Authentication failed")
66+
return Exploit::CheckCode::Unknown
67+
elsif res.code == 301 and res.headers['set-cookie'] =~ /sid([\da-f]+)=([\da-f]{32})/
68+
print_good("#{peer} - Authenticated successfully")
69+
return Exploit::CheckCode::Appears
70+
end
6971
end
7072
return Exploit::CheckCode::Safe
7173
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout

0 commit comments

Comments
 (0)