Check the wp-login.php for potential redirection before using it

This commit is contained in:
erwanlr
2019-03-14 18:06:32 +00:00
parent 27fc6a7279
commit e7925de5bc
2 changed files with 42 additions and 1 deletions

View File

@@ -72,9 +72,21 @@ module WPScan
)
end
# The login page is checked for a potential redirection (from http to https)
# the first time the method is called, and the effective_url is then used
# if suitable, otherwise the default wp-login will be.
#
# @return [ String ] The URL to the login page
def login_url
url('wp-login.php')
return @login_url if @login_url
@login_url = url('wp-login.php')
res = Browser.get_and_follow_location(@login_url)
@login_url = res.effective_url if in_scope?(res.effective_url)
@login_url
end
end
end