<?php
highlight_file(__FILE__);
class ease{
private $method;//私有变量
private $args;
function __construct($method, $args) {//创建对象
$this->method = $method; //赋值
$this->args = $args;
}
function __destruct(){ //析构函数,当对象的引用都被删除或对象都没被引用时执行
if (in_array($this->method, array("ping"))) {//判断method是否为ping
call_user_func_array(array($this, $this->method), $this->args);//ping命令
}
}
function ping($ip){//执行ping
exec($ip, $result);//返回结果和类型
var_dump($result);
}
function waf($str){
if (!preg_match_all("/(\||&|;| |\/|cat|flag|tac|php|ls)/", $str, $pat_array)) {//黑名单过滤
return $str;
} else {
echo "don't hack";
}
}
function __wakeup(){ //序列化后调用
foreach($this->args as $k => $v) {//数组遍历
$this->args[$k] = $this-&
攻防世界--unseping(反序列化)
于 2023-05-22 14:16:06 首次发布