WpItem::Infos

@uri is used instead of uri to avoid the presence of the :path into it

Public Instance Methods

changelog_url() click to toggle source

@return [ String ] The url to the changelog file

# File lib/common/models/wp_item/infos.rb, line 23
def changelog_url
  @uri.merge('changelog.txt').to_s
end
error_log_url() click to toggle source

@return [ String ] The url to the error_log file

# File lib/common/models/wp_item/infos.rb, line 48
def error_log_url
  @uri.merge('error_log').to_s
end
has_changelog?() click to toggle source

@return [ Boolean ]

# File lib/common/models/wp_item/infos.rb, line 18
def has_changelog?
  Browser.instance.get(changelog_url).code == 200 ? true : false
end
has_directory_listing?() click to toggle source

@return [ Boolean ]

# File lib/common/models/wp_item/infos.rb, line 28
def has_directory_listing?
  Browser.instance.get(@uri.to_s).body[%{<title>Index of}] ? true : false
end
has_error_log?() click to toggle source

Discover any error_log files created by WordPress These are created by the WordPress error_log() function They are normally found in the /plugins/ directory, however can also be found in their specific plugin dir. www.exploit-db.com/ghdb/3714/

Only the first 700 bytes are checked to avoid the download of the whole file which can be very huge (like 2 Go)

@return [ Boolean ]

# File lib/common/models/wp_item/infos.rb, line 42
def has_error_log?
  response_body = Browser.instance.get(error_log_url, headers: {'range' => 'bytes=0-700'}).body
  response_body[%{PHP Fatal error}] ? true : false
end
has_readme?() click to toggle source

@return [ Boolean ]

# File lib/common/models/wp_item/infos.rb, line 8
def has_readme?
  Browser.instance.get(readme_url).code == 200 ? true : false
end
readme_url() click to toggle source

@return [ String ] The url to the readme file

# File lib/common/models/wp_item/infos.rb, line 13
def readme_url
  @uri.merge('readme.txt').to_s
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.