Class: Ronin::Vulns::LFI::TestFile Private
- Inherits:
-
Object
- Object
- Ronin::Vulns::LFI::TestFile
- Defined in:
- lib/ronin/vulns/lfi/test_file.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 single Local File Inclusion (LFI) test for a given file path and a regexp that matches the file.
Instance Attribute Summary collapse
-
#path ⇒ String
readonly
private
The path of the file to attempt including.
-
#regexp ⇒ Regexp
readonly
private
The regexp to identify a successful Local File Inclusion (LFI) of the #path.
Instance Method Summary collapse
-
#=~(response_body) ⇒ Integer?
private
Tests whether the file was successfully included into the response body.
-
#initialize(path, regexp) ⇒ TestFile
constructor
private
Initializes the Local File Inclusion (LFI) test.
-
#match(response_body) ⇒ MatchData?
private
Tests whether the file was successfully included into the response body.
Constructor Details
#initialize(path, regexp) ⇒ TestFile
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 Local File Inclusion (LFI) test.
55 56 57 58 |
# File 'lib/ronin/vulns/lfi/test_file.rb', line 55 def initialize(path,regexp) @path = path @regexp = regexp end |
Instance Attribute Details
#path ⇒ String (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 path of the file to attempt including.
37 38 39 |
# File 'lib/ronin/vulns/lfi/test_file.rb', line 37 def path @path end |
#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 regexp to identify a successful Local File Inclusion (LFI) of the #path.
43 44 45 |
# File 'lib/ronin/vulns/lfi/test_file.rb', line 43 def regexp @regexp 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.
84 85 86 |
# File 'lib/ronin/vulns/lfi/test_file.rb', line 84 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 file was successfully included into the response body.
70 71 72 |
# File 'lib/ronin/vulns/lfi/test_file.rb', line 70 def match(response_body) response_body.match(@regexp) end |