Module: Arachni::Element::DOM::Capabilities::Auditable

Includes:
Capabilities::Auditable
Included in:
Cookie::DOM, Form::DOM, Link::DOM, LinkTemplate::DOM, UIForm::DOM, UIInput::DOM
Defined in:
lib/arachni/element/dom/capabilities/auditable.rb

Overview

Author:

Constant Summary

Constants included from Capabilities::Auditable

Capabilities::Auditable::OPTIONS

Instance Attribute Summary

Attributes included from Capabilities::Auditable

#audit_options

Attributes included from Capabilities::WithAuditor

#auditor

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Capabilities::Auditable

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

Methods included from Capabilities::WithAuditor

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

Methods included from Utilities

#available_port, available_port_mutex, #bytes_to_kilobytes, #bytes_to_megabytes, #caller_name, #caller_path, #cookie_decode, #cookie_encode, #cookies_from_file, #cookies_from_parser, #cookies_from_response, #exception_jail, #exclude_path?, #follow_protocol?, #form_decode, #form_encode, #forms_from_parser, #forms_from_response, #full_and_absolute_url?, #generate_token, #get_path, #hms_to_seconds, #html_decode, #html_encode, #include_path?, #links_from_parser, #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

Class Method Details

.audit_handle_submit(browser, options) ⇒ Object



45
46
47
48
49
50
51
52
# File 'lib/arachni/element/dom/capabilities/auditable.rb', line 45

def self.audit_handle_submit( browser, options )
    Submittable.prepare_browser( browser, options )
    page = Submittable.submit_with_browser( browser, options )
    # Failed to submit.
    return if !page

    Auditable.handle_submission_result page
end

.audit_handle_submit_cbObject



54
55
56
# File 'lib/arachni/element/dom/capabilities/auditable.rb', line 54

def self.audit_handle_submit_cb
    @audit_handle_submit_cb ||= Auditable.method(:audit_handle_submit)
end

.handle_submission_result(page) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/arachni/element/dom/capabilities/auditable.rb', line 29

def self.handle_submission_result( page )
    # In case of redirection or runtime scope changes.
    return if !page.parsed_url.seed_in_host? && page.scope.out?

    element = page.request.performer
    if !element.audit_options[:silent]
        element.print_status "Analyzing response ##{page.request.id} for " <<
            "#{element.type} input '#{element.affected_input_name}'" <<
            " pointing to: '#{element.audit_status_message_action}'"
    end

    Arachni::Utilities.exception_jail false do
        element.auditor.check_and_log( page, element )
    end
end

Instance Method Details

#submit_and_process(&block) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/arachni/element/dom/capabilities/auditable.rb', line 17

def submit_and_process( &block )
    # If we're operating under the context of a check switch to class-level
    # method callbacks to avoid registering multiple unique callbacks
    # for the browser jobs, thus avoiding all the context that comes with
    # closures.
    if @auditor.class.respond_to? :check_and_log
        submit( @audit_options[:submit] || {}, Auditable.audit_handle_submit_cb )
    else
        super( &block )
    end
end

#with_browser(*args, &block) ⇒ Object



58
59
60
# File 'lib/arachni/element/dom/capabilities/auditable.rb', line 58

def with_browser( *args, &block )
    auditor.with_browser( *args, &block )
end

#with_browser_cluster(&block) ⇒ Object



62
63
64
# File 'lib/arachni/element/dom/capabilities/auditable.rb', line 62

def with_browser_cluster( &block )
    auditor.with_browser_cluster( &block )
end