Skip to content

Commit 9df09a1

Browse files
committed
readme detection
1 parent 7dde7f6 commit 9df09a1

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

lib/msf/http/wordpress/version.rb

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,18 +107,15 @@ def check_version_from_readme(type, name, fixed_version = nil, vuln_introduced_v
107107
fail("Unknown readme type #{type}")
108108
end
109109

110-
readme_url = normalize_uri(target_uri.path, wp_content_dir, folder, name, 'readme.txt')
111-
res = send_request_cgi(
112-
'uri' => readme_url,
113-
'method' => 'GET'
114-
)
115-
116-
if res.nil? || res.code != 200
117-
readme_url = normalize_uri(target_uri.path, wp_content_dir, folder, name, 'Readme.txt')
110+
readmes = ['readme.txt', 'Readme.txt', 'README.txt']
111+
112+
readmes.each do |r|
113+
readme_url = normalize_uri(target_uri.path, wp_content_dir, folder, name, 'readme.txt')
118114
res = send_request_cgi(
119115
'uri' => readme_url,
120116
'method' => 'GET'
121117
)
118+
break if res && res.code == 200
122119
end
123120

124121
if res.nil? || res.code != 200

0 commit comments

Comments
 (0)