Sha256: 76155e71e7e11697a8a3410ffa5c5f77bedfbca3afbc7b5d2503c5bdf5398115
Contents?: true
Size: 908 Bytes
Versions: 6
Compression:
Stored size: 908 Bytes
Contents
# frozen_string_literal: true module Mihari module Clients # # DNSTwister API client # class DNSTwister < Base # # @param [String] base_url # @param [Hash] headers # @param [Integer, nil] timeout # def initialize(base_url = "https://dnstwister.report", headers: {}, timeout: nil) super end # # Get fuzzy domains # # @param [String] domain # # @return [Array<String>] # def fuzz(domain) res = get_json("/api/fuzz/#{to_hex(domain)}") fuzzy_domains = res["fuzzy_domains"] || [] fuzzy_domains.map { |d| d["domain"] } end private # # Converts string to hex # # @param [String] str String # # @return [String] Hex # def to_hex(str) str.each_byte.map { |b| b.to_s(16) }.join end end end end
Version data entries
6 entries across 6 versions & 1 rubygems