Skip to content

Instantly share code, notes, and snippets.

@Pushergene
Created November 21, 2017 23:50
Show Gist options
  • Save Pushergene/066d6429d1e38f192288801933acdcfb to your computer and use it in GitHub Desktop.
Save Pushergene/066d6429d1e38f192288801933acdcfb to your computer and use it in GitHub Desktop.
require 'resolv'
require 'json'
$address
puts "Address: #{$address}"
$address = gets.chomp
Resolv::DNS.open do |dns|
ress = dns.getresources "#{$address}", Resolv::DNS::Resource::IN::A
p ress.map { |r| r.address }
target = "http://ipinfo.io/#{$address}/json"
puts " Hostname: " + JSON['hostname']
puts " City: " + target['city']
puts " Region: " + target['country']
puts "Location: " + target['loc']
puts "[+] Organization: " + target['org']
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment