Sha256: 73b5b22c83786db10794b41645b28bc33f7415f603c10d57c3dc72ff9445121a

Contents?: true

Size: 714 Bytes

Versions: 12

Compression:

Stored size: 714 Bytes

Contents

module Dradis::Plugins::NTOSpider
  class FieldProcessor < Dradis::Plugins::Upload::FieldProcessor

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

    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
  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
dradis-ntospider-4.15.0 lib/dradis/plugins/ntospider/field_processor.rb
dradis-ntospider-4.14.0 lib/dradis/plugins/ntospider/field_processor.rb
dradis-ntospider-4.13.0 lib/dradis/plugins/ntospider/field_processor.rb
dradis-ntospider-4.11.0 lib/dradis/plugins/ntospider/field_processor.rb
dradis-ntospider-4.10.0 lib/dradis/plugins/ntospider/field_processor.rb
dradis-ntospider-4.9.0 lib/dradis/plugins/ntospider/field_processor.rb
dradis-ntospider-4.8.0 lib/dradis/plugins/ntospider/field_processor.rb
dradis-ntospider-4.7.0 lib/dradis/plugins/ntospider/field_processor.rb
dradis-ntospider-4.6.0 lib/dradis/plugins/ntospider/field_processor.rb
dradis-ntospider-4.5.0 lib/dradis/plugins/ntospider/field_processor.rb
dradis-ntospider-4.4.0 lib/dradis/plugins/ntospider/field_processor.rb
dradis-ntospider-4.3.0 lib/dradis/plugins/ntospider/field_processor.rb