Sha256: 768196220ab541c694c2a0cde44b3765866282a61238f26827d989fa0c45d7a7
Contents?: true
Size: 721 Bytes
Versions: 34
Compression:
Stored size: 721 Bytes
Contents
# frozen_string_literal: true require "net/https" module Mihari module Enrichers class Shodan < Base # @return [Boolean] def valid? true end class << self include Memist::Memoizable # # Query Shodan Internet DB # # @param [String] ip # # @return [Mihari::Structs::Shodan::InternetDBResponse, nil] # def query(ip) url = "https://internetdb.shodan.io/#{ip}" res = HTTP.get(url) data = JSON.parse(res.body.to_s) Structs::Shodan::InternetDBResponse.from_dynamic! data rescue HTTPError nil end memoize :query end end end end
Version data entries
34 entries across 34 versions & 1 rubygems