Class: Mihari::Analyzers::ZoomEye

Inherits:
Base
  • Object
show all
Defined in:
lib/mihari/analyzers/zoomeye.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

inherited, #run, #run_emitter, #source

Methods included from Retriable

#retry_on_error

Methods included from Configurable

#configuration_status, #configured?

Constructor Details

#initialize(query, title: nil, description: nil, tags: [], type: "host") ⇒ ZoomEye

Returns a new instance of ZoomEye.



14
15
16
17
18
19
20
21
22
# File 'lib/mihari/analyzers/zoomeye.rb', line 14

def initialize(query, title: nil, description: nil, tags: [], type: "host")
  super()

  @query = query
  @title = title || "ZoomEye lookup"
  @description = description || "query = #{query}"
  @tags = tags
  @type = type
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



9
10
11
# File 'lib/mihari/analyzers/zoomeye.rb', line 9

def description
  @description
end

#queryObject (readonly)

Returns the value of attribute query.



10
11
12
# File 'lib/mihari/analyzers/zoomeye.rb', line 10

def query
  @query
end

#tagsObject (readonly)

Returns the value of attribute tags.



11
12
13
# File 'lib/mihari/analyzers/zoomeye.rb', line 11

def tags
  @tags
end

#titleObject (readonly)

Returns the value of attribute title.



8
9
10
# File 'lib/mihari/analyzers/zoomeye.rb', line 8

def title
  @title
end

#typeObject (readonly)

Returns the value of attribute type.



12
13
14
# File 'lib/mihari/analyzers/zoomeye.rb', line 12

def type
  @type
end

Instance Method Details

#artifactsObject



24
25
26
27
28
29
30
31
32
33
# File 'lib/mihari/analyzers/zoomeye.rb', line 24

def artifacts
  case type
  when "host"
    host_lookup
  when "web"
    web_lookup
  else
    raise InvalidInputError, "#{type} type is not supported." unless valid_type?
  end
end