Class: Dradis::Plugins::NTOSpider::FieldProcessor

Inherits:
Upload::FieldProcessor
  • Object
show all
Defined in:
lib/dradis/plugins/ntospider/field_processor.rb

Instance Method Summary collapse

Instance Method Details

#post_initialize(args = {}) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/dradis/plugins/ntospider/field_processor.rb', line 4

def post_initialize(args={})
  if data.name == 'Vuln'
    @nto_object = ::NTOSpider::Vuln.new(data)
  else
    @nto_object = ::NTOSpider::Attack.new(data)
  end
end

#value(args = {}) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/dradis/plugins/ntospider/field_processor.rb', line 12

def value(args={})
  field = args[:field]

  # fields in the template are of the form <foo>.<field>, where <foo>
  # is common across all fields for a given template (and meaningless).
  _, name = field.split('.')

  # The XML uses a <Method> entity, but 'method' is a reserved word here so:
  name = 'vuln_method' if name == 'method'

  @nto_object.try(name) || 'n/a'
end