Class: Ronin::Vulns::SQLI::ErrorPattern Private
- Inherits:
-
Object
- Object
- Ronin::Vulns::SQLI::ErrorPattern
- Defined in:
- lib/ronin/vulns/sqli/error_pattern.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Represents a collection of patterns for SQL error messages for a particular database.
Instance Attribute Summary collapse
-
#regexp ⇒ Regexp
readonly
private
The combined error message regexp.
Class Method Summary collapse
-
.[](*regexps) ⇒ Object
private
Creates an error pattern from multiple different regexps.
Instance Method Summary collapse
-
#=~(response_body) ⇒ Integer?
private
Tests whether the file was successfully included into the response body.
-
#initialize(regexp) ⇒ ErrorPattern
constructor
private
Initializes the error pattern.
-
#match(response_body) ⇒ MatchData?
private
Tests whether the response body contains a SQL error.
Constructor Details
#initialize(regexp) ⇒ ErrorPattern
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initializes the error pattern.
45 46 47 |
# File 'lib/ronin/vulns/sqli/error_pattern.rb', line 45 def initialize(regexp) @regexp = regexp end |
Instance Attribute Details
#regexp ⇒ Regexp (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The combined error message regexp.
37 38 39 |
# File 'lib/ronin/vulns/sqli/error_pattern.rb', line 37 def regexp @regexp end |
Class Method Details
.[](*regexps) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Creates an error pattern from multiple different regexps.
55 56 57 |
# File 'lib/ronin/vulns/sqli/error_pattern.rb', line 55 def self.[](*regexps) new(Regexp.union(regexps)) end |
Instance Method Details
#=~(response_body) ⇒ Integer?
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Tests whether the file was successfully included into the response body.
82 83 84 |
# File 'lib/ronin/vulns/sqli/error_pattern.rb', line 82 def =~(response_body) response_body =~ @regexp end |
#match(response_body) ⇒ MatchData?
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Tests whether the response body contains a SQL error.
68 69 70 |
# File 'lib/ronin/vulns/sqli/error_pattern.rb', line 68 def match(response_body) @regexp.match(response_body) end |