PHP Script per whois

15 luglio 2009 - Fonte: http://codesnippet.altervista.org Lascia il tuo commento »
E' la tua prima volta qui? Allora iscriviti GRATIS ai nostri feeds! 
NOTA BENE: Il Bloggatore ha rilevato dei problemi di collegamento con il blog indicato come fonte originale dell'articolo. Pertanto, al fine di consentire agli utenti di leggere questo articolo, se possibile, viene reso temporaneamente disponibile il post completo.

Posto un piccolo script per il whois fatto in PHP.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<?php
/*
    example: page.php?s=yahoo.it
*/

$server = array(
"asia" => "whois.nic.asia",
"biz" => "whois.biz",
"com" => "whois.verisign-grs.com",
"coop" => "whois.nic.coop",
"info" => "whois.afilias.net",
"jobs" => "jobswhois.verisign-grs.com",
"mobi" => "whois.dotmobiregistry.net",
"name" => "whois.nic.name",
"net" => "whois.verisign-grs.com",
"org" => "whois.pir.org",
"pro" => "whois.registrypro.pro",
"tel" => "whois.nic.tel",
"travel" => "whois.nic.travel",
"gov" => "whois.dotgov.gov",
"edu" => "whois.educause.edu",
"int" => "whois.iana.org",
"museum" => "whois.museum",
"ac" => "whois.nic.ac",
"ae" => "whois.nic.ae",
"ag" => "whois.nic.ag",
"am" => "whois.amnic.net",
"at" => "whois.nic.at",
"au" => "whois.aunic.net",
"be" => "whois.dns.be",
"bg" => "whois.register.bg",
"bj" => "whois.nic.bj",
"br" => "whois.registro.br",
"ca" => "whois.cira.ca",
"ch" => "whois.nic.ch",
"ci" => "whois.nic.ci",
"cl" => "whois.nic.cl",
"cn" => "whois.cnnic.net.cn",
"cx" => "whois.nic.cx",
"cz" => "whois.nic.cz",
"de" => "whois.denic.de",
"dk" => "whois.dk-hostmaster.dk",
"ee" => "whois.eenet.ee",
"fi" => "whois.ficora.fi",
"fr" => "whois.nic.fr",
"gd" => "whois.adamsnames.com",
"gg" => "whois.channelisles.net",
"gi" => "whois2.afilias-grs.net",
"gs" => "whois.nic.gs",
"gw" => "whois.nic.gw",
"gy" => "whois.registry.gy",
"hk" => "whois.hkirc.hk",
"hn" => "whois2.afilias-grs.net",
"ie" => "whois.domainregistry.ie",
"il" => "whois.isoc.org.il",
"in" => "whois.inregistry.net",
"io" => "whois.nic.io",
"ir" => "whois.nic.ir",
"is" => "whois.isnic.is",
"it" => "whois.nic.it",
"je" => "whois.channelisles.net",
"jp" => "whois.jprs.jp",
"ke" => "whois.kenic.or.ke",
"kg" => "www.domain.kg",
"ki" => "whois.nic.ki",
"kr" => "whois.nic.or.kr",
"kz" => "whois.nic.kz",
"la" => "whois.nic.la",
"li" => "whois.nic.li",
"lt" => "whois.domreg.lt",
"lu" => "whois.dns.lu",
"lv" => "whois.nic.lv",
"ly" => "whois.nic.ly",
"ma" => "whois.iam.net.ma",
"mg" => "whois.nic.mg",
"mn" => "whois.nic.mn",
"ms" => "whois.adamsnames.tc",
"mx" => "whois.nic.mx",
"my" => "whois.mynic.net.my",
"na" => "whois.na-nic.com.na",
"nl" => "whois.domain-registry.nl",
"no" => "whois.norid.no",
"nu" => "whois.nic.nu",
"nz" => "whois.srs.net.nz",
"pl" => "whois.dns.pl",
"pm" => "whois.nic.pm",
"pr" => "whois.uprr.pr",
"re" => "whois.nic.re",
"ro" => "whois.rotld.ro",
"ru" => "whois.ripn.net",
"sa" => "whois.nic.net.sa",
"sb" => "whois.nic.net.sb",
"sc" => "whois2.afilias-grs.net",
"se" => "whois.iis.se",
"sg" => "whois.nic.net.sg",
"sh" => "whois.nic.sh",
"si" => "whois.arnes.si",
"st" => "whois.nic.st",
"tc" => "whois.adamsnames.tc",
"tf" => "whois.nic.tf",
"tk" => "whois.dot.tk",
"tl" => "whois.nic.tl",
"tm" => "whois.nic.tm",
"tr" => "whois.nic.tr",
"tw" => "whois.twnic.net.tw",
"ua" => "whois.net.ua",
"ug" => "whois.co.ug",
"uk" => "whois.nic.uk",
"us" => "whois.nic.us",
"uz" => "whois.cctld.uz",
"vc" => "whois2.afilias-grs.net",
"ve" => "whois.nic.ve",
"vg" => "whois.adamsnames.tc",
"wf" => "whois.nic.wf",
"ws" => "whois.website.ws",
"yt" => "whois.nic.yt");
 
$s = getDomain($_GET['s']);
 
if($s != NULL && $server[$s[1]] != "") {
    $connection = fsockopen($server[$s[1]], 43);
    if (!$connection)
        echo "Errore";
    else {
        $msg = "";
        fputs($connection, $s[0].".".$s[1]."\r\n");
        while (!feof($connection))
            $msg .= fgets($connection, 4096);
 
        fclose($connection);
 
        echo "<pre>".
            $msg
        ."</pre>";
    }
}else
    echo "URL non valido";
 
function getDomain($url) {
    $arrU = explode(".", $url);
    if(count($arrU) >= 2)
        return array($arrU[count($arrU)-2], $arrU[count($arrU)-1]);
    else
        return NULL;
}
?>

Nessun post correlato!








SEGNALA / INVIA QUESTO POST:  Share
Hai trovato questo articolo interessante? Iscriviti GRATIS ai nostri feeds! 

Lascia un Commento