# File lib/wpscan/wp_item.rb, line 64 def <=>(item) item.name <=> @name end
# File lib/wpscan/wp_item.rb, line 60 def ==(item) item.name == @name end
# File lib/wpscan/wp_item.rb, line 80 def changelog_url get_url_without_filename.merge("changelog.txt") end
Is directory listing enabled?
# File lib/wpscan/wp_item.rb, line 46 def directory_listing? # Need to remove to file part from the url Browser.instance.get(location_uri_from_file_url(get_url.to_s)).body[%{<title>Index of}] ? true : false end
# File lib/wpscan/wp_item.rb, line 51 def extract_name_from_url(url) url.to_s[%{^(https?://.*/([^/]+)/)}, 2] end
# File lib/wpscan/wp_item.rb, line 23 def get_url URI.parse("#{@url.to_s}#@wp_content_dir/#@path") end
# File lib/wpscan/wp_item.rb, line 27 def get_url_without_filename matches = @path.match(%{^(.*/).*$}) if matches == nil or matches.length < 2 dirname = @path else dirname = matches[1] end URI.parse("#{@url.to_s}#@wp_content_dir/#{dirname}") end
# File lib/wpscan/wp_item.rb, line 92 def has_changelog? unless @changelog status = Browser.instance.get(changelog_url).code @changelog = status == 200 ? true : false end @changelog end
# File lib/wpscan/wp_item.rb, line 84 def has_readme? unless @readme status = Browser.instance.get(readme_url).code @readme = status == 200 ? true : false end @readme end
# File lib/wpscan/wp_item.rb, line 68 def location_uri_from_file_url(location_url) valid_location_url = location_url[%{^(https?://.*/)[^.]+\.[^/]+$}, 1] unless valid_location_url valid_location_url = add_trailing_slash(location_url) end URI.parse(valid_location_url) end
# File lib/wpscan/wp_item.rb, line 76 def readme_url get_url_without_filename.merge("readme.txt") end
Generated with the Darkfish Rdoc Generator 2.