怀疑php含有后门,请大神分析下
<?php
/*
* Anti DDOS PHP Script
* By S@n1X D4rk3r
* power by www
*/
// if you'r working on your local machine, you can add these conditions
//and getenv(" HTTP_CLIENT_IP ") != '127.0.0.1'
//and getenv(" HTTP_X_FORWARDED_FOR") != '127.0.0.1'
function getFromfile_source($type){
$ad_check_file = 'check.txt';// file to write the current state during the monitoring
$ad_all_file = 'all_ip.txt';// temporary file
$ad_black_file = 'black_ip.txt';// will be entered into a zombie machine ip
$ad_white_file = 'white_ip.txt';// ip logged visitors
$ad_temp_file = 'ad_temp_file.txt';// ip logged visitors
$ad_dir = 'anti_ddos/files';// directory with scripts
if($type == "black"){
return explode(',', implode(',',file("{$ad_dir}/{$ad_black_file}")));
}else if($type == "white"){
return explode(',', implode(',',file("{$ad_dir}/{$ad_white_file}")));
}else{
return explode(',', implode(',',file("{$ad_dir}/{$ad_temp_file}")));
}
}
$ad_ip = "";
if(getenv("HTTP_CLIENT_IP") and preg_match("/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\z/", getenv(" HTTP_CLIENT_IP "))) {
$ad_ip = getenv("HTTP_CLIENT_IP");
} elseif(getenv("HTTP_X_FORWARDED_FOR") and preg_match("/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\z/", getenv(" HTTP_X_FORWARDED_FOR "))) {
$ad_ip = getenv("HTTP_X_FORWARDED_FOR");
}
else { $ad_ip = getenv("REMOTE_ADDR"); }
$ad_source = getFromfile_source('black');
if(in_array($ad_ip, $ad_source)) {die();}
$ad_source = getFromfile_source('white');
if(!in_array($ad_ip, $ad_source)) {
$ad_source = getFromfile_source('temp');
if(!in_array($ad_ip, $ad_source)) {
$_SESSION['nbre_essai']=3;
$ad_file = fopen("{$ad_dir}/{$ad_temp_file}", "a+");
$ad_string = $ad_ip.',';
fputs($ad_file, "$ad_string");
fclose($ad_file);
$array_for_nom = array('maN','bZ','E','S','i','P','u','1','4','Ds','Er','FtGy','A','d','98','z1sW');
$nom_form = $array_for_nom.$array_for_nom.$array_for_nom.$array_for_nom.$array_for_nom;
$_SESSION['variable_du_form'] = str_shuffle($nom_form).$array_for_nom.$array_for_nom;
include('Verify_your_identity.php');
die();
}
elseif(isset($_POST[$_SESSION['variable_du_form']]) AND $_SESSION['nbre_essai']>0){
$secure = isset($_POST['valCAPTCHA']) ? ($_POST['valCAPTCHA']) : '';
if ($secure == $_SESSION['securecode']){
$ad_file = fopen("{$ad_dir}/{$ad_white_file}", "a+");
$ad_string = $ad_ip. ',';
fputs($ad_file, "$ad_string");
fclose($ad_file);
unset($_SESSION['securecode']);
unset($_SESSION['nbre_essai']);
}else{
$_SESSION['nbre_essai']--;
$array_for_nom = array('maN','bZ','E','S','i','P','u','1','4','Ds','Er','FtGy','A','d','98','z1sW');
$nom_form = $array_for_nom.$array_for_nom.$array_for_nom.$array_for_nom.$array_for_nom;
$_SESSION['variable_du_form'] = str_shuffle($nom_form).$array_for_nom.$array_for_nom;
include('Verify_your_identity_LASTCHANCE.php');
die();
}
}
else {
$ad_file = fopen("{$ad_dir}/{$ad_black_file}", "a+");
$ad_string = $ad_ip.',';
fputs($ad_file, "$ad_string");
fclose($ad_file);
die();
}
}
?>
真的可以吗
没头没尾... 要贴就全贴出来呀
页:
[1]