PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > alt.www.webmaster > Finding abuse contact for IP address
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Finding abuse contact for IP address

Réponse
 
LinkBack Outils de la discussion
Vieux 11/09/2007, 16h56   #1
Karl Groves
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Finding abuse contact for IP address

This is probably a more appropriate question for comp.lang.php but I like
you guys better.

I'm looking for a way - using PHP - to get *only* the abuse contact for an
IP address. Anyone know how to do this?


TIA





--
Karl Groves
http://www.WebAccessStrategies.com
  Réponse avec citation
Vieux 11/09/2007, 17h22   #2
GreyWyvern
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Finding abuse contact for IP address

And lo, Karl Groves didst speak in alt.www.webmaster:

> This is probably a more appropriate question for comp.lang.php but I like
> you guys better.
>
> I'm looking for a way - using PHP - to get *only* the abuse contact for
> an
> IP address. Anyone know how to do this?


Assuming a *nix server with shell access to the whois command, try this on
for size:


<?php

if (isset($_GET['ip']) && preg_match("/(\d{1,3}\.){3}\d{1,3}/",
$_GET['ip'])) {

echo "Checking {$_GET['ip']} . . .\n";

if (preg_match("/(abuse@[\S]+)/i", `whois {$_GET['ip']}`, $match)) {
$abuse = $match[1];
echo "Abuse email address: $abuse";

} else echo "No abuse email address found";

} else echo "Invalid IP or No IP Given";

?>


The script will accept IPs sent via HTTP in the form:
/abuse.php?ip=123.123.123.123 Modify as you see fit.

Note the IP regular expression is a simple one which will also allow IPs
like 999.999.999.999 to get through.

Grey

--
The technical axiom that nothing is impossible sinisterly implies the
pitfall corollary that nothing is ridiculous.
- http://www.greywyvern.com/orca#search - Orca Search: Full-featured
spider and site-search engine
  Réponse avec citation
Vieux 11/09/2007, 18h01   #3
Karl Groves
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Finding abuse contact for IP address

GreyWyvern <spam@greywyvern.com> wrote in
newsp.tyhzq1jlsl6xfd@news.nas.net:

> And lo, Karl Groves didst speak in alt.www.webmaster:
>
>> This is probably a more appropriate question for comp.lang.php but I
>> l

> ike
>> you guys better.
>>
>> I'm looking for a way - using PHP - to get *only* the abuse contact
>> fo

> r
>> an
>> IP address. Anyone know how to do this?

>
> Assuming a *nix server with shell access to the whois command, try
> this on for size:
>


HAWT.
Thanks!



--
Karl Groves
http://www.WebAccessStrategies.com
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 04h17.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,10228 seconds with 11 queries