Sha256: 679c52d06a8b89a768137a14606099aff11dc278dac9e43716abb402973340b4

Contents?: true

Size: 452 Bytes

Versions: 30

Compression:

Stored size: 452 Bytes

Contents

# frozen_string_literal: true

module Mihari
  class ReverseDnsName < ActiveRecord::Base
    belongs_to :artifact

    class << self
      #
      # Build reverse DNS names
      #
      # @param [String] ip
      #
      # @return [Array<Mihari::ReverseDnsName>]
      #
      def build_by_ip(ip)
        res = Enrichers::Shodan.query(ip)
        return [] if res.nil?

        res.hostnames.map { |name| new(name: name) }
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
mihari-5.4.3 lib/mihari/models/reverse_dns.rb
mihari-5.4.2 lib/mihari/models/reverse_dns.rb
mihari-5.4.1 lib/mihari/models/reverse_dns.rb
mihari-5.4.0 lib/mihari/models/reverse_dns.rb
mihari-5.3.2 lib/mihari/models/reverse_dns.rb
mihari-5.3.1 lib/mihari/models/reverse_dns.rb
mihari-5.3.0 lib/mihari/models/reverse_dns.rb
mihari-5.2.4 lib/mihari/models/reverse_dns.rb
mihari-5.2.3 lib/mihari/models/reverse_dns.rb
mihari-5.2.2 lib/mihari/models/reverse_dns.rb
mihari-5.2.1 lib/mihari/models/reverse_dns.rb
mihari-5.2.0 lib/mihari/models/reverse_dns.rb
mihari-5.1.4 lib/mihari/models/reverse_dns.rb
mihari-5.1.3 lib/mihari/models/reverse_dns.rb
mihari-5.1.2 lib/mihari/models/reverse_dns.rb
mihari-5.1.1 lib/mihari/models/reverse_dns.rb
mihari-5.1.0 lib/mihari/models/reverse_dns.rb
mihari-5.0.1 lib/mihari/models/reverse_dns.rb
mihari-5.0.0 lib/mihari/models/reverse_dns.rb
mihari-4.12.0 lib/mihari/models/reverse_dns.rb