Class: Arachni::Parser::Element::Base Abstract
- Inherits:
-
Element::Auditable
- Object
- Element::Auditable
- Arachni::Parser::Element::Base
- Defined in:
- lib/arachni/parser/elements.rb
Overview
Base element class.
Should be extended/implemented by all HTML/HTTP modules.
@author: Tasos “Zapotek” Laskos
<[email protected]>
<[email protected]>
@version: 0.1
Instance Attribute Summary collapse
-
#action ⇒ String
The url to which the element points and should be audited against.
-
#auditable ⇒ Object
Returns the value of attribute auditable.
-
#method ⇒ String
Method of the element.
-
#orig ⇒ Object
Returns the value of attribute orig.
-
#raw ⇒ Hash
Relatively ‘raw’ hash holding the element’s attributes, values, etc.
-
#url ⇒ String
The URL of the page that owns the element.
Attributes inherited from Element::Auditable
Instance Method Summary collapse
- #dup ⇒ Object
-
#id ⇒ String
Must provide a string uniquely identifying self.
-
#initialize(url, raw = {}) ⇒ Base
constructor
Initialize the element.
-
#simple ⇒ Object
Must provide a simple hash representation of self.
-
#type ⇒ Object
Must provide the element type, one of Module::Auditor::Element.
Methods inherited from Element::Auditable
#audit, #audit_id, #auditor, #debug?, #get_auditor, #get_status_str, #http_request, #info, #injection_sets, #override_instance_scope!, #override_instance_scope?, #print_debug, #print_error, #print_status, reset, restrict_to_elements!, #skip?, #submit
Methods included from Module::Utilities
#exception_jail, #get_path, #hash_keys_to_str, #normalize_url, #read_file, #seed, #uri_decode, #uri_encode, #uri_parse, #uri_parser, #url_sanitize
Constructor Details
#initialize(url, raw = {}) ⇒ Base
Initialize the element.
79 80 81 82 |
# File 'lib/arachni/parser/elements.rb', line 79 def initialize( url, raw = {} ) @raw = raw.dup @url = url.to_s end |
Instance Attribute Details
#action ⇒ String
The url to which the element points and should be audited against.
Ex. ‘href’ for links, ‘action’ for forms, etc.
47 48 49 |
# File 'lib/arachni/parser/elements.rb', line 47 def action @action end |
#auditable ⇒ Object
Returns the value of attribute auditable.
49 50 51 |
# File 'lib/arachni/parser/elements.rb', line 49 def auditable @auditable end |
#method ⇒ String
Method of the element.
Should represent a method in Module::HTTP.
Ex. get, post, cookie, header
71 72 73 |
# File 'lib/arachni/parser/elements.rb', line 71 def method @method end |
#orig ⇒ Object
Returns the value of attribute orig.
51 52 53 |
# File 'lib/arachni/parser/elements.rb', line 51 def orig @orig end |
#raw ⇒ Hash
Relatively ‘raw’ hash holding the element’s attributes, values, etc.
58 59 60 |
# File 'lib/arachni/parser/elements.rb', line 58 def raw @raw end |
#url ⇒ String
The URL of the page that owns the element.
38 39 40 |
# File 'lib/arachni/parser/elements.rb', line 38 def url @url end |
Instance Method Details
#dup ⇒ Object
107 108 109 |
# File 'lib/arachni/parser/elements.rb', line 107 def dup self.class.new( @url.dup, @raw.dup ) end |
#id ⇒ String
Must provide a string uniquely identifying self.
89 90 91 |
# File 'lib/arachni/parser/elements.rb', line 89 def id return @raw.to_s end |
#simple ⇒ Object
Must provide a simple hash representation of self
96 97 98 |
# File 'lib/arachni/parser/elements.rb', line 96 def simple end |
#type ⇒ Object
Must provide the element type, one of Module::Auditor::Element.
103 104 105 |
# File 'lib/arachni/parser/elements.rb', line 103 def type end |