Class: Arachni::BrowserCluster::Jobs::DOMExploration

Inherits:
Arachni::BrowserCluster::Job show all
Defined in:
lib/arachni/browser_cluster/jobs/dom_exploration.rb,
lib/arachni/browser_cluster/jobs/dom_exploration/result.rb,
lib/arachni/browser_cluster/jobs/dom_exploration/event_trigger.rb,
lib/arachni/browser_cluster/jobs/dom_exploration/event_trigger/result.rb

Overview

Loads a #resource and explores its DOM.

Author:

Direct Known Subclasses

EventTrigger, TaintTrace

Defined Under Namespace

Classes: EventTrigger, Result

Instance Attribute Summary collapse

Attributes inherited from Arachni::BrowserCluster::Job

#args, #browser, #forwarder, #time

Instance Method Summary collapse

Methods inherited from Arachni::BrowserCluster::Job

#==, #configure_and_run, #forward, #forward_as, #hash, #id, #never_ending=, #never_ending?, #save_result, #timed_out!, #timed_out?

Constructor Details

#initialize(options) ⇒ DOMExploration

Returns a new instance of DOMExploration.


26
27
28
29
# File 'lib/arachni/browser_cluster/jobs/dom_exploration.rb', line 26

def initialize( options )
    self.resource = options.delete(:resource)
    super options
end

Instance Attribute Details

#resourcePage::DOM, ...

Returns Resource to explore, if given a String it will be treated it as a URL and will be loaded.

Returns:


24
25
26
# File 'lib/arachni/browser_cluster/jobs/dom_exploration.rb', line 24

def resource
  @resource
end

Instance Method Details

#clean_copyObject


55
56
57
# File 'lib/arachni/browser_cluster/jobs/dom_exploration.rb', line 55

def clean_copy
    super.tap { |j| j.resource = nil }
end

#dupObject


51
52
53
# File 'lib/arachni/browser_cluster/jobs/dom_exploration.rb', line 51

def dup
    super.tap { |j| j.resource = resource }
end

#runObject

Loads a #resource and explores its DOM.


32
33
34
35
36
37
# File 'lib/arachni/browser_cluster/jobs/dom_exploration.rb', line 32

def run
    browser.on_new_page { |page| save_result( page: page ) }

    browser.load resource
    browser.trigger_events
end

#to_sObject Also known as: inspect


59
60
61
62
# File 'lib/arachni/browser_cluster/jobs/dom_exploration.rb', line 59

def to_s
    "#<#{self.class}:#{object_id} @resource=#{@resource} " <<
        "time=#{@time} timed_out=#{timed_out?}>"
end