Class: Arachni::Element::Base
Constant Summary
Constants included from Capabilities::Auditable
Capabilities::Auditable::OPTIONS
Constants included from Capabilities::Auditable::RDiff
Capabilities::Auditable::RDiff::RDIFF_OPTIONS
Constants included from Capabilities::Auditable::Taint
Capabilities::Auditable::Taint::TAINT_OPTIONS
Constants included from Capabilities::Mutable
Capabilities::Mutable::MUTATION_OPTIONS
Instance Attribute Summary collapse
-
#raw ⇒ Hash
readonly
Relatively ‘raw’ (frozen) hash holding the element’s HTML attributes, values, etc.
Attributes included from Capabilities::Auditable
Attributes included from Capabilities::Mutable
Instance Method Summary collapse
-
#action ⇒ String
The url to which the element points and should be audited against.
- #action=(url) ⇒ Object
- #dup ⇒ Object
-
#id ⇒ String
Must provide a string uniquely identifying self.
-
#initialize(url, raw = {}) ⇒ Base
constructor
Initialize the element.
-
#method ⇒ String
Method for the element.
- #method=(method) ⇒ Object
-
#simple ⇒ Object
Must provide a simple hash representation of self.
-
#type ⇒ Object
Must provide the element type, one of Module::Auditor::Element.
-
#url ⇒ String
The URL of the page that owns the element.
- #url=(url) ⇒ Object
Methods included from Utilities
cookie_encode, cookies_from_document, cookies_from_file, cookies_from_response, exception_jail, exclude_path?, extract_domain, form_decode, form_encode, form_parse_request_body, forms_from_document, forms_from_response, get_path, hash_keys_to_str, html_decode, html_encode, include_path?, links_from_document, links_from_response, normalize_url, page_from_response, page_from_url, parse_query, parse_set_cookie, parse_url_vars, path_in_domain?, path_too_deep?, remove_constants, seed, skip_path?, to_absolute, uri_decode, uri_encode, uri_parse, uri_parser, url_sanitize
Methods included from Capabilities::Auditable
#==, #[], #[]=, #audit, #audit_id, #auditable, #auditable=, #changes, #debug?, #has_inputs?, #hash, #http, #http_request, #info, #orphan?, #override_instance_scope, #override_instance_scope?, #print_bad, #print_debug, #print_debug_backtrace, #print_error, #print_error_backtrace, #print_info, #print_line, #print_ok, #print_status, #provisioned_issue_id, #remove_auditor, #reset, reset, reset_instance_scope, #reset_scope_override, restrict_to_elements, #scope_audit_id, #skip?, #skip_path?, #status_string, #submit, #update
Methods included from Capabilities::Auditable::RDiff
Methods included from Capabilities::Auditable::Timeout
add_timeout_audit_block, add_timeout_candidate, #call_on_timing_blocks, call_on_timing_blocks, current_timeout_audit_operations_cnt, included, on_timing_attacks, #responsive?, running_timeout_attacks?, #timeout_analysis, timeout_analysis_phase_2, timeout_audit_blocks, timeout_audit_operations_cnt, timeout_audit_run, timeout_loaded_modules
Methods included from Capabilities::Auditable::Taint
Methods included from Capabilities::Mutable
#altered_value, #altered_value=, #immutables, #mutated?, #mutations, #mutations_for, #original?, #permutations, #permutations_for
Constructor Details
#initialize(url, raw = {}) ⇒ Base
Initialize the element.
49 50 51 52 53 54 55 |
# File 'lib/arachni/element/base.rb', line 49 def initialize( url, raw = {} ) @raw = raw.dup @raw.freeze self.url = url.to_s @opts = {} end |
Instance Attribute Details
#raw ⇒ Hash (readonly)
Relatively ‘raw’ (frozen) hash holding the element’s HTML attributes, values, etc.
41 42 43 |
# File 'lib/arachni/element/base.rb', line 41 def raw @raw end |
Instance Method Details
#action ⇒ String
The url to which the element points and should be audited against.
Ex. ‘href’ for links, ‘action’ for forms, etc.
102 103 104 |
# File 'lib/arachni/element/base.rb', line 102 def action @action.freeze end |
#action=(url) ⇒ Object
107 108 109 110 111 |
# File 'lib/arachni/element/base.rb', line 107 def action=( url ) @action = self.url ? to_absolute( url, self.url ) : normalize_url( url ) rehash self.action end |
#dup ⇒ Object
136 137 138 139 140 141 142 143 144 |
# File 'lib/arachni/element/base.rb', line 136 def dup new = self.class.new( @url ? @url.dup : nil, @raw.dup ) new.override_instance_scope if override_instance_scope? new.auditor = self.auditor new.method = self.method.dup new.altered = self.altered.dup if self.altered new.auditable = self.auditable.dup new end |
#id ⇒ String
Must provide a string uniquely identifying self.
62 63 64 |
# File 'lib/arachni/element/base.rb', line 62 def id @raw.to_s end |
#method ⇒ String
Method for the element.
Should represent a method in Module::HTTP.
Ex. get, post, cookie, header
84 85 86 |
# File 'lib/arachni/element/base.rb', line 84 def method @method.freeze end |
#method=(method) ⇒ Object
89 90 91 92 93 |
# File 'lib/arachni/element/base.rb', line 89 def method=( method ) @method = method rehash self.method end |
#simple ⇒ Object
Must provide a simple hash representation of self
69 70 71 |
# File 'lib/arachni/element/base.rb', line 69 def simple {} end |
#type ⇒ Object
Must provide the element type, one of Module::Auditor::Element.
132 133 134 |
# File 'lib/arachni/element/base.rb', line 132 def type self.class.name.split( ':' ).last.downcase end |
#url ⇒ String
The URL of the page that owns the element.
118 119 120 |
# File 'lib/arachni/element/base.rb', line 118 def url @url.freeze end |
#url=(url) ⇒ Object
123 124 125 126 127 |
# File 'lib/arachni/element/base.rb', line 123 def url=( url ) @url = normalize_url( url ) rehash self.url end |