Class: Arachni::Element::Cookie::DOM

Inherits:
Base show all
Includes:
Arachni::Element::Capabilities::Auditable::DOM
Defined in:
lib/arachni/element/cookie/dom.rb

Overview

Provides access to DOM operations for cookies.

Author:

Constant Summary

Constants included from Arachni::Element::Capabilities::Auditable::DOM

Arachni::Element::Capabilities::Auditable::DOM::INVALID_INPUT_DATA

Constants included from Arachni::Element::Capabilities::Auditable

Arachni::Element::Capabilities::Auditable::OPTIONS

Constants included from Arachni::Element::Capabilities::Mutable

Arachni::Element::Capabilities::Mutable::EXTRA_NAME, Arachni::Element::Capabilities::Mutable::FUZZ_NAME, Arachni::Element::Capabilities::Mutable::FUZZ_NAME_VALUE, Arachni::Element::Capabilities::Mutable::MUTATION_OPTIONS

Constants included from Arachni::Element::Capabilities::Inputtable

Arachni::Element::Capabilities::Inputtable::INPUTTABLE_CACHE

Constants inherited from Base

Base::MAX_SIZE

Instance Attribute Summary

Attributes included from Arachni::Element::Capabilities::Auditable::DOM

#action, #browser, #parent

Attributes included from Arachni::Element::Capabilities::Auditable

#audit_options

Attributes included from Arachni::Element::Capabilities::WithAuditor

#auditor

Attributes included from Arachni::Element::Capabilities::Mutable

#affected_input_name, #format, #seed

Attributes included from Arachni::Element::Capabilities::Inputtable

#default_inputs, #inputs

Attributes inherited from Base

#page

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Arachni::Element::Capabilities::Auditable::DOM

#decode, #dup, #element, #encode, included, #locate, #locator, #marshal_dump, #page, #prepare_for_report, #submit, #url=, #valid_input_data?, #with_browser, #with_browser_cluster

Methods included from Arachni::Element::Capabilities::Auditable

#audit, #audit_id, #audit_status_message, #audit_status_message_action, #audit_verbose_message, #coverage_hash, #coverage_id, #dup, #matches_skip_like_blocks?, #reset, reset, #skip?, skip_like

Methods included from Arachni::Element::Capabilities::WithAuditor

#dup, #marshal_dump, #orphan?, #prepare_for_report, #remove_auditor

Methods included from Arachni::Element::Capabilities::Mutable

#affected_input_value, #affected_input_value=, #dup, #each_mutation, #immutables, #inspect, #mutation?, #mutations, #reset, #switch_method, #to_h, #to_rpc_data

Methods included from Arachni::Element::Capabilities::Submittable

#action, #action=, #dup, #http, #http_request, #id, #method, #method=, #platforms, #submit, #to_h

Methods included from Arachni::Element::Capabilities::Inputtable

#[], #[]=, #changes, #dup, #has_inputs?, #inputtable_id, #reset, #to_h, #try_input, #update, #valid_input_data?, #valid_input_name?, #valid_input_name_data?, #valid_input_value?, #valid_input_value_data?

Methods included from Utilities

#available_port, #bytes_to_kilobytes, #bytes_to_megabytes, #caller_name, #caller_path, #cookie_decode, #cookie_encode, #cookies_from_document, #cookies_from_file, #cookies_from_response, #exception_jail, #exclude_path?, #follow_protocol?, #form_decode, #form_encode, #forms_from_document, #forms_from_response, #full_and_absolute_url?, #generate_token, #get_path, #hms_to_seconds, #html_decode, #html_encode, #include_path?, #links_from_document, #links_from_response, #normalize_url, #page_from_response, #page_from_url, #parse_set_cookie, #path_in_domain?, #path_too_deep?, #port_available?, #rand_port, #random_seed, #redundant_path?, #regexp_array_match, #remove_constants, #request_parse_body, #seconds_to_hms, #skip_page?, #skip_path?, #skip_resource?, #skip_response?, #to_absolute, #uri_decode, #uri_encode, #uri_parse, #uri_parse_query, #uri_parser, #uri_rewrite

Methods inherited from Base

#==, #action, #dup, from_rpc_data, #hash, #id, #marshal_dump, #marshal_load, #persistent_hash, #prepare_for_report, #reset, #to_h, #to_hash, #to_rpc_data, too_big?, #url, #url=

Methods included from Arachni::Element::Capabilities::WithScope

#scope

Constructor Details

#initialize(options) ⇒ DOM

Returns a new instance of DOM.



18
19
20
21
22
23
# File 'lib/arachni/element/cookie/dom.rb', line 18

def initialize( options )
    super

    self.inputs     = (options[:inputs] || self.parent.inputs).dup
    @default_inputs = self.inputs.dup.freeze
end

Class Method Details

.typeObject



48
49
50
# File 'lib/arachni/element/cookie/dom.rb', line 48

def self.type
    :cookie_dom
end

Instance Method Details

#initialization_optionsObject



52
53
54
# File 'lib/arachni/element/cookie/dom.rb', line 52

def initialization_options
    super.merge( inputs: inputs.dup )
end

#nameObject



31
32
33
# File 'lib/arachni/element/cookie/dom.rb', line 31

def name
    inputs.keys.first
end


39
40
41
42
43
# File 'lib/arachni/element/cookie/dom.rb', line 39

def to_set_cookie
    p = parent.dup
    p.inputs = inputs
    p.to_set_cookie
end

#triggerObject

Submits the cookie using the configured Arachni::Element::Capabilities::Inputtable#inputs.



26
27
28
29
# File 'lib/arachni/element/cookie/dom.rb', line 26

def trigger
    browser.goto action, take_snapshot: false, cookies: self.inputs,
                 update_transitions: false
end

#typeObject



45
46
47
# File 'lib/arachni/element/cookie/dom.rb', line 45

def type
    self.class.type
end

#valueObject



35
36
37
# File 'lib/arachni/element/cookie/dom.rb', line 35

def value
    inputs.values.first
end