Class: Arachni::AuditStore
- Inherits:
-
Object
- Object
- Arachni::AuditStore
- Defined in:
- lib/audit_store.rb
Overview
Arachni::AuditStore class
Represents a finished audit session.
It holds information about the
runtime environment, the results of the audit etc…
@author: Anastasios “Zapotek” Laskos
<tasos.laskos@gmail.com> <zapotek@segfault.gr>
@version: 0.1-pre
Instance Attribute Summary (collapse)
-
- (String) delta_time
readonly
How long the audit took.
-
- (String) finish_datetime
readonly
The date and time when the audit finished.
-
- (Hash) options
readonly
The runtime arguments/options of the environment.
-
- (String) revision
readonly
The SVN revision of the framework.
-
- (Array) sitemap
readonly
All the urls crawled.
-
- (String) start_datetime
readonly
The date and time when the audit started.
-
- (String) version
readonly
The version of the framework.
-
- (Array<Vulnerability>) vulns
readonly
The discovered vulnerabilities.
Class Method Summary (collapse)
-
+ (AuditStore) load(file)
Loads and returns an AuditStore object from file.
Instance Method Summary (collapse)
-
- (AuditStore) initialize(audit = {})
constructor
A new instance of AuditStore.
-
- (Object) save(file)
Saves ‘self’ to file.
-
- (Hash) to_h
Returns ‘self’ and all objects in its instance vars as hashes.
Constructor Details
- (AuditStore) initialize(audit = {})
A new instance of AuditStore
69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/audit_store.rb', line 69 def initialize( audit = {} ) # set instance variables from audit opts audit.each { |k, v| self.instance_variable_set( '@' + k, v ) } @options = ( @options ) @vulns = prepare_variations( @vulns ) @start_datetime = @options['start_datetime'].asctime @finish_datetime = @options['finish_datetime'].asctime @delta_time = secs_to_hms( @options['delta_time'] ) end |
Instance Attribute Details
- (String) delta_time (readonly)
How long the audit took
67 68 69 |
# File 'lib/audit_store.rb', line 67 def delta_time @delta_time end |
- (String) finish_datetime (readonly)
The date and time when the audit finished
62 63 64 |
# File 'lib/audit_store.rb', line 62 def finish_datetime @finish_datetime end |
- (Hash) options (readonly)
The runtime arguments/options of the environment
42 43 44 |
# File 'lib/audit_store.rb', line 42 def @options end |
- (String) revision (readonly)
The SVN revision of the framework
37 38 39 |
# File 'lib/audit_store.rb', line 37 def revision @revision end |
- (Array) sitemap (readonly)
All the urls crawled
47 48 49 |
# File 'lib/audit_store.rb', line 47 def sitemap @sitemap end |
- (String) start_datetime (readonly)
The date and time when the audit started
57 58 59 |
# File 'lib/audit_store.rb', line 57 def start_datetime @start_datetime end |
- (String) version (readonly)
The version of the framework
32 33 34 |
# File 'lib/audit_store.rb', line 32 def version @version end |
- (Array<Vulnerability>) vulns (readonly)
The discovered vulnerabilities
52 53 54 |
# File 'lib/audit_store.rb', line 52 def vulns @vulns end |
Class Method Details
+ (AuditStore) load(file)
Loads and returns an AuditStore object from file
91 92 93 |
# File 'lib/audit_store.rb', line 91 def AuditStore.load( file ) YAML::load( IO.read( file ) ) end |
Instance Method Details
- (Object) save(file)
Saves ‘self’ to file
100 101 102 103 |
# File 'lib/audit_store.rb', line 100 def save( file ) f = File.open( file, 'w' ) YAML.dump( self, f ) end |
- (Hash) to_h
Returns ‘self’ and all objects in its instance vars as hashes
110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/audit_store.rb', line 110 def to_h hash = obj_to_hash( self ) vulns = [] hash['vulns'].each { |vuln| vulns << obj_to_hash( vuln ) } hash['vulns'] = vulns return hash end |