Class: Arachni::BrowserCluster::Jobs::ResourceExploration

Inherits:
Arachni::BrowserCluster::Job show all
Defined in:
lib/arachni/browser_cluster/jobs/resource_exploration.rb,
lib/arachni/browser_cluster/jobs/resource_exploration/result.rb,
lib/arachni/browser_cluster/jobs/resource_exploration/event_trigger.rb,
lib/arachni/browser_cluster/jobs/resource_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

#browser, #forwarder

Instance Method Summary collapse

Methods inherited from Arachni::BrowserCluster::Job

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

Constructor Details

#initialize(options) ⇒ ResourceExploration

Returns a new instance of ResourceExploration.



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

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

Instance Attribute Details

#resourcePage, ...

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

Returns:

  • (Page, String, HTTP::Response)

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



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

def resource
  @resource
end

Instance Method Details

#clean_copyObject



52
53
54
# File 'lib/arachni/browser_cluster/jobs/resource_exploration.rb', line 52

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

#dupObject



48
49
50
# File 'lib/arachni/browser_cluster/jobs/resource_exploration.rb', line 48

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/resource_exploration.rb', line 32

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

    browser.load resource
    browser.trigger_events
end

#to_sObject



56
57
58
# File 'lib/arachni/browser_cluster/jobs/resource_exploration.rb', line 56

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