题目:
解题:
1:查看源码
按F12得到./Archive_room.php
2:尝试访问Archive_room.php
http://125b77e6-d671-4462-a920-4dab58668fd1.node4.buuoj.cn/Archive_room.php
3:点击按钮“SECRET”
跳转到页面:http://125b77e6-d671-4462-a920-4dab58668fd1.node4.buuoj.cn/end.php
什么信息都没有得到,提示回去再仔细看看。
4:返回Archive_room.php页面
按F12查看源码得到:action.php
5:尝试访问action.php页面
访问:http://125b77e6-d671-4462-a920-4dab58668fd1.node4.buuoj.cn/action.php
直接跳到了end.php页面。
6:用burpsuite抓包
查看action.php页面的反馈信息,得到secr3t.php。
7:尝试访问secr3t.php
访问:http://125b77e6-d671-4462-a920-4dab58668fd1.node4.buuoj.cn/secr3t.php
strstr()、stristr()
strstr()函数搜索字符串第一次出现的位置,并返回该字符串以及之后或之前的部分。
语法:strstr(string,search,before_search)
参数: string 被搜索的字符串
search 要搜索的字符串
before_search 默认为false,返回之后的部分,为true时,返回之前的部分。
例: strstr("I love Shanghai haha !","Shanghai"); 返回:Shanghai haha !
strstr("I love Shanghai haha !","Shanghai",true); 返回:I love Shanghai
stristr函数与strstr函数功能一样,只是strstr函数区分大小写,stristr函数不区分大小写。
所以传入的file参数不能含有:../、tp、input、data,但是提示flag放在了flag.php里。
8:用php://filter伪协议读取flag.php
php://filter原理请查看文章:https://blog.csdn.net/Ethan552525/article/details/118879824
构造payload:http://node4.buuoj.cn/secr3t.php?file=php://filter/read=convert.base64-encode/resource=flag.php
得到flag.php源文件的base64编码,利用burpsuite的Decoder板块,Decode as...设置为base64即可解码得到flag。