Aide - Recherche - Membres - Calendrier
Version complète : /netwhois
CCS Forums > Scripting mIRC > Scripting mIRC > mIRC: addons
SvenSider
Voici un petit script de requete whois sur ip (pour obtenir le bloc)
Pour la requete au www.who.is , je ne suis pas certain que le cookie soit valide sans limitation de temps, mais jusqu'a présent je n'ai pas du le changer donc c'est bon signe... le cas ou on voudrait activer l'event "on text", bien verifier que le filtre antiflood de mirc soit désactivé et faites attention à ne pas partir en "Excess Flood" donc que vous ayez les privilèges nécessaire sur le serveur pour pouvoir envoyer autant en une fois... smile.gif

CODE
;ON *:TEXT:*!netwhois*:*: {
; if (*!netwhois* iswm $1) {
; set -u20 %netwhois.s $iif(#,#,$nick)
; var %r = ^(([1-2]?[0-9]?[0-9]{1}\.){3}[1-2]?[0-9]?[0-9]{1}$)
; if ($regex($2,%r)) { netwhois $2 }
; else { w.send 5 Ip non valide. }
; }
;}
alias netwhois {
if ($window(@NetWhois)) { clear @NetWhois }
set %netwhois $1
set %netwhois.c 0
sockclose netwhois
sockopen netwhois 38.97.225.153 80
}
ON *:SOCKOPEN:netwhois:{
w.send 11 $+ http://www.who.is/whois-ip/ip-address/ $+ %netwhois $+ /
w.send 2•••
sockwrite -nt $sockname GET /whois-ip/ip-address/ $+ %netwhois HTTP/1.1
sockwrite -nt $sockname Host: www.who.is
sockwrite -nt $sockname Cookie: __utmz=110390467.1196215101.1.1.utmccn=(organic)|utmcsr=google|utmctr=whois|utmc
d=organic; __utma=110390467.1338280309.1196215101.1196215101.1196220500.2; PHPSESSID=qp35nj642q67tosa6uk0kdgkj6; __utmb=110390467; __utmc=110390467 $+ $str($crlf,2)
}
ON *:SOCKREAD:netwhois:{
if ($sockerr > 0) {
w.send 4 Erreur de lecture de la socket n° $sockerr
sockclose $sockname
halt
}
var %r | sockread %r | tokenize 32 $replace(%r, ,$chr(32))
if (*<br>OrgName:* iswm $1-) { set %netwhois.c 1 }
if (<br>OrgName: RIPE Network Coordination Centre == $1-) { sockclose $sockname | w.send 2 $+ RIPE Network Coordination Centre ... | ripewhois %netwhois | unset %r | halt }
if (%netwhois.c) {
if (<br>* !iswm $1-) { set %netwhois.c 0 }
else {
var %s ,%i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%s)
w.send 10 $+ $iif(%s,%s,2•••) }
}
if (*</html>* iswm $1-) { sockclose $sockname | unset %netwhois* }
unset %r
}
alias ripewhois {
set %netwhois $1
set %netwhois.c 0
sockclose ripewhois
sockopen ripewhois 193.0.0.214 80
}
ON *:SOCKOPEN:ripewhois:{
w.send 11 $+ http://www.ripe.net/whois?form_type=simple...amp;searchtext= $+ %netwhois $+ &do_search=Search
w.send 2•••
sockwrite -nt $sockname GET /whois?form_type=simple&full_query_string=&searchtext= $+ %netwhois $+ &do_search=Search HTTP/1.1
sockwrite -nt $sockname Host: www.ripe.net $+ $str($crlf,2)
}
ON *:SOCKREAD:ripewhois:{
if ($sockerr > 0) {
w.send 4 Erreur de lecture de la socket n° $sockerr
sockclose $sockname
halt
}
var %r | sockread %r
if (</pre><table* iswm %r) { set %netwhois.c 0 }
if (*</html>* iswm %r) { sockclose $sockname | unset %netwhois* }
if (%netwhois.c && *</pre><pre>* iswm %r) { w.send 2••• }
var %i = $regsub(%r,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%r)
tokenize 32 $replace(%r, ,$chr(32))
if (*inetnum:* iswm $1-) { set %netwhois.c 1 }
if (%netwhois.c) { w.send 10 $+ $iif($1-,$1-,2•••) }
unset %r
}
alias w.send {
if (%netwhois.s) { msg %netwhois.s $1- }
else {
if (!$window(@NetWhois)) { window -k @NetWhois }
echo 7 @netwhois $1-
}
}
C•Dryk™
Merci Sven` de partager thumbsup.gif toujours aussi bons tes scripts ! smile.gif tongue.gif Merci wink.gif
Ceci une version "bas débit" de notre forum. Pour voir la version complète avec plus d'information, la mise en page et les images, veuillez cliquez ici.
Invision Power Board © 2001-2010 Invision Power Services, Inc.