╚═════╝   ╚═╝   ╚═╝         ╚═════╝    ╚═╝   ╚═════╝ ╚═╝  ╚═╝╚══════╝╚══════╝

PHP CTF Bypass Training Ground

preg_replace 替换绕过 · file_get_contents / include 文件包含 · PHP 弱类型 专项训练

🏁 通关进度:0 / 8 剩余 8 关
1 2 3 4 5 6 7 8

Module 5: php://input 伪协议绕过

📋 GET: file, page + POST body 难度: ⭐⭐⭐ 分类: include
考点:php://input 伪协议 + POST 原始数据读取 + 协议过滤绕过
核心逻辑:
preg_match('/http|data/', $file) → 拦截 http 和 data 协议
file_get_contents($file) 读取内容须等于 'ctf'
提示:php://input 读取 HTTP 请求的原始 POST body,不被 http/data 过滤拦截。需用 curl 发送 -d 参数。
⚠️ 注意:本题需要配合 POST 原始数据(raw body),HTML 表单无法直接发送。请使用 curl:
💡 curl 解题命令: curl "http://localhost:8080/index.php?module=5&file=php://input&page=flag.php" -d "ctf"