Class: Mihari::Analyzers::DNSTwister

Inherits:
Base show all
Includes:
Concerns::Refangable
Defined in:
lib/mihari/analyzers/dnstwister.rb

Overview

DNSTwister analyzer

Constant Summary

Constants included from Concerns::Retriable

Concerns::Retriable::DEFAULT_CONDITION, Concerns::Retriable::RETRIABLE_ERRORS

Instance Attribute Summary collapse

Attributes inherited from Base

#query

Attributes inherited from Mihari::Actor

#options

Instance Method Summary collapse

Methods included from Concerns::Refangable

#refang

Methods inherited from Base

#call, from_params, #ignore_error?, inherited, #normalized_artifacts, #pagination_interval, #pagination_limit, #parallel?, #result, #truncated_query

Methods inherited from Mihari::Actor

#call, configuration_keys, key, key_aliases, keys, #result, #retry_exponential_backoff, #retry_interval, #retry_times, #timeout, type, #validate_configuration!

Methods included from Concerns::Retriable

#retry_on_error

Methods included from Concerns::Configurable

#configuration_keys?, #configured?

Constructor Details

#initialize(query, options: nil) ⇒ DNSTwister

Returns a new instance of DNSTwister.

Parameters:

  • query (String)
  • options (Hash, nil) (defaults to: nil)


18
19
20
21
22
# File 'lib/mihari/analyzers/dnstwister.rb', line 18

def initialize(query, options: nil)
  super(refang(query), options:)

  @type = DataType.type(query)
end

Instance Attribute Details

#typeString (readonly)

Returns:

  • (String)


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

def type
  @type
end

Instance Method Details

#artifactsObject

Raises:



24
25
26
27
28
29
# File 'lib/mihari/analyzers/dnstwister.rb', line 24

def artifacts
  raise ValueError, "#{query}(type: #{type || "unknown"}) is not supported." unless valid_type?

  domains = client.fuzz(query)
  Parallel.map(domains) { |domain| resolvable?(domain) ? domain : nil }.compact
end