Class: Arachni::Data

Inherits:
Object show all
Defined in:
lib/arachni/data.rb,
lib/arachni/data/issues.rb,
lib/arachni/data/plugins.rb,
lib/arachni/data/session.rb,
lib/arachni/data/framework.rb,
lib/arachni/data/framework/rpc.rb

Overview

Stores and provides access to the data of the system.

Author:

Defined Under Namespace

Classes: Error, Framework, Issues, Plugins, Session

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.frameworkFramework

Returns:



32
33
34
# File 'lib/arachni/data.rb', line 32

def framework
  @framework
end

.issuesIssues

Returns:



38
39
40
# File 'lib/arachni/data.rb', line 38

def issues
  @issues
end

.pluginsPlugins

Returns:



41
42
43
# File 'lib/arachni/data.rb', line 41

def plugins
  @plugins
end

.sessionSession

Returns:



35
36
37
# File 'lib/arachni/data.rb', line 35

def session
  @session
end

Class Method Details

.clearObject

Clears all data.



84
85
86
87
# File 'lib/arachni/data.rb', line 84

def clear
    each { |_, state| state.clear }
    self
end

.dump(directory) ⇒ String

Returns Location of the dump directory.

Parameters:

  • directory (String)

    Location of the dump directory.

Returns:

  • (String)

    Location of the dump directory.



62
63
64
65
66
67
68
69
70
# File 'lib/arachni/data.rb', line 62

def dump( directory )
    FileUtils.mkdir_p( directory )

    each do |name, state|
        state.dump( "#{directory}/#{name}/" )
    end

    directory
end

.load(directory) ⇒ Data

Returns ‘self`.

Parameters:

  • directory (String)

    Location of the dump directory.

Returns:

  • (Data)

    ‘self`



75
76
77
78
79
80
81
# File 'lib/arachni/data.rb', line 75

def load( directory )
    each do |name, state|
        send( "#{name}=", state.class.load( "#{directory}/#{name}/" ) )
    end

    self
end

.resetObject



43
44
45
46
47
48
# File 'lib/arachni/data.rb', line 43

def reset
    @framework = Framework.new
    @session   = Session.new
    @issues    = Issues.new
    @plugins   = Plugins.new
end

.statisticsObject



50
51
52
53
54
55
56
# File 'lib/arachni/data.rb', line 50

def statistics
    stats = {}
    each do |attribute|
        stats[attribute] = send(attribute).statistics
    end
    stats
end