Created
November 21, 2017 23:50
-
-
Save Pushergene/066d6429d1e38f192288801933acdcfb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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