thinkphp5框架:

thinkphp5的入口文件在publicindex.php,访问
http://192.168.64.105/thinkphp_5.0.24/public/index.php

写一个反序列化入口点

全局搜索__destruct()函数

hinkphp_5.0.24 hinkphplibrary hinkprocesspipesWindows.php中的__destruct()函数,调用了removeFiles()

跟进removeFiles(),第163行的file_exists可以触发__toString方法

全局搜索__toString方法
在thinkphplibrary hinkModel.php的第2265行,发现其调用了toJson方法

跟进toJson,发现其调用了toArray()方法(在Model.php中)

跟进toArray,发现其有三处可以调用__call方法(就是整一个可以控制的类对象,然后让其调用该类不存在的方法,然后触发__call魔术方法)
__call(),在对象中调用一个不可访问方法时调用。

着重看第三处,也就是第912行,这个需要我们控制$value变量
这个 v a l u e 变量是根据 ‘ value变量是根据 ` value变量是根据‘value = t h i s − > g e t R e l a t i o n D a t a ( this->getRelationData( this−>getRelationData(modelRelation);`而来的
跟进getRelationData方法,注意参数$modelRelation需要是Relation类型的,该方法也是thinkphplibrary hinkModel.php中定义的

如果我们让if满足,那么$value=$this->parent,看三个条件