Class: Arachni::Issue

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

Defined Under Namespace

Modules: Element, Severity

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Issue

Sets up the instanse attributes

Parameters:

  • Hash

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



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
# File 'lib/issue.rb', line 234

def initialize( opts = {} )

    @verification = false

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

    opts[:issue].each {
        |k, v|
        begin
            send( "#{k.to_s.downcase}=", v )
        rescue Exception => e
        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.



223
224
225
# File 'lib/issue.rb', line 223

def _hash
  @_hash
end

#cvssv2String

The CVSS v2 score

Returns:



180
181
182
# File 'lib/issue.rb', line 180

def cvssv2
  @cvssv2
end

#cweString

The CWE ID number of the issue

Returns:



157
158
159
# File 'lib/issue.rb', line 157

def cwe
  @cwe
end

#cwe_urlString

The CWE URL of the issue

Returns:



164
165
166
# File 'lib/issue.rb', line 164

def cwe_url
  @cwe_url
end

#descriptionString

The description of the issue

Returns:



143
144
145
# File 'lib/issue.rb', line 143

def description
  @description
end

#elemString

The vulnerable element, link, form or cookie

Returns:



129
130
131
# File 'lib/issue.rb', line 129

def elem
  @elem
end

#headersHash<String, Hash>

The headers exchanhed during the attack

Returns:

  • (Hash<String, Hash>)

    request and reply headers



87
88
89
# File 'lib/issue.rb', line 87

def headers
  @headers
end

#idString

The string that identified the issue

Returns:



108
109
110
# File 'lib/issue.rb', line 108

def id
  @id
end

#injectedString

The injected data that revealed the issue

Returns:



101
102
103
# File 'lib/issue.rb', line 101

def injected
  @injected
end

#internal_modnameObject

Returns the value of attribute internal_modname.



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

def internal_modname
  @internal_modname
end

#metasploitableString

The Metasploit module that can exploit the vulnerability.

ex. exploit/unix/webapp/php_include

Returns:



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

def metasploitable
  @metasploitable
end

#methodString

HTTP method

Returns:



136
137
138
# File 'lib/issue.rb', line 136

def method
  @method
end

#mod_nameString

The module that detected the issue

Returns:

  • (String)

    the name of the module



66
67
68
# File 'lib/issue.rb', line 66

def mod_name
  @mod_name
end

#nameString

The name of the issue

Returns:



59
60
61
# File 'lib/issue.rb', line 59

def name
  @name
end

#optsObject

Returns the value of attribute opts.



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

def opts
  @opts
end

#referencesHash

References related to the issue

Returns:

  • (Hash)


150
151
152
# File 'lib/issue.rb', line 150

def references
  @references
end

#regexpString

The regexp that identified the issue

Returns:



115
116
117
# File 'lib/issue.rb', line 115

def regexp
  @regexp
end

#regexp_matchString

The data that was matched by the regexp

Returns:



122
123
124
# File 'lib/issue.rb', line 122

def regexp_match
  @regexp_match
end

#remedy_codeString

A code snipet showing the user how to remedy the situation

Returns:



194
195
196
# File 'lib/issue.rb', line 194

def remedy_code
  @remedy_code
end

#remedy_guidanceString

A brief text informing the user how to remedy the situation

Returns:



187
188
189
# File 'lib/issue.rb', line 187

def remedy_guidance
  @remedy_guidance
end

#responseString

The HTML response of the attack

Returns:

  • (String)

    the html response of the attack



94
95
96
# File 'lib/issue.rb', line 94

def response
  @response
end

#severityString

To be assigned a constant form Severity

Returns:

See Also:



173
174
175
# File 'lib/issue.rb', line 173

def severity
  @severity
end

#tagsObject

Returns the value of attribute tags.



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

def tags
  @tags
end

#urlString

The vulnerable URL

Returns:



80
81
82
# File 'lib/issue.rb', line 80

def url
  @url
end

#varString

The vulnerable HTTP variable

Returns:

  • (String)

    the name of the http variable



73
74
75
# File 'lib/issue.rb', line 73

def var
  @var
end

#variationsObject

Placeholder variable to be populated by AuditStore#prepare_variations

See Also:

  • AuditStore#prepare_variations


201
202
203
# File 'lib/issue.rb', line 201

def variations
  @variations
end

#verificationBool

Is manual verification required?

Returns:

  • (Bool)


208
209
210
# File 'lib/issue.rb', line 208

def verification
  @verification
end

Instance Method Details

#eachObject



275
276
277
278
279
280
# File 'lib/issue.rb', line 275

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

#each_pairObject



282
283
284
285
286
287
# File 'lib/issue.rb', line 282

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

#remove_instance_var(var) ⇒ Object



289
290
291
# File 'lib/issue.rb', line 289

def remove_instance_var( var )
    remove_instance_variable( var )
end