• 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] Whois Online 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 simple script en Ruby para hacer un whois al dominio que quieran.

Code:
>
#!usr/bin/ruby
#Whois Online 0.1
#Coded BY Doddy H

require "net/http"

def head()
 print "\n-- == Whois Online 0.1 == --\n\n"
end

def sintax()
 print "\n[+] Sintax : ruby domain.rb \n"
end

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

def tomar(web,par)
 return Net::HTTP.post_form(URI.parse(web),par).body
end

def whois(dom)
 code = tomar("http://networking.ringofsaturn.com/Tools/whois.php",{"domain"=>dom,"submit"=>"submit"})
 if  code=~/(.*?)<\/pre>/mi
   final = $1
   final = final.sub(/"/,"")
   final = final.sub(/>>>/,"")
   final = final.sub(/<<</,"")
   return final
 else
   return "Not Found"
 end
end

domain = ARGV[0]

head()
if !domain
 sintax()
else
 print whois(domain)
end
copyright()
   
#The End ?
 
Status
Not open for further replies.
Back
Top