Class: Arachni::BrowserCluster::Jobs::TaintTrace

Inherits:
ResourceExploration show all
Defined in:
lib/arachni/browser_cluster/jobs/taint_trace.rb,
lib/arachni/browser_cluster/jobs/taint_trace/result.rb,
lib/arachni/browser_cluster/jobs/taint_trace/event_trigger.rb,
lib/arachni/browser_cluster/jobs/taint_trace/event_trigger/result.rb

Overview

Traces a #taint throughout the JS environment of the given ResourceExploration#resource. It also allows custom JS code to be executed under the same scope in order to directly introduce the #taint.

It will pass each evaluated page with the result.

Author:

Defined Under Namespace

Classes: EventTrigger, Result

Instance Attribute Summary collapse

Attributes inherited from ResourceExploration

#resource

Attributes inherited from Arachni::BrowserCluster::Job

#browser, #forwarder

Instance Method Summary collapse

Methods inherited from ResourceExploration

#clean_copy, #dup, #initialize

Methods inherited from Arachni::BrowserCluster::Job

#==, #clean_copy, #configure_and_run, #dup, #forward, #forward_as, #hash, #id, #initialize, #never_ending=, #never_ending?, #save_result

Constructor Details

This class inherits a constructor from Arachni::BrowserCluster::Jobs::ResourceExploration

Instance Attribute Details

#injectorString

Returns JS code to execute in order to introduce the taint.

Returns:

  • (String)

    JS code to execute in order to introduce the taint.



33
34
35
# File 'lib/arachni/browser_cluster/jobs/taint_trace.rb', line 33

def injector
  @injector
end

#taintString

Returns Taint to trace throughout the data-flow of the JS environment.

Returns:

  • (String)

    Taint to trace throughout the data-flow of the JS environment.



29
30
31
# File 'lib/arachni/browser_cluster/jobs/taint_trace.rb', line 29

def taint
  @taint
end

Instance Method Details

#runObject



35
36
37
38
39
40
41
42
# File 'lib/arachni/browser_cluster/jobs/taint_trace.rb', line 35

def run
    browser.javascript.taint       = self.taint
    browser.javascript.custom_code = self.injector

    browser.on_new_page_with_sink { |page| save_result( page: page ) }

    super
end

#to_sObject Also known as: inspect



44
45
46
47
# File 'lib/arachni/browser_cluster/jobs/taint_trace.rb', line 44

def to_s
    "#<#{self.class}:#{object_id} @resource=#{@resource} " +
        "@taint=#{@taint.inspect} @injector=#{@injector.inspect}>"
end