• Earn real money by being active: Hello Guest, earn real money by simply being active on the forum — post quality content, get reactions, and help the community. Once you reach the minimum credit amount, you’ll be able to withdraw your balance directly. Learn how it works.

Ruby [Ruby] IP Locator 0.1

Status
Not open for further replies.

Doddy

Leech
User
Joined
Apr 1, 2012
Messages
169
Reputation
0
Reaction score
406
Points
63
Credits
0
‎13 Years of Service‎
57%
Un localizador de IP.

Code:
>
#!usr/bin/ruby
#IP Locator 0.1
#Coded By Doddy H

require "net/http"
require "resolv"

def uso
 print "\n[+] iplocator.rb \n"
end

def toma(web)
 return Net::HTTP.get_response(URI.parse(web)).body
end
 
def head() 
 print "\n\n -- == IP Locator 0.1 == --\n\n"
end

def copyright() 
  print "\n\n\n(C) Doddy Hackman 2012\n\n"
  exit(1)
end

target = ARGV[0]

head()
if !target 
 uso()
else 
 ip = Resolv.getaddress(target) 
 web = "http://www.melissadata.com/lookups/iplocation.asp?ipaddress="+ip
 print "\n\n[+] Getting info\n\n\n"
 code = toma(web)
 if code=~/City<\/td>(.*)<\/b><\/td>/
   print "[+] City : "+$2+"\n";
 end
 if code=~/Country<\/td>(.*)<\/b><\/td>/
   print "[+] Country : "+$2+"\n";
 end
 if code=~/State or Region<\/td>(.*)<\/b><\/td>/
    print "[+] State or Region : "+$2+"\n";
 end 
end

copyright()

# The End ?
 
Status
Not open for further replies.
Back
Top