Class: Mihari::Analyzers::Crtsh
- Defined in:
- lib/mihari/analyzers/crtsh.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#exclude_expired ⇒ Object
readonly
Returns the value of attribute exclude_expired.
-
#query ⇒ Object
readonly
Returns the value of attribute query.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
- #artifacts ⇒ Object
-
#initialize(query, title: nil, description: nil, tags: [], exclude_expired: nil) ⇒ Crtsh
constructor
A new instance of Crtsh.
Methods inherited from Base
inherited, #run, #run_emitter, #source
Methods included from Retriable
Methods included from Configurable
#config_keys, #configuration_status, #configured?
Constructor Details
#initialize(query, title: nil, description: nil, tags: [], exclude_expired: nil) ⇒ Crtsh
Returns a new instance of Crtsh.
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/mihari/analyzers/crtsh.rb', line 14 def initialize(query, title: nil, description: nil, tags: [], exclude_expired: nil) super() @query = query @title = title || "crt.sh lookup" @description = description || "query = #{query}" @tags = @exclude_expired = exclude_expired.nil? ? true : exclude_expired end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
9 10 11 |
# File 'lib/mihari/analyzers/crtsh.rb', line 9 def description @description end |
#exclude_expired ⇒ Object (readonly)
Returns the value of attribute exclude_expired.
12 13 14 |
# File 'lib/mihari/analyzers/crtsh.rb', line 12 def exclude_expired @exclude_expired end |
#query ⇒ Object (readonly)
Returns the value of attribute query.
10 11 12 |
# File 'lib/mihari/analyzers/crtsh.rb', line 10 def query @query end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
11 12 13 |
# File 'lib/mihari/analyzers/crtsh.rb', line 11 def @tags end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
8 9 10 |
# File 'lib/mihari/analyzers/crtsh.rb', line 8 def title @title end |
Instance Method Details
#artifacts ⇒ Object
25 26 27 28 29 |
# File 'lib/mihari/analyzers/crtsh.rb', line 25 def artifacts results = search name_values = results.map { |result| result.dig("name_value") }.compact name_values.map(&:lines).flatten.uniq.map(&:chomp) end |