Sha256: 443b3c5bf5cbc426243533ea705270c69b8342d7ebde31e8a41a0ee60adad618
Contents?: true
Size: 967 Bytes
Versions: 7
Compression:
Stored size: 967 Bytes
Contents
# frozen_string_literal: true module Mihari module Analyzers # # Shodan analyzer # class Shodan < Base # @return [String, nil] attr_reader :api_key # # @param [String] query # @param [Hash, nil] options # @param [String, nil] api_key # def initialize(query, options: nil, api_key: nil) super(query, options: options) @api_key = api_key || Mihari.config.shodan_api_key end def artifacts client.search_with_pagination( query, pagination_limit: pagination_limit ).map(&:artifacts).flatten.uniq(&:data) end def configuration_keys %w[shodan_api_key] end private # # @return [Clients::Shodan] # def client Clients::Shodan.new( api_key: api_key, pagination_interval: pagination_interval, timeout: timeout ) end end end end
Version data entries
7 entries across 7 versions & 1 rubygems