CG CTF WEB file_get_contents
生活随笔
收集整理的這篇文章主要介紹了
CG CTF WEB file_get_contents
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
http://chinalover.sinaapp.com/web23/
題意:get一個(gè)file參數(shù)到file_get_contents()函數(shù)里,如果返回為指定字符串,就得到了flag。
<!--$file = $_GET['file']; if(@file_get_contents($file) == "meizijiu"){echo $nctf; }-->題解:
工具:Burp Suite
原理:
file_get_contents()函數(shù),而這個(gè)函數(shù)是可以繞過(guò)的
繞過(guò)方式有多種:
- ?使用php://input偽協(xié)議繞過(guò)
① 將要GET的參數(shù)?xxx=php://input
② 用post方法傳入想要file_get_contents()函數(shù)返回的值
- ?用data://偽協(xié)議繞過(guò)
將url改為:?xxx=data://text/plain;base64,想要file_get_contents()函數(shù)返回的值的base64編碼
或者將url改為:?xxx=data:text/plain,(url編碼的內(nèi)容)
步驟:
抓包
改包
注意:
而不是?
?
總結(jié)
以上是生活随笔為你收集整理的CG CTF WEB file_get_contents的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: CG CTF WEB 上传绕过
- 下一篇: CG CTF WEB 密码重置2