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



43
44
45
# File 'lib/arachni/browser_cluster/jobs/resource_exploration.rb', line 43

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

#dupObject



39
40
41
# File 'lib/arachni/browser_cluster/jobs/resource_exploration.rb', line 39

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 Also known as: inspect



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

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