################################## IP Whois (IPv6 Supported) ##################################set whoisinfo(trigger) ".ip"set whoisinfo(port) 43set whoisinfo(ripe) "whois.ripe.net"set whoisinfo(arin) "whois.arin.net"set whoisinfo(apnic) "whois.apnic.net"set whoisinfo(lacnic) "whois.lacnic.net"set whoisinfo(afrinic) "whois.afrinic.net"
bind pub - $whoisinfo(trigger) pub_whoisinfo
proc whoisinfo_setarray {} {global queryset query(netname) "(none)"set query(country) "(none)"set query(orgname) "(none)"set query(orgid) "(none)"set query(range) "(none)"}
proc whoisinfo_display { chan } {global queryputlog "Firstline: $query(firstline)"puthelp "PRIVMSG $chan :!04Ip04Cek04! 03Jarak :14 $query(range) -03 NamaNet :14 $query(netname) -03 Organisasi :14 $query(orgname) -03 Negara :14 $query(country) !04egG04o!"}
proc pub_whoisinfo {nick uhost handle chan search} {global whoisinfoglobal querywhoisinfo_setarrayif {[whoisinfo_whois $whoisinfo(arin) $search]==1} {if {[string compare [string toupper $query(orgid)] "RIPE"]==0} {if {[whoisinfo_whois $whoisinfo(ripe) $search]==1} {whoisinfo_display $chan}} elseif {[string compare [string toupper $query(orgid)] "APNIC"]==0} {if {[whoisinfo_whois $whoisinfo(apnic) $search]==1} {whoisinfo_display $chan}} elseif {[string compare [string toupper $query(orgid)] "LACNIC"]==0} {if {[whoisinfo_whois $whoisinfo(lacnic) $search]==1} {whoisinfo_display $chan}} elseif {[string compare [string toupper $query(orgid)] "AFRINIC"]==0} {if {[whoisinfo_whois $whoisinfo(afrinic) $search]==1} {whoisinfo_display $chan}} else {whoisinfo_display $chan}} else {if { [info exist query(firstline)] } {puthelp "PRIVMSG $chan :4$query(firstline)"} else {puthelp "PRIVMSG $chan :!04Ip04Cek04! Gagal"}}}
proc whoisinfo_whois {server search} {global whoisinfoglobal queryset desccount 0set firstline 0set reply 0putlog "Whois: $server:$whoisinfo(port) -> $search"if {[catch {set sock [socket -async $server $whoisinfo(port)]} sockerr]} {puthelp "PRIVMSG $chan :!04Ip04Cek04! Salah: $sockerr. Coba beberapa saat lagi."close $sockreturn 0}puts $sock $searchflush $sockwhile {[gets $sock whoisline]>=0} {putlog "Whois: $whoisline"if {[string index $whoisline 0]!="#" && [string index $whoisline 0]!="%" && $firstline==0} {if {[string trim $whoisline]!=""} {set query(firstline) [string trim $whoisline]set firstline 1}}if {[regexp -nocase {netname:(.*)} $whoisline all item]} {set query(netname) [string trim $item]set reply 1} elseif {[regexp -nocase {owner-c:(.*)} $whoisline all item]} {set query(netname) [string trim $item]set reply 1} elseif {[regexp -nocase {country:(.*)} $whoisline all item]} {set query(country) [string trim $item]set reply 1} elseif {[regexp -nocase {descr:(.*)} $whoisline all item] && $desccount==0} {set query(orgname) [string trim $item]set desccount 1set reply 1} elseif {[regexp -nocase {orgname:(.*)} $whoisline all item]} {set query(orgname) [string trim $item]set reply 1} elseif {[regexp -nocase {owner:(.*)} $whoisline all item]} {set query(orgname) [string trim $item]set reply 1} elseif {[regexp -nocase {orgid:(.*)} $whoisline all item]} {set query(orgid) [string trim $item]set reply 1} elseif {[regexp -nocase {inetnum:(.*)} $whoisline all item]} {set query(range) [string trim $item]set reply 1} elseif {[regexp -nocase {netrange:(.*)} $whoisline all item]} {set query(range) [string trim $item]set reply 1}}close $sockreturn $reply}putlog "IP TCL Loded By g0eZ egGo Succesfully"
Sunday, August 28, 2011
ip check.tcl
Labels:
tCL
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment