VeilleIP => Se protéger des Federaux

Moderator: Mod

VeilleIP => Se protéger des Federaux

Postby VOXPOPULI » Wed Jan 04, 2012 4:02 pm

Ce script écris (de A-Z) par VoxPopuli n'a pour but actuelle que vous signaler si l'IP qu'il reçoit provient d'une IP Fédérale (entendre par là si elle appartient a un organisme gouvernementale).
Suivez les commentaires pour modifier le script a votre guise. A noter que le script NE GÈRE PAS [u:21996efaa7]ENCORE[/u:21996efaa7] LE XML !!! (dans un futur proche si le tuto que je suivais veut bien fonctionner...).
Le Script est en deux fichiers, le logiciel et la base de données (un tableau php). Si vous changez le nom/emplacement du fichier 'ListeIpFederale.php', veillez a le modifier dans le script.


ATTENTION:
Ce script ne vous permettra pas de cacher des pages internet des yeux du FBI, en effet ceux-ci n'ont qu'a passer par un Proxy ou utiliser une IP non référencé pour accéder a votre page, utilisez un système de Session sécurisé pour protéger vos données sensible des yeux de Big Brother. Ce script vous permettra seulement de savoir si un visiteur ou un adresse IP est connue et référencé comme "dangereuse" et de faire réagir votre site/programme en fonction de l'évènement et de vos attentes.

Fichier "VeilleIP.php":
[code:1:21996efaa7]<?php
/*------VV-------------VV-EEEEEEEEE--II--LL--------LL-------EEEEEEEEE---------II--PPPPPP---------------------V--*/
/*-------VV-----------VV--EE---------II--LL--------LL-------EE----------------II--PP----PP-------------------O--*/
/*--------VV---------VV---EE---------II--LL--------LL-------EE----------------II--PP-----PP------------------X--*/
/*---------VV-------VV----EEEEEE-----II--LL--------LL-------EEEEEE------------II--PP----PP-------------------P--*/
/*----------VV-----VV-----EEEEEE-----II--LL--------LL-------EEEEEE------------II--PPPPPP---------------------O--*/
/*-----------VV---VV------EE---------II--LL--------LL-------EE----------------II--PP-------------------------P--*/
/*------------VV-VV-------EE---------II--LL--------LL-------EE----------------II--PP-------------------------U--*/
/*-------------VVV--------EEEEEEEEE--II--LLLLLLLL--LLLLLLLL-EEEEEEEEE---------II--PP-------------------------L--*/
/*-----------------------------------------------------------------------------------------------------------I--*/
/*-----------------------------------------------------------------------------------WRITE BY VOXPOPULI---------*/
/*--------------------------------------------------------------------------------------------------------------*/
/* Programme permettant de détecter, en fonction de l'adresse IP, si le visiteur provient d'un gouvernement */
/* initialisation variable*/
$retour = 0;
$ip = getenv('REMOTE_ADDR');/* recuperation de l'IP MODIFIEZ ICI POUR ENVOYER UNE AUTRE IP QUE CELLE DU VISITEUR AU SCRIPT */

/* type de base de données */
/* choix possible = 'xml' (pour un fichier xml) ou 'tab' (pour un tableau php) */
$Type_BaseDeDonnees = "tab"; /* 'xml' or 'tab' only*/

/* nom/emplacement du fichier servant de base de données*/
$Emplacement_BaseDeDonnees = 'ListeIpFederale.php'; /* file where is the BDD*/
$nb = VeilleIP_CalculIP($ip);/* transforme l'ip en un nombre / calculate the number */

/* lis le fichier BDD et cherche l'ip*/
$retour = VeilleIP_Detect_ip_federale($Type_BaseDeDonnees, $nb, $Emplacement_BaseDeDonnees); /* search in the BDD if the IP is BigBrother*/

/*********************************************************/
/* agis en fonction de la detection */
/* Edit here for use */
if ($retour['erreur'] != 0){ /* IF HAVE ERROR */
echo 'Erreur : '.$retour['erreur'];
}elseif($retour['detect'] === 0){ /* client normal / happy customer */
echo 'inconnu';
}elseif($retour['detect'] === 1){ /* vilaine bestiole / DarkVador's friend */
echo 'bad guy : '.$retour['name'];
}
/***********************************************************/

function VeilleIP_CalculIP($ip){
/* principe du calcul:
ip: nb1.nb2.nb3.nb4
formule: (nb1*256*256*256)+(nb2*256*256)+(nb3*256)+(nb4) */
$tableau = preg_split("/\./", $ip); // decoupe l'ip en 4 nombre
$nombre = ($tableau[0] *256 *256 *256)+($tableau[1] *256 *256)+($tableau[2] *256)+($tableau[3]);//transforme les 4 nombres en un seul
return $nombre;
}

function VeilleIP_Detect_ip_federale($TypeBaseDeDonnees, $nb, $location_Data){
$return = array('erreur'=>'Oups, j\'ai plant&eacute;',
'detect'=>0,
'name'=>' '
);

if($TypeBaseDeDonnees && $location_Data){
switch($TypeBaseDeDonnees){
case 'tab':
case 'tableau':
case 'php':
/* exemple de tableau: */
/* case[1]=array('ip_start' => '' , 'ip_end' => '', 'masque'=>'', 'name'=>'')*/
include_once($location_Data);
$infos = VeilleIP_GestionTableauPHP($nb);
$return['erreur'] = 0;
$return['detect'] = $infos['detect'];
$return['name'] = $infos['name'];
break;
case 'xml':
$return['erreur'] = 'xml non pris en charge / I don\'t know how to read xml';
/*VeilleIP_GestionXml($nb, $location_Data);*/
break;
}
}else{
$return['erreur'] = 'Base de donn$eacute;es non pr&eacute;cis&eacute; / Error BDD location';
}
return $return;
}

function VeilleIP_GestionTableauPHP($nombre){
$fin = array('erreur'=>0, 'detect'=>0, 'name'=>'');
$tab = ListeIpFederale();
foreach ($tab as $value){
$range_debut = VeilleIP_CalculIP($value['ip_start']);
$range_fin = VeilleIP_CalculIP($value['ip_end']);
if ($nombre >= $range_debut && $nombre <= $range_fin){
$fin['detect'] = 1;
$fin['name'] = $value['name'];
break;
}
}
return $fin;
}


function VeilleIP_GestionXML($nombre, $emplacement_fichier){
$dom = new DomDocument(); //creation de l'objet xml
$dom -> load($emplacement_fichier); //chargement du fichier xml dans l'objet

/*if (!@$dom->validate()) {
return false;
break;
}*/
$listeElement = $dom->getElementsByTagName('liste'); //recuperation des elements

foreach($listeElement as $element){
//verifie si tout les elements sont présent
if ($element->hasAttributes("AdresseDepart") and
$element->hasAttributes("AdresseFin") and
$element->hasAttributes("Masque")){
$nom = $element->getAttribute('nom');
/* recuperation de chaque element individuellement */
$IP_Depart = $element->getAttribute("AdresseDepart");
$IP_Fin = $element->getAttribute("AdresseFin");
$Masque = $element->getAttribute("Masque");
echo $nom->nodeValue;
}
}
}
?> [/code:1:21996efaa7]

Fichier "ListeIpFederale.php":
[code:1:21996efaa7]<?php
/* Redacteur: VoxPopuli*/
function ListeIpFederale (){
/* tableau avec les différentes valeurs (en attendant la fiche XML) */
$tableau = array(
/*array('ip_start' => '' , 'ip_end' => '', 'masque'=>'', 'name'=>''),*/
array('ip_start' => '4.42.244.160' , 'ip_end' => '4.42.244.175', 'masque'=>'28', 'name'=>'Federal Bureau of Investigation'),
array('ip_start' => '4.42.244.192' , 'ip_end' => '4.42.244.223', 'masque'=>'27', 'name'=>'Federal Bureau of Investigation'),
array('ip_start' => '12.38.31.216' , 'ip_end' => '12.38.31.223', 'masque'=>'29', 'name'=>'Federal Bureau of Investigation'),
array('ip_start' => '29.0.0.0' , 'ip_end' => '29.255.255.255', 'masque'=>'8', 'name'=>'DoD Network Information Centers'),
array('ip_start' => '61.88.128.38' , 'ip_end' => '61.88.128.38', 'masque'=>'32', 'name'=>'Australian Federal Police (proxy server)'),
array('ip_start' => '63.64.5.0' , 'ip_end' => '63.64.5.255', 'masque'=>'24', 'name'=>'Cyveillance'),
array('ip_start' => '63.78.79.144' , 'ip_end' => '63.78.79.151', 'masque'=>'29', 'name'=>'Police Protective Le UU-63-78-79-144'),
array('ip_start' => '63.100.163.0' , 'ip_end' => '63.100.163.255', 'masque'=>'24', 'name'=>'CYVEILLANCE (unlisted)'),
array('ip_start' => '63.100.235.128' , 'ip_end' => '63.100.235.191', 'masque'=>'26', 'name'=>'Syntrillium Software'),
array('ip_start' => '63.127.255.0' , 'ip_end' => '63.127.255.255', 'masque'=>'24', 'name'=>'Cyveillance'),
array('ip_start' => '63.148.99.224' , 'ip_end' => '63.148.99.255', 'masque'=>'27', 'name'=>'Cyveillance'),
array('ip_start' => '63.163.104.32' , 'ip_end' => '63.163.104.47', 'masque'=>'28', 'name'=>'Department of Homeland Security SPRINTLINK'),
array('ip_start' => '64.115.129.144' , 'ip_end' => '64.115.129.151', 'masque'=>'29', 'name'=>'Internal Intelligence Service 973242S101-BDVU'),
array('ip_start' => '65.118.41.192' , 'ip_end' => '65.118.41.223', 'masque'=>'27', 'name'=>'Cyveillance'),
array('ip_start' => '65.173.188.0' , 'ip_end' => '65.173.189.255', 'masque'=>'24', 'name'=>'Federal Bureau of Investigation'),
array('ip_start' => '65.174.230.32' , 'ip_end' => '65.174.230.47', 'masque'=>'28', 'name'=>'Federal Bureau of Investigation'),
array('ip_start' => '66.72.93.16' , 'ip_end' => '66.72.93.23', 'masque'=>'29', 'name'=>'Police Intelligence Network SBCIS-101529-164145'),
array('ip_start' => '66.109.166.136' , 'ip_end' => '66.109.166.143', 'masque'=>'29', 'name'=>'Office of Law Enforcement Tech. OLETCINCDSL'),
array('ip_start' => '66.109.166.144' , 'ip_end' => '66.109.166.151', 'masque'=>'29', 'name'=>'Office of Law Enforcement Tech. OLETCINCCONREACH'),
array('ip_start' => '130.46.0.0' , 'ip_end' => '130.46.255.255', 'masque'=>'16', 'name'=>'DoD Network Information Center'),
array('ip_start' => '130.109.0.0' , 'ip_end' => '130.109.255.255', 'masque'=>'16', 'name'=>'DoD Network Information Center '),
array('ip_start' => '131.73.0.0' , 'ip_end' => '131.73.255.255', 'masque'=>'16', 'name'=>'DoD Network Information Center'),
array('ip_start' => '131.80.0.0' , 'ip_end' => '131.80.255.255', 'masque'=>'16', 'name'=>'DoD Network Information Center'),
array('ip_start' => '131.81.0.0' , 'ip_end' => '131.81.255.255', 'masque'=>'16', 'name'=>'DoD Network Information Center'),
array('ip_start' => '131.83.0.0' , 'ip_end' => '131.83.255.255 ', 'masque'=>'16', 'name'=>'DoD Network Information Center'),
array('ip_start' => '131.85.0.0' , 'ip_end' => '131.85.255.255', 'masque'=>'16', 'name'=>'DoD Network Information Center'),
array('ip_start' => '131.88.0.0' , 'ip_end' => '131.88.255.255', 'masque'=>'16', 'name'=>'DoD Network Information Center'),
array('ip_start' => '131.185.0.0' , 'ip_end' => '131.185.255.255', 'masque'=>'16', 'name'=>'Australian Department of Defence DSTO'),
array('ip_start' => '131.240.0.0' , 'ip_end' => '131.240.255.255 ', 'masque'=>'16', 'name'=>'DoD Network Information Center'),
array('ip_start' => '132.37.0.0' , 'ip_end' => '132.37.255.255', 'masque'=>'16', 'name'=>'DoD Network Information Center'),
array('ip_start' => '132.39.0.0' , 'ip_end' => '132.39.255.255', 'masque'=>'16', 'name'=>'DoD Network Information Center'),
array('ip_start' => '132.80.0.0' , 'ip_end' => '132.86.255.255', 'masque'=>'16', 'name'=>'DoD Network Information Center'),
array('ip_start' => '132.87.0.0' , 'ip_end' => '132.87.255.255', 'masque'=>'16', 'name'=>'DoD Network Information Center'),
array('ip_start' => '132.95.0.0' , 'ip_end' => '132.144.255.255', 'masque'=>'16', 'name'=>'DoD Network Information Center'),
array('ip_start' => '134.194.0.0' , 'ip_end' => '134.194.255.255', 'masque'=>'16', 'name'=>'DoD Network Information Center'),
array('ip_start' => '134.229.0.0' , 'ip_end' => '134.229.255.255', 'masque'=>'16', 'name'=>'DoD Network Information Center'),
array('ip_start' => '134.230.0.0' , 'ip_end' => '134.230.255.255', 'masque'=>'16', 'name'=>'DoD Network Information Center'),
array('ip_start' => '134.232.0.0' , 'ip_end' => '134.232.255.255', 'masque'=>'16', 'name'=>'DoD Network Information Center'),
array('ip_start' => '134.254.0.0' , 'ip_end' => '134.254.255.255', 'masque'=>'16', 'name'=>'DoD Network Information Center'),
array('ip_start' => '136.188.0.0' , 'ip_end' => '136.197.255.255 ', 'masque'=>'16', 'name'=>'DoD Network Information Center'),
array('ip_start' => '136.208.0.0' , 'ip_end' => '136.208.255.255', 'masque'=>'16', 'name'=>'DoD Network Information Center'),
array('ip_start' => '136.211.0.0' , 'ip_end' => '136.214.255.255', 'masque'=>'16', 'name'=>'DoD Network Information Center'),
array('ip_start' => '136.222.0.0' , 'ip_end' => '136.222.255.255', 'masque'=>'16', 'name'=>'DoD Network Information Center'),
array('ip_start' => '137.130.0.0' , 'ip_end' => '137.130.255.255 ', 'masque'=>'16', 'name'=>'DoD Network Information Center'),
array('ip_start' => '137.191.0.0' , 'ip_end' => '137.191.255.255', 'masque'=>'16', 'name'=>'Irish Department of Defense'),
array('ip_start' => '137.209.0.0' , 'ip_end' => '137.212.255.255', 'masque'=>'16', 'name'=>'DoD Network Information Center'),
array('ip_start' => '137.231.0.0' , 'ip_end' => '137.235.255.255', 'masque'=>'16', 'name'=>'DoD Network Information Center'),
array('ip_start' => '137.246.0.0' , 'ip_end' => '137.247.255.255', 'masque'=>'16', 'name'=>'DoD Network Information Center'),
array('ip_start' => '138.60.0.0' , 'ip_end' => '138.60.255.255', 'masque'=>'16', 'name'=>'DoD Network Information Center'),
array('ip_start' => '138.135.0.0', 'ip_end' => '138.136.255.255', 'masque'=>'16', 'name'=>'DoD Network Information Center'),
array('ip_start' => '138.150.0.0' , 'ip_end' => '138.151.255.255', 'masque'=>'16', 'name'=>'DoD Network Information Center'),
array('ip_start' => '138.153.0.0' , 'ip_end' => '138.153.255.255', 'masque'=>'16', 'name'=>'DoD Network Information Center'),
array('ip_start' => '138.159.0.0' , 'ip_end' => '138.159.255.255', 'masque'=>'16', 'name'=>'DoD Network Information Center'),
array('ip_start' => '138.170.0.0' , 'ip_end' => '138.170.255.255', 'masque'=>'16', 'name'=>'DoD Network Information Center'),
array('ip_start' => '139.77.0.0' , 'ip_end' => '139.77.255.255', 'masque'=>'16', 'name'=>'DoD Network Information Center'),
array('ip_start' => '139.233.0.0' , 'ip_end' => '139.254.255.255', 'masque'=>'16', 'name'=>'DoD Network Information Center'),
array('ip_start' => '140.1.0.0' , 'ip_end' => '140.13.255.255', 'masque'=>'16', 'name'=>'DoD Network Information Center'),
array('ip_start' => '140.15.0.0' , 'ip_end' => '140.42.255.255', 'masque'=>'16', 'name'=>'DoD Network Information Center'),
array('ip_start' => '140.44.0.0' , 'ip_end' => '140.74.255.255', 'masque'=>'16', 'name'=>'DoD Network Information Center'),
array('ip_start' => '140.194.0.0' , 'ip_end' => '140.194.255.255', 'masque'=>'16', 'name'=>'DoD Network Information Center'),
array('ip_start' => '140.199.0.0' , 'ip_end' => '140.199.255.255', 'masque'=>'16', 'name'=>'DoD Network Information Center'),
array('ip_start' => '146.221.0.0' , 'ip_end' => '146.221.255.255', 'masque'=>'16', 'name'=>'Australian Department of Defence DOD-AU'),
array('ip_start' => '147.186.0.0' , 'ip_end' => '147.186.255.255', 'masque'=>'16', 'name'=>'[se] police'),
array('ip_start' => '149.101.0.0' , 'ip_end' => '149.101.255.255', 'masque'=>'16', 'name'=>'US Department of Justice'),
array('ip_start' => '152.91.0.0' , 'ip_end' => '152.91.255.255', 'masque'=>'16', 'name'=>'claims to be an Australian government dept that no longer exists, associated with 90East.com, an Internet security site'),
array('ip_start' => '153.31.0.0' , 'ip_end' => '153.31.255.255', 'masque'=>'16', 'name'=>'Federal Bureau of Investigation-CJIS'),
array('ip_start' => '160.64.0.0' , 'ip_end' => '160.64.255.255', 'masque'=>'16', 'name'=>'Australian Department of Defence DSTOMEL1'),
array('ip_start' => '162.23.0.0' , 'ip_end' => '162.23.255.255', 'masque'=>'16', 'name'=>'Swiss Federal Government, Swiss Federal Office of Information Technology and Systems, Bundesamt fur Informatik'),
array('ip_start' => '162.45.0.0' , 'ip_end' => '162.45.255.255', 'masque'=>'16', 'name'=>'Central Intelligence Agency CIA', 'country'=>'usa'),
array('ip_start' => '164.112.0.0' , 'ip_end' => '164.112.255.255', 'masque'=>'16', 'name'=>'Queensland Police Service'),
array('ip_start' => '164.128.37.17' , 'ip_end' => '164.128.223.145', 'masque'=>'17', 'name'=>'Police of Switzerland'),
array('ip_start' => '164.141.0.0' , 'ip_end' => '164.141.255.255', 'masque'=>'16', 'name'=>'Police Administration in Finland'),
array('ip_start' => '165.142.0.0' , 'ip_end' => '165.142.255.255', 'masque'=>'16', 'name'=>'Department of Justice AUVICDJUST'),
array('ip_start' => '165.187.0.0' , 'ip_end' => '165.187.255.255', 'masque'=>'16', 'name'=>'Western Australian Police Department WAPOL', 'country'=>'au'),
array('ip_start' => '166.64.0.0' , 'ip_end' => '166.64.255.255', 'masque'=>'16', 'name'=>'New South Wales Police Service NSWPOLICE'),
array('ip_start' => '168.152.0.0' , 'ip_end' => '168.152.255.255', 'masque'=>'16', 'name'=>'Australian Federal Police AFP-AU-B1'),
array('ip_start' => '192.58.200.0' , 'ip_end' => '192.58.203.255', 'masque'=>'22', 'name'=>'Department of Justice GOVDOJBLS01'),
array('ip_start' => '192.84.170.0' , 'ip_end' => '192.84.170.255', 'masque'=>'24', 'name'=>'Federal Bureau of Investigation', 'country'=>'usa'),
array('ip_start' => '192.190.61.0' , 'ip_end' => '192.190.61.255', 'masque'=>'24', 'name'=>'Tasmania Police Department TASPOL'),
array('ip_start' => '192.190.66.0' , 'ip_end' => '192.190.66.255', 'masque'=>'24', 'name'=>'Australian Institute of Criminology AIC'),
array('ip_start' => '192.251.207.0' , 'ip_end' => '192.251.207.255', 'masque'=>'24', 'name'=>'Australian Army Support Agency SYS-SPT-ARMY'),
array('ip_start' => '193.77.9.0' , 'ip_end' => '193.77.9.255', 'masque'=>'24', 'name'=>'Hacker from Slovenia'),
array('ip_start' => '193.121.83.1' , 'ip_end' => '193.121.83.255', 'masque'=>'24', 'name'=>'Federale politie - Police federale (BELGIUM)', 'country'=>'be'),
array('ip_start' => '193.172.176.0' , 'ip_end' => '193.172.177.255', 'masque'=>'24', 'name'=>'Dutch Government', 'country'=>'d'),
array('ip_start' => '193.191.209.192' , 'ip_end' => '193.191.209.207', 'masque'=>'28', 'name'=>'Belgium Federal Government' , 'country'=>'be'),
array('ip_start' => '193.252.72.142' , 'ip_end' => '193.252.72.142', 'masque'=>'32', 'name'=>'French Department of Defense ', 'country'=>'fr'),
array('ip_start' => '193.252.228.0' , 'ip_end' => '193.252.228.255', 'masque'=>'24', 'name'=>'Prefecture de police de Paris', 'country'=>'fr'),
array('ip_start' => '194.89.205.0' , 'ip_end' => '194.89.205.255', 'masque'=>'24', 'name'=>'Finnish Police'),
array('ip_start' => '195.46.218.178' , 'ip_end' => '195.46.218.178', 'masque'=>'32', 'name'=>'French Military Police', 'country'=>'fr'),
array('ip_start' => '195.76.172.0' , 'ip_end' => '195.76.172.255', 'masque'=>'24', 'name'=>'Direccion General de la Policia (SPAIN)', 'country'=>'s'),
array('ip_start' => '195.76.204.0' , 'ip_end' => '195.76.204.255', 'masque'=>'24', 'name'=>'Ministerio del Interior (Spain)', 'country'=>'s'),
array('ip_start' => '195.162.203.0' , 'ip_end' => '195.162.203.7', 'masque'=>'29', 'name'=>'Politie Belgium (Federal Computer Crime Unit)', 'country'=>'be'),
array('ip_start' => '198.61.8.0' , 'ip_end' => '198.61.15.255', 'masque'=>'21', 'name'=>'Tasmania Police Department NETBLK-TASPOL'),
array('ip_start' => '198.137.240.0' , 'ip_end' => '198.137.241.255', 'masque'=>'24', 'name'=>'Executive Office Of The President USA', 'country'=>'usa'),
array('ip_start' => '198.165.21.64' , 'ip_end' => '198.165.21.79', 'masque'=>'28', 'name'=>'Department of Justice GT-198-165-21-64-CX'),
array('ip_start' => '198.190.209.0' , 'ip_end' => '198.190.209.255', 'masque'=>'24', 'name'=>'Federal Bureau of Investigation', 'country'=>'usa'),
array('ip_start' => '199.75.96.0' , 'ip_end' => '199.75.107.255', 'masque'=>'21', 'name'=>'Organization of American States (www.ftaa-alca.org)', 'country'=>'usa'),
array('ip_start' => '199.123.80.0' , 'ip_end' => '199.123.80.255', 'masque'=>'24', 'name'=>'US Army Criminal Investigation Command ACIRS-DEV', 'country'=>'usa'),
array('ip_start' => '199.212.192.0' , 'ip_end' => '199.212.216.255', 'masque'=>'19', 'name'=>'Department of Justice DOJ-GC-CA'),
array('ip_start' => '199.227.159.64' , 'ip_end' => '199.227.159.95', 'masque'=>'27', 'name'=>'Epic EPIC-200309091608751 (NET-199-227-159-64-1)'),
array('ip_start' => '203.25.230.0' , 'ip_end' => '203.25.231.255', 'masque'=>'24', 'name'=>'Victoria Police Centre'),
array('ip_start' => '204.75.224.0' , 'ip_end' => '204.75.224.255', 'masque'=>'24', 'name'=>'Office of the Sheriff, Rusk County, Texas', 'country'=>'usa'),
array('ip_start' => '204.91.138.0' , 'ip_end' => '204.91.138.255', 'masque'=>'24', 'name'=>'EPIC EPIC2-NET (NET-204-91-138-0-1)'),
array('ip_start' => '205.128.1.240' , 'ip_end' => '205.128.1.255', 'masque'=>'28', 'name'=>'Office of the Inspector General OIG-1-05'),
array('ip_start' => '205.229.233.0' , 'ip_end' => '205.229.233.255', 'masque'=>'24', 'name'=>'Federal Bureau of Investigation', 'country'=>'usa'),
array('ip_start' => '206.212.128.0' , 'ip_end' => '206.212.191.255 ', 'masque'=>'18', 'name'=>'New York City Police Department NYPD-GOV', 'country'=>'usa'),
array('ip_start' => '206.218.64.0' , 'ip_end' => '206.218.127.255', 'masque'=>'18', 'name'=>'Office of the Attorney General, State of Texas'),
array('ip_start' => '206.241.30.0' , 'ip_end' => '206.241.31.255', 'masque'=>'24', 'name'=>'US Customs'),
array('ip_start' => '207.43.55.0' , 'ip_end' => '207.43.55.255', 'masque'=>'24', 'name'=>'Federal Bureau of Investigation', 'country'=>'usa'),
array('ip_start' => '207.132.172.0' , 'ip_end' => '207.132.175.255', 'masque'=>'22', 'name'=>'Office of the Judge Advocate General, US Navy', 'country'=>'usa'),
array('ip_start' => '207.132.176.0' , 'ip_end' => '207.132.191.255', 'masque'=>'20', 'name'=>'Office of the Judge Advocate General, US Navy', 'country'=>'usa'),
array('ip_start' => '207.155.128.0' , 'ip_end' => '207.155.255.255', 'masque'=>'17', 'name'=>'NetPD'),
array('ip_start' => '212.31.111.172' , 'ip_end' => '212.31.111.175', 'masque'=>'30', 'name'=>'Cyprus Police'),
array('ip_start' => '214.0.0.0' , 'ip_end' => '214.255.255.255', 'masque'=>'8', 'name'=>'DoD Network Information Center'),
array('ip_start' => '215.0.0.0' , 'ip_end' => '215.255.255.255', 'masque'=>'8', 'name'=>'DoD Network Information Center (More)'),
array('ip_start' => '216.118.66.0' , 'ip_end' => '216.118.66.255', 'masque'=>'24', 'name'=>'Brussel politie - Police bruxelles', 'country'=>'be'),
array('ip_start' => '216.146.85.224' , 'ip_end' => '216.146.85.255', 'masque'=>'27', 'name'=>'Federal Bureau of Investigation', 'country'=>'usa'),
array('ip_start' => '217.167.182.0' , 'ip_end' => '217.167.182.255', 'masque'=>'24', 'name'=>'French Department of Defense', 'country'=>'fr')
);
return $tableau;
}


?>[/code:1:21996efaa7]

Logiciel créé grâce à la liste d'IP fournies sur le lien suivant:
http://www.frameip.com/block-ip-federaux/

Merci FrameIP ;)
VOXPOPULI
Projets
 
Posts: 39
Joined: Sun Jan 23, 2011 11:54 pm

Postby Manu404 » Wed Jan 04, 2012 6:28 pm

J4ai envie de dire, si on utilise des proxy, pourquoi pas eux ? :/
User avatar
Manu404
 
Posts: 2219
Joined: Tue Feb 26, 2008 3:44 pm
Location: ::1:

Postby SHEPSHEP » Thu Jan 05, 2012 8:57 am

Quand tu développe pense objet c'est plus portable :wink:

Autre chose, à chacun son boulot, PHP n'est pas fait pour faire du filtrage d'IP.
Pour ça il y a des outils spécialisé, iptables par exemple.

Dans le cas ou vous n'avez pas accès au serveur, il reste toujours apache et .htaccess.

Et comme l'avez dis :
[quote:e789d5551a="Voxpolpuli"]en effet ceux-ci n'ont qu'a passer par un Proxy[/quote:e789d5551a]
[quote:e789d5551a="Manu404"]si on utilise des proxy, pourquoi pas eux ?[/quote:e789d5551a]

++
2ShEp
SHEPSHEP
Projets
 
Posts: 268
Joined: Wed Apr 08, 2009 11:14 am
Location: /dev/null

Postby VOXPOPULI » Fri Jan 06, 2012 2:53 pm

Merci du conseil, apprendre la programmation objet est dans mon programme :)


En effet, un simple proxy permet d'outre passer ce "filtrage" néanmoins, je l'ai plus créé pour le fun qu'autre chose, voyant qu'il n'existait pas de script auparavant ^^

J'y vois plus une utilité genre afficher un message perso, en rien niveau sécurité :) A la limite un compteur relié a ce script permettrait de savoir si votre site est dans le collimateur d'une institution (peut ptete servir pour les sites de streaming) :)
VOXPOPULI
Projets
 
Posts: 39
Joined: Sun Jan 23, 2011 11:54 pm

Postby SHEPSHEP » Mon Jan 09, 2012 9:25 am

[quote:947f47bd1c="VOXPOPULI"]je l'ai plus créé pour le fun qu'autre chose[/quote:947f47bd1c]
Dans ce cas, c'est une bonne chose de mettre en pratique ce que tu as pu voir en théorique, c'est comme ça que ça reste :wink:

C'est sympa de partager tes créa, faudrait que je m'y mette aussi :?
SHEPSHEP
Projets
 
Posts: 268
Joined: Wed Apr 08, 2009 11:14 am
Location: /dev/null


Return to Php

Who is online

Users browsing this forum: No registered users and 1 guest

cron