Class: Arachni::Element::Base Abstract
Overview
Base class for all element types.
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::REMARK, Capabilities::Auditable::Taint::TAINT_OPTIONS
Constants included from Capabilities::Mutable
Capabilities::Mutable::MUTATION_OPTIONS
Instance Attribute Summary collapse
-
#raw ⇒ Hash
readonly
‘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
URI to which the element points and should be audited against.
- #action=(url) ⇒ Object
- #dup ⇒ Object
-
#id ⇒ String
abstract
String uniquely identifying self.
-
#initialize(url, raw = {}) ⇒ Base
constructor
A new instance of Base.
-
#method(*args) ⇒ Symbol
Should represent a method in Module::HTTP.
- #method=(method) ⇒ Object
-
#platforms ⇒ Platform
Applicable platforms for #action resource.
-
#simple ⇒ Hash
abstract
Simple representation of self.
-
#type ⇒ String
Element type.
-
#url ⇒ String
URL of the page that owns the element.
- #url=(url) ⇒ Object
Methods included from Utilities
available_port, cookie_encode, cookies_from_document, cookies_from_file, cookies_from_response, exception_jail, exclude_path?, extract_domain, follow_protocol?, form_decode, form_encode, form_parse_request_body, forms_from_document, forms_from_response, generate_token, get_path, 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?, port_available?, rand_port, redundant_path?, remove_constants, seed, skip_page?, skip_path?, skip_resource?, 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, #matches_skip_like_blocks?, #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_like, #status_string, #submit, #update, #use_anonymous_auditor
Methods included from Capabilities::Auditable::RDiff
Methods included from Capabilities::Auditable::Timeout
add_timeout_candidate, add_timeout_phase3_candidate, #call_on_timing_blocks, call_on_timing_blocks, current_timeout_audit_operations_cnt, deduplicate?, #deduplicate?, #disable_deduplication, disable_deduplication, enable_deduplication, #enable_deduplication, included, on_timing_attacks, reset, #responsive?, running_timeout_attacks?, #timeout_analysis, timeout_analysis_phase_2, timeout_analysis_phase_3, timeout_audit_operations_cnt, timeout_audit_run, timeout_candidates, timeout_loaded_modules
Methods included from Capabilities::Auditable::Taint
Methods included from Capabilities::Mutable
#altered_value, #altered_value=, #each_mutation, #immutables, #mutated?, #mutations, #mutations_for, #original?, #permutations, #permutations_for, #switch_method
Constructor Details
#initialize(url, raw = {}) ⇒ Base
Returns a new instance of Base.
48 49 50 51 52 53 54 |
# File 'lib/arachni/element/base.rb', line 48 def initialize( url, raw = {} ) @raw = raw.dup @raw.freeze self.url = url.to_s @opts = {} end |
Instance Attribute Details
#raw ⇒ Hash (readonly)
Returns ‘raw’ (frozen) hash holding the element’s HTML attributes, values, etc.
44 45 46 |
# File 'lib/arachni/element/base.rb', line 44 def raw @raw end |
Instance Method Details
#action ⇒ String
Ex. ‘href’ for links, ‘action’ for forms, etc.
Returns URI to which the element points and should be audited against.
98 99 100 |
# File 'lib/arachni/element/base.rb', line 98 def action @action.freeze end |
#action=(url) ⇒ Object
103 104 105 106 107 |
# File 'lib/arachni/element/base.rb', line 103 def action=( url ) @action = self.url ? to_absolute( url, self.url ) : normalize_url( url ) rehash self.action end |
#dup ⇒ Object
127 128 129 130 131 132 133 134 135 |
# File 'lib/arachni/element/base.rb', line 127 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
Returns String uniquely identifying self.
64 65 66 |
# File 'lib/arachni/element/base.rb', line 64 def id @raw.to_s end |
#method(*args) ⇒ Symbol
Should represent a method in Module::HTTP.
Ex. get, post, cookie, header
81 82 83 84 85 |
# File 'lib/arachni/element/base.rb', line 81 def method( *args ) return super( *args ) if args.any? @method.freeze end |
#method=(method) ⇒ Object
88 89 90 91 92 |
# File 'lib/arachni/element/base.rb', line 88 def method=( method ) @method = method rehash self.method end |
#platforms ⇒ Platform
Returns Applicable platforms for #action resource.
58 59 60 |
# File 'lib/arachni/element/base.rb', line 58 def platforms Platform::Manager[@action] end |
#simple ⇒ Hash
Returns Simple representation of self.
70 71 72 |
# File 'lib/arachni/element/base.rb', line 70 def simple {} end |
#type ⇒ String
Returns Element type.
123 124 125 |
# File 'lib/arachni/element/base.rb', line 123 def type self.class.name.split( ':' ).last.downcase end |
#url ⇒ String
Returns URL of the page that owns the element.
111 112 113 |
# File 'lib/arachni/element/base.rb', line 111 def url @url.freeze end |
#url=(url) ⇒ Object
116 117 118 119 120 |
# File 'lib/arachni/element/base.rb', line 116 def url=( url ) @url = normalize_url( url ) rehash self.url end |