class Mihari::Analyzers::DNSTwister

Attributes

type[R]

Public Class Methods

new(*args, **kwargs) click to toggle source
Calls superclass method Mihari::Analyzers::Base::new
# File lib/mihari/analyzers/dnstwister.rb, line 19
def initialize(*args, **kwargs)
  super

  @query = refang(query)
  @type = TypeChecker.type(query)
end

Public Instance Methods

artifacts() click to toggle source
# File lib/mihari/analyzers/dnstwister.rb, line 26
def artifacts
  search || []
end

Private Instance Methods

api() click to toggle source
# File lib/mihari/analyzers/dnstwister.rb, line 41
def api
  @api ||= ::DNSTwister::API.new
end
resolvable?(domain) click to toggle source

Check whether a domain is resolvable or not

@param [String] domain

@return [Boolean]

# File lib/mihari/analyzers/dnstwister.rb, line 52
def resolvable?(domain)
  Resolv.getaddress domain
  true
rescue Resolv::ResolvError => _e
  false
end
valid_type?() click to toggle source

Check whether a type is valid or not

@return [Boolean]

# File lib/mihari/analyzers/dnstwister.rb, line 37
def valid_type?
  type == "domain"
end