吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 1374|回复: 3
收起左侧

[求助] 怀疑php含有后门,请大神分析下

[复制链接]
sunda 发表于 2020-12-3 18:43
[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[rand(0,15)].$array_for_nom[rand(0,15)].$array_for_nom[rand(0,15)].$array_for_nom[rand(0,15)].$array_for_nom[rand(0,15)]; 
		 $_SESSION['variable_du_form'] = str_shuffle($nom_form).$array_for_nom[rand(0,15)].$array_for_nom[rand(0,15)];

		 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[rand(0,15)].$array_for_nom[rand(0,15)].$array_for_nom[rand(0,15)].$array_for_nom[rand(0,15)].$array_for_nom[rand(0,15)]; 
			 $_SESSION['variable_du_form'] = str_shuffle($nom_form).$array_for_nom[rand(0,15)].$array_for_nom[rand(0,15)]; 

			 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();
	 }
 }
 ?>

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

BEIMOTING180 发表于 2020-12-3 20:21
真的可以吗
星耀蓝优 发表于 2020-12-3 23:48
Reheart 发表于 2020-12-4 02:28
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-11-26 10:03

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表