-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Errors moved into their own namespace - Ref #1315
- Loading branch information
Showing
15 changed files
with
81 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,36 @@ | ||
module WPScan | ||
# HTTP Error | ||
class HTTPError < Error | ||
attr_reader :response | ||
module Error | ||
# HTTP Error | ||
class HTTP < Standard | ||
attr_reader :response | ||
|
||
# @param [ Typhoeus::Response ] res | ||
def initialize(response) | ||
@response = response | ||
end | ||
# @param [ Typhoeus::Response ] res | ||
def initialize(response) | ||
@response = response | ||
end | ||
|
||
def failure_details | ||
msg = response.effective_url | ||
def failure_details | ||
msg = response.effective_url | ||
|
||
msg += if response.code.zero? || response.timed_out? | ||
" (#{response.return_message})" | ||
else | ||
" (status: #{response.code})" | ||
end | ||
msg += if response.code.zero? || response.timed_out? | ||
" (#{response.return_message})" | ||
else | ||
" (status: #{response.code})" | ||
end | ||
|
||
msg | ||
end | ||
msg | ||
end | ||
|
||
def to_s | ||
"HTTP Error: #{failure_details}" | ||
def to_s | ||
"HTTP Error: #{failure_details}" | ||
end | ||
end | ||
end | ||
|
||
# Used in the Updater | ||
class DownloadError < HTTPError | ||
def to_s | ||
"Unable to get #{failure_details}" | ||
# Used in the Updater | ||
class Download < HTTP | ||
def to_s | ||
"Unable to get #{failure_details}" | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
module WPScan | ||
# Error raised when there is a missing DB file and --no-update supplied | ||
class MissingDatabaseFile < Error | ||
def to_s | ||
'Update required, you can not run a scan if a database file is missing.' | ||
module Error | ||
# Error raised when there is a missing DB file and --no-update supplied | ||
class MissingDatabaseFile < Standard | ||
def to_s | ||
'Update required, you can not run a scan if a database file is missing.' | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,30 @@ | ||
module WPScan | ||
# WordPress hosted (*.wordpress.com) | ||
class WordPressHostedError < Error | ||
def to_s | ||
'Scanning *.wordpress.com hosted blogs is not supported.' | ||
module Error | ||
# WordPress hosted (*.wordpress.com) | ||
class WordPressHosted < Standard | ||
def to_s | ||
'Scanning *.wordpress.com hosted blogs is not supported.' | ||
end | ||
end | ||
end | ||
|
||
# Not WordPress Error | ||
class NotWordPressError < Error | ||
def to_s | ||
'The remote website is up, but does not seem to be running WordPress.' | ||
# Not WordPress Error | ||
class NotWordPress < Standard | ||
def to_s | ||
'The remote website is up, but does not seem to be running WordPress.' | ||
end | ||
end | ||
end | ||
|
||
# Invalid Wp Version (used in the WpVersion#new) | ||
class InvalidWordPressVersion < Error | ||
def to_s | ||
'The WordPress version is invalid' | ||
# Invalid Wp Version (used in the WpVersion#new) | ||
class InvalidWordPressVersion < Standard | ||
def to_s | ||
'The WordPress version is invalid' | ||
end | ||
end | ||
end | ||
|
||
class WpContentDirNotDetected < Error | ||
def to_s | ||
'Unable to identify the wp-content dir, please supply it with --wp-content-dir' | ||
class WpContentDirNotDetected < Standard | ||
def to_s | ||
'Unable to identify the wp-content dir, please supply it with --wp-content-dir' | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
module WPScan | ||
# XML-RPC Not Detected | ||
class XMLRPCNotDetected < Error | ||
def to_s | ||
'The XML-RPC Interface was not detected.' | ||
module Error | ||
# XML-RPC Not Detected | ||
class XMLRPCNotDetected < Standard | ||
def to_s | ||
'The XML-RPC Interface was not detected.' | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters