Skip to content

Commit 29bb788

Browse files
committed
Better login detection for wordpress
1 parent c1f612b commit 29bb788

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/msf/http/wordpress/login.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,13 @@ def wordpress_login(user, pass)
1515
})
1616

1717
if res and (res.code == 301 or res.code == 302) and res.headers['Location'] == redirect
18-
return res.get_cookies
18+
cookies = res.get_cookies
19+
# Check if a valid wordpress cookie is returned
20+
return cookies if cookies =~ /wordpress(?:_sec)?_logged_in_[^=]+=[^;]+;/i ||
21+
cookies =~ /wordpress(?:user|pass)_[^=]+=[^;]+;/i ||
22+
cookies =~ /wordpress_[a-z0-9]+=[^;]+;/i
1923
end
24+
2025
return nil
2126
end
2227

0 commit comments

Comments
 (0)