Class: Arachni::Issue

Inherits:
Object show all
Defined in:
lib/arachni/issue.rb

Defined Under Namespace

Modules: Element, Severity

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Issue

Sets up the instance attributes

Parameters:

  • Hash

    configuration hash Usually the returned data of a module’s info() method for the references merged with a name=>value pair hash holding class attributes



232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
# File 'lib/arachni/issue.rb', line 232

def initialize( opts = {} )
    @verification = false

    opts.each {
        |k, v|
        begin
            send( "#{k.to_s.downcase}=", encode( v ) )
        rescue Exception => e
        end
    }

    opts[:issue].each {
        |k, v|
        begin
            send( "#{k.to_s.downcase}=", encode( v ) )
        rescue Exception => e
        end
    } if opts[:issue]

    if opts[:headers] && opts[:headers][:request]
        @headers[:request] = {}.merge( opts[:headers][:request] )
    end

    if opts[:headers] && opts[:headers][:response].is_a?( Hash )
        @headers[:response] = {}.merge( opts[:headers][:response] )
    end

    if( @cwe )
        @cwe_url = "http://cwe.mitre.org/data/definitions/" + @cwe + ".html"
    end

    @mod_name   = opts[:name]
    @references = opts[:references] || {}
end

Instance Attribute Details

#_hashObject

Returns the value of attribute _hash.



221
222
223
# File 'lib/arachni/issue.rb', line 221

def _hash
  @_hash
end

#cvssv2String

The CVSS v2 score

Returns:



178
179
180
# File 'lib/arachni/issue.rb', line 178

def cvssv2
  @cvssv2
end

#cweString

The CWE ID number of the issue

Returns:



155
156
157
# File 'lib/arachni/issue.rb', line 155

def cwe
  @cwe
end

#cwe_urlString

The CWE URL of the issue

Returns:



162
163
164
# File 'lib/arachni/issue.rb', line 162

def cwe_url
  @cwe_url
end

#descriptionString

The description of the issue

Returns:



141
142
143
# File 'lib/arachni/issue.rb', line 141

def description
  @description
end

#elemString

The vulnerable element, link, form or cookie

Returns:



127
128
129
# File 'lib/arachni/issue.rb', line 127

def elem
  @elem
end

#headersHash<String, Hash>

The headers exchanged during the attack

Returns:

  • (Hash<String, Hash>)

    request and reply headers



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

def headers
  @headers
end

#idString

The string that identified the issue

Returns:



106
107
108
# File 'lib/arachni/issue.rb', line 106

def id
  @id
end

#injectedString

The injected data that revealed the issue

Returns:



99
100
101
# File 'lib/arachni/issue.rb', line 99

def injected
  @injected
end

#internal_modnameObject

Returns the value of attribute internal_modname.



219
220
221
# File 'lib/arachni/issue.rb', line 219

def internal_modname
  @internal_modname
end

#metasploitableString

The Metasploit module that can exploit the vulnerability.

ex. exploit/unix/webapp/php_include

Returns:



215
216
217
# File 'lib/arachni/issue.rb', line 215

def metasploitable
  @metasploitable
end

#methodString

HTTP method

Returns:



134
135
136
# File 'lib/arachni/issue.rb', line 134

def method
  @method
end

#mod_nameString

The module that detected the issue

Returns:

  • (String)

    the name of the module



64
65
66
# File 'lib/arachni/issue.rb', line 64

def mod_name
  @mod_name
end

#nameString

The name of the issue

Returns:



57
58
59
# File 'lib/arachni/issue.rb', line 57

def name
  @name
end

#optsObject

Returns the value of attribute opts.



217
218
219
# File 'lib/arachni/issue.rb', line 217

def opts
  @opts
end

#referencesHash

References related to the issue

Returns:

  • (Hash)


148
149
150
# File 'lib/arachni/issue.rb', line 148

def references
  @references
end

#regexpString

The regexp that identified the issue

Returns:



113
114
115
# File 'lib/arachni/issue.rb', line 113

def regexp
  @regexp
end

#regexp_matchString

The data that was matched by the regexp

Returns:



120
121
122
# File 'lib/arachni/issue.rb', line 120

def regexp_match
  @regexp_match
end

#remedy_codeString

A code snippet showing the user how to remedy the situation

Returns:



192
193
194
# File 'lib/arachni/issue.rb', line 192

def remedy_code
  @remedy_code
end

#remedy_guidanceString

A brief text informing the user how to remedy the situation

Returns:



185
186
187
# File 'lib/arachni/issue.rb', line 185

def remedy_guidance
  @remedy_guidance
end

#responseString

The HTML response of the attack

Returns:

  • (String)

    the html response of the attack



92
93
94
# File 'lib/arachni/issue.rb', line 92

def response
  @response
end

#severityString

To be assigned a constant form Severity

Returns:

See Also:



171
172
173
# File 'lib/arachni/issue.rb', line 171

def severity
  @severity
end

#tagsObject

Returns the value of attribute tags.



220
221
222
# File 'lib/arachni/issue.rb', line 220

def tags
  @tags
end

#urlString

The vulnerable URL

Returns:



78
79
80
# File 'lib/arachni/issue.rb', line 78

def url
  @url
end

#varString

The vulnerable HTTP variable

Returns:

  • (String)

    the name of the http variable



71
72
73
# File 'lib/arachni/issue.rb', line 71

def var
  @var
end

#variationsObject

Placeholder variable to be populated by AuditStore#prepare_variations

See Also:

  • AuditStore#prepare_variations


199
200
201
# File 'lib/arachni/issue.rb', line 199

def variations
  @variations
end

#verificationBool

Is manual verification required?

Returns:

  • (Bool)


206
207
208
# File 'lib/arachni/issue.rb', line 206

def verification
  @verification
end

Instance Method Details

#[](k) ⇒ Object



279
280
281
# File 'lib/arachni/issue.rb', line 279

def []( k )
    instance_variable_get( "@#{k.to_s}".to_sym )
end

#[]=(k, v) ⇒ Object



283
284
285
286
287
288
289
290
# File 'lib/arachni/issue.rb', line 283

def []=( k, v )
    v= encode( v )
    begin
        send( "#{k.to_s}=", v )
    rescue
        instance_variable_set( "@#{k.to_s}".to_sym, v )
    end
end

#eachObject



301
302
303
304
305
306
# File 'lib/arachni/issue.rb', line 301

def each
    self.instance_variables.each {
        |var|
        yield( { normalize_name( var ) => instance_variable_get( var ) } )
    }
end

#each_pairObject



308
309
310
311
312
313
# File 'lib/arachni/issue.rb', line 308

def each_pair
    self.instance_variables.each {
        |var|
        yield normalize_name( var ), instance_variable_get( var )
    }
end

#remove_instance_var(var) ⇒ Object



315
316
317
# File 'lib/arachni/issue.rb', line 315

def remove_instance_var( var )
    remove_instance_variable( var )
end

#to_hObject



292
293
294
295
296
297
298
299
# File 'lib/arachni/issue.rb', line 292

def to_h
    h = {}
    each_pair {
        |k, v|
        h[k] = v
    }
    h
end