Class: Mihari::Analyzers::VirusTotal

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

Instance Attribute Summary collapse

Attributes inherited from Base

#the_hive

Instance Method Summary collapse

Methods inherited from Base

#run, #run_emitter

Constructor Details

#initialize(indicator, title: nil, description: nil, tags: []) ⇒ VirusTotal

Returns a new instance of VirusTotal.



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/mihari/analyzers/virustotal.rb', line 16

def initialize(indicator, title: nil, description: nil, tags: [])
  super()

  @api = ::VirusTotal::API.new
  @indicator = indicator
  @type = TypeChecker.type(indicator)

  @title = title || "VirusTotal lookup"
  @description = description || "indicator = #{indicator}"
  @tags = tags
end

Instance Attribute Details

#apiObject (readonly)

Returns the value of attribute api.



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

def api
  @api
end

#descriptionObject (readonly)

Returns the value of attribute description.



13
14
15
# File 'lib/mihari/analyzers/virustotal.rb', line 13

def description
  @description
end

#indicatorObject (readonly)

Returns the value of attribute indicator.



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

def indicator
  @indicator
end

#tagsObject (readonly)

Returns the value of attribute tags.



14
15
16
# File 'lib/mihari/analyzers/virustotal.rb', line 14

def tags
  @tags
end

#titleObject (readonly)

Returns the value of attribute title.



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

def title
  @title
end

#typeObject (readonly)

Returns the value of attribute type.



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

def type
  @type
end

Instance Method Details

#artifactsObject



28
29
30
# File 'lib/mihari/analyzers/virustotal.rb', line 28

def artifacts
  lookup || []
end