Class: Mihari::Analyzers::Base
Direct Known Subclasses
Basic, BinaryEdge, CIRCL, Censys, Crtsh, DNPedia, DNSTwister, FreeText, HTTPHash, OTX, Onyphe, PassiveDNS, PassiveSSL, PassiveTotal, Pulsedive, ReveseWhois, SSHFingerprint, SecurityTrails, SecurityTrailsDomainFeed, Shodan, Urlscan, VirusTotal, ZoomEye
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Retriable
#retry_on_error
#config_keys, #configuration_status, #configured?
Class Method Details
.inherited(child) ⇒ Object
49
50
51
|
# File 'lib/mihari/analyzers/base.rb', line 49
def self.inherited(child)
Mihari.analyzers << child
end
|
Instance Method Details
#artifacts ⇒ Array<String>, Array<Mihari::Artifact>
12
13
14
|
# File 'lib/mihari/analyzers/base.rb', line 12
def artifacts
raise NotImplementedError, "You must implement #{self.class}##{__method__}"
end
|
#description ⇒ String
22
23
24
|
# File 'lib/mihari/analyzers/base.rb', line 22
def description
raise NotImplementedError, "You must implement #{self.class}##{__method__}"
end
|
#run ⇒ Object
35
36
37
38
39
40
41
|
# File 'lib/mihari/analyzers/base.rb', line 35
def run
set_unique_artifacts
Parallel.each(valid_emitters) do |emitter|
run_emitter emitter
end
end
|
#run_emitter(emitter) ⇒ Object
43
44
45
46
47
|
# File 'lib/mihari/analyzers/base.rb', line 43
def run_emitter(emitter)
emitter.run(title: title, description: description, artifacts: unique_artifacts, source: source, tags: tags)
rescue StandardError => e
puts "Emission by #{emitter.class} is failed: #{e}"
end
|
#source ⇒ Object
26
27
28
|
# File 'lib/mihari/analyzers/base.rb', line 26
def source
self.class.to_s.split("::").last
end
|
31
32
33
|
# File 'lib/mihari/analyzers/base.rb', line 31
def tags
[]
end
|
#title ⇒ String
17
18
19
|
# File 'lib/mihari/analyzers/base.rb', line 17
def title
self.class.to_s.split("::").last
end
|