Checks if the remote website is up.
# File lib/wpscan/modules/web_site.rb, line 52 def is_online? Browser.instance.get(@uri.to_s).code != 0 end
check if the remote website is actually running wordpress.
# File lib/wpscan/modules/web_site.rb, line 23 def is_wordpress? wordpress = false response = Browser.instance.get(login_url(), :follow_location => true, :max_redirects => 2 ) if response.body =~ %{WordPress} wordpress = true else response = Browser.instance.get(xmlrpc_url(), :follow_location => true, :max_redirects => 2 ) if response.body =~ %{XML-RPC server accepts POST requests only} wordpress = true end end wordpress end
see if the remote url returns 30x redirect return a string with the redirection or nil
# File lib/wpscan/modules/web_site.rb, line 58 def redirection(url = nil) url ||= @uri.to_s response = Browser.instance.get(url) if response.code == 301 || response.code == 302 redirection = response.headers_hash['location'] end redirection end
Generated with the Darkfish Rdoc Generator 2.