Sha256: 53788c66a0de6a2fec9d10121d9337e97d9ce6e442195b398a2241f59ddc427d
Contents?: true
Size: 879 Bytes
Versions: 9
Compression:
Stored size: 879 Bytes
Contents
# frozen_string_literal: true module Mihari module Clients class DNSTwister < Base # # @param [String] base_url # @param [Hash] headers # def initialize(base_url = "https://dnstwister.report", headers: {}) super(base_url, headers: headers) end # # Get fuzzy domains # # @param [String] domain # # @return [Array<String>] # def fuzz(domain) res = get("/api/fuzz/#{to_hex(domain)}") res = JSON.parse(res.body.to_s) 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
9 entries across 9 versions & 1 rubygems