Update HttpClient and WordPress mixins
parent
cab19dc63c
commit
31f93de150
|
@ -463,10 +463,10 @@ module Exploit::Remote::HttpClient
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns the complete URI as string including the scheme, port and host
|
# Returns the complete URI as string including the scheme, port and host
|
||||||
def full_uri
|
def full_uri(custom_uri = nil)
|
||||||
uri_scheme = ssl ? 'https' : 'http'
|
uri_scheme = ssl ? 'https' : 'http'
|
||||||
uri_port = rport.to_s == '80' ? '' : ":#{rport}"
|
uri_port = rport.to_s == '80' ? '' : ":#{rport}"
|
||||||
uri = normalize_uri(target_uri.to_s)
|
uri = normalize_uri(custom_uri || target_uri.to_s)
|
||||||
"#{uri_scheme}://#{rhost}#{uri_port}#{uri}"
|
"#{uri_scheme}://#{rhost}#{uri_port}#{uri}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -129,4 +129,11 @@ module Msf::Exploit::Remote::HTTP::Wordpress::URIs
|
||||||
normalize_uri(target_uri.path, 'xmlrpc.php')
|
normalize_uri(target_uri.path, 'xmlrpc.php')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Returns the Wordpress REST API URL
|
||||||
|
#
|
||||||
|
# @return [String] Wordpress REST API URL
|
||||||
|
def wordpress_url_rest_api
|
||||||
|
normalize_uri(target_uri.path, 'index.php/wp-json/wp/v2')
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
module Msf::Exploit::Remote::HTTP::Wordpress::Version
|
module Msf::Exploit::Remote::HTTP::Wordpress::Version
|
||||||
|
|
||||||
# Used to check if the version is correct: must contain at least one dot
|
# Used to check if the version is correct: must contain at least one dot
|
||||||
WORDPRESS_VERSION_PATTERN = '([^\r\n"\']+\.[^\r\n"\']+)'
|
WORDPRESS_VERSION_PATTERN = '(\d+\.\d+(?:\.\d+)*)'
|
||||||
|
|
||||||
# Extracts the Wordpress version information from various sources
|
# Extracts the Wordpress version information from various sources
|
||||||
#
|
#
|
||||||
|
@ -107,10 +107,10 @@ module Msf::Exploit::Remote::HTTP::Wordpress::Version
|
||||||
private
|
private
|
||||||
|
|
||||||
def wordpress_version_helper(url, regex)
|
def wordpress_version_helper(url, regex)
|
||||||
res = send_request_cgi(
|
res = send_request_cgi!({
|
||||||
'method' => 'GET',
|
'method' => 'GET',
|
||||||
'uri' => url
|
'uri' => url
|
||||||
)
|
}, 3.5)
|
||||||
if res
|
if res
|
||||||
match = res.body.match(regex)
|
match = res.body.match(regex)
|
||||||
return match[1] if match
|
return match[1] if match
|
||||||
|
|
Loading…
Reference in New Issue