HELLO v3!!!
This commit is contained in:
34
lib/wpscan/errors/http.rb
Normal file
34
lib/wpscan/errors/http.rb
Normal file
@@ -0,0 +1,34 @@
|
||||
module WPScan
|
||||
# HTTP Error
|
||||
class HTTPError < StandardError
|
||||
attr_reader :response
|
||||
|
||||
# @param [ Typhoeus::Response ] res
|
||||
def initialize(response)
|
||||
@response = response
|
||||
end
|
||||
|
||||
def failure_details
|
||||
msg = response.effective_url
|
||||
|
||||
msg += if response.code.zero? || response.timed_out?
|
||||
" (#{response.return_message})"
|
||||
else
|
||||
" (status: #{response.code})"
|
||||
end
|
||||
|
||||
msg
|
||||
end
|
||||
|
||||
def to_s
|
||||
"HTTP Error: #{failure_details}"
|
||||
end
|
||||
end
|
||||
|
||||
# Used in the Updater
|
||||
class DownloadError < HTTPError
|
||||
def to_s
|
||||
"Unable to get #{failure_details}"
|
||||
end
|
||||
end
|
||||
end
|
||||
8
lib/wpscan/errors/update.rb
Normal file
8
lib/wpscan/errors/update.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
module WPScan
|
||||
# Error raised when there is a missing DB file and --no-update supplied
|
||||
class MissingDatabaseFile < StandardError
|
||||
def to_s
|
||||
'Update required, you can not run a scan if a database file is missing.'
|
||||
end
|
||||
end
|
||||
end
|
||||
22
lib/wpscan/errors/wordpress.rb
Normal file
22
lib/wpscan/errors/wordpress.rb
Normal file
@@ -0,0 +1,22 @@
|
||||
module WPScan
|
||||
# WordPress hosted (*.wordpress.com)
|
||||
class WordPressHostedError < StandardError
|
||||
def to_s
|
||||
'Scanning *.wordpress.com hosted blogs is not supported.'
|
||||
end
|
||||
end
|
||||
|
||||
# Not WordPress Error
|
||||
class NotWordPressError < StandardError
|
||||
def to_s
|
||||
'The remote website is up, but does not seem to be running WordPress.'
|
||||
end
|
||||
end
|
||||
|
||||
# Invalid Wp Version (used in the WpVersion#new)
|
||||
class InvalidWordPressVersion < StandardError
|
||||
def to_s
|
||||
'The WordPress version is invalid'
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user