Removes Changelog detection

This commit is contained in:
erwanlr
2019-03-28 13:40:58 +00:00
parent 1cf330b389
commit 0aa1f20d47
11 changed files with 2 additions and 32 deletions

View File

@@ -9,8 +9,7 @@ module WPScan
include CMSScanner::Target::Platform::PHP include CMSScanner::Target::Platform::PHP
include CMSScanner::Target::Server::Generic include CMSScanner::Target::Server::Generic
READMES = %w[readme.txt README.txt README.md readme.md Readme.txt].freeze READMES = %w[readme.txt README.txt README.md readme.md Readme.txt].freeze
CHANGELOGS = %w[changelog.txt CHANGELOG.md changelog.md].freeze
attr_reader :uri, :slug, :detection_opts, :version_detection_opts, :blog, :path_from_blog, :db_data attr_reader :uri, :slug, :detection_opts, :version_detection_opts, :blog, :path_from_blog, :db_data
@@ -127,21 +126,6 @@ module WPScan
@readme_url = false @readme_url = false
end end
# @return [ String, false ] The changelog url if found, false otherwise
def changelog_url
return if detection_opts[:mode] == :passive
return @changelog_url unless @changelog_url.nil?
CHANGELOGS.each do |path|
t_url = url(path)
return @changelog_url = t_url if Browser.forge_request(t_url, blog.head_or_get_params).run.code == 200
end
@changelog_url = false
end
# @param [ String ] path # @param [ String ] path
# @param [ Hash ] params The request params # @param [ Hash ] params The request params
# #

View File

@@ -8,9 +8,6 @@
<% if @wp_item.readme_url -%> <% if @wp_item.readme_url -%>
| Readme: <%= @wp_item.readme_url %> | Readme: <%= @wp_item.readme_url %>
<% end -%> <% end -%>
<% if @wp_item.changelog_url -%>
| Changelog: <%= @wp_item.changelog_url %>
<% end -%>
<% if @wp_item.latest_version && @wp_item.outdated? -%> <% if @wp_item.latest_version && @wp_item.outdated? -%>
| <%= warning_icon %> The version is out of date, the latest version is <%= @wp_item.latest_version %> | <%= warning_icon %> The version is out of date, the latest version is <%= @wp_item.latest_version %>
<% end -%> <% end -%>

View File

@@ -4,6 +4,5 @@
"last_updated": <%= @wp_item.last_updated.to_json %>, "last_updated": <%= @wp_item.last_updated.to_json %>,
"outdated": <%= @wp_item.outdated?.to_json %>, "outdated": <%= @wp_item.outdated?.to_json %>,
"readme_url": <%= @wp_item.readme_url.to_json %>, "readme_url": <%= @wp_item.readme_url.to_json %>,
"changelog_url": <%= @wp_item.changelog_url.to_json %>,
"directory_listing": <%= @wp_item.directory_listing?.to_json %>, "directory_listing": <%= @wp_item.directory_listing?.to_json %>,
"error_log_url": <% if @wp_item.error_log? %><%= @wp_item.url('error_log').to_json %><% else %>null<% end %> "error_log_url": <% if @wp_item.error_log? %><%= @wp_item.url('error_log').to_json %><% else %>null<% end %>

View File

@@ -117,10 +117,6 @@ describe WPScan::Model::WpItem do
xit xit
end end
describe '#changelog_url' do
xit
end
describe '#directory_listing?' do describe '#directory_listing?' do
xit xit
end end

View File

@@ -1,7 +1,6 @@
[+] WordPress theme in use: test [+] WordPress theme in use: test
| Location: http://ex.lo/wp-content/themes/test/ | Location: http://ex.lo/wp-content/themes/test/
| Readme: http://ex.lo/wp-content/themes/test/readme.txt | Readme: http://ex.lo/wp-content/themes/test/readme.txt
| Changelog: http://ex.lo/wp-content/themes/test/changelog.txt
| Style URL: http://ex.lo/wp-content/themes/test/style.css | Style URL: http://ex.lo/wp-content/themes/test/style.css
| Style Name: Twenty Fifteen | Style Name: Twenty Fifteen
| Style URI: https://wordpress.org/themes/twentyfifteen | Style URI: https://wordpress.org/themes/twentyfifteen

View File

@@ -6,7 +6,6 @@
"last_updated": null, "last_updated": null,
"outdated": false, "outdated": false,
"readme_url": "http://ex.lo/wp-content/themes/test/readme.txt", "readme_url": "http://ex.lo/wp-content/themes/test/readme.txt",
"changelog_url": "http://ex.lo/wp-content/themes/test/changelog.txt",
"directory_listing": false, "directory_listing": false,
"error_log_url": null, "error_log_url": null,
"style_url": "http://ex.lo/wp-content/themes/test/style.css", "style_url": "http://ex.lo/wp-content/themes/test/style.css",

View File

@@ -1,7 +1,6 @@
[+] WordPress theme in use: test [+] WordPress theme in use: test
| Location: http://ex.lo/wp-content/themes/test/ | Location: http://ex.lo/wp-content/themes/test/
| Readme: http://ex.lo/wp-content/themes/test/readme.txt | Readme: http://ex.lo/wp-content/themes/test/readme.txt
| Changelog: http://ex.lo/wp-content/themes/test/changelog.txt
| Style URL: http://ex.lo/wp-content/themes/test/style.css | Style URL: http://ex.lo/wp-content/themes/test/style.css
| Style Name: Twenty Fifteen | Style Name: Twenty Fifteen
| Style URI: https://wordpress.org/themes/twentyfifteen | Style URI: https://wordpress.org/themes/twentyfifteen

View File

@@ -6,7 +6,6 @@
"last_updated": null, "last_updated": null,
"outdated": false, "outdated": false,
"readme_url": "http://ex.lo/wp-content/themes/test/readme.txt", "readme_url": "http://ex.lo/wp-content/themes/test/readme.txt",
"changelog_url": "http://ex.lo/wp-content/themes/test/changelog.txt",
"directory_listing": false, "directory_listing": false,
"error_log_url": null, "error_log_url": null,
"style_url": "http://ex.lo/wp-content/themes/test/style.css", "style_url": "http://ex.lo/wp-content/themes/test/style.css",

View File

@@ -1,7 +1,6 @@
[+] WordPress theme in use: dignitas-themes [+] WordPress theme in use: dignitas-themes
| Location: http://ex.lo/wp-content/themes/dignitas-themes/ | Location: http://ex.lo/wp-content/themes/dignitas-themes/
| Readme: http://ex.lo/wp-content/themes/dignitas-themes/readme.txt | Readme: http://ex.lo/wp-content/themes/dignitas-themes/readme.txt
| Changelog: http://ex.lo/wp-content/themes/dignitas-themes/changelog.txt
| Style URL: http://ex.lo/wp-content/themes/dignitas-themes/style.css | Style URL: http://ex.lo/wp-content/themes/dignitas-themes/style.css
| Style Name: Twenty Fifteen | Style Name: Twenty Fifteen
| Style URI: https://wordpress.org/themes/twentyfifteen | Style URI: https://wordpress.org/themes/twentyfifteen

View File

@@ -6,7 +6,6 @@
"last_updated": null, "last_updated": null,
"outdated": false, "outdated": false,
"readme_url": "http://ex.lo/wp-content/themes/dignitas-themes/readme.txt", "readme_url": "http://ex.lo/wp-content/themes/dignitas-themes/readme.txt",
"changelog_url": "http://ex.lo/wp-content/themes/dignitas-themes/changelog.txt",
"directory_listing": false, "directory_listing": false,
"error_log_url": null, "error_log_url": null,
"style_url": "http://ex.lo/wp-content/themes/dignitas-themes/style.css", "style_url": "http://ex.lo/wp-content/themes/dignitas-themes/style.css",

View File

@@ -22,7 +22,7 @@ shared_examples 'App::Views::MainTheme' do
before do before do
expect(target).to receive(:content_dir).at_least(1).and_return('wp-content') expect(target).to receive(:content_dir).at_least(1).and_return('wp-content')
# Stub all requests to 200, to detect a readme and changelog. # Stub all requests to 200, to detect the readme.
# Detection of the error_log will fail as the empty body won't match the patterns # Detection of the error_log will fail as the empty body won't match the patterns
stub_request(:head, /.*/) stub_request(:head, /.*/)
stub_request(:get, /.*/) stub_request(:get, /.*/)