type
status
date
slug
summary
tags
category
icon
password
今年红帽杯好像难度比往年友好了不少 (
find_it
目录爆破 > robots.txt >
1ndexx.php
> 尝试常见信息泄漏得 .1ndexx.php.swp
写入
phpinfo
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F59399f38-e742-45ab-b4bd-79d749df252f%2FUntitled.png?table=block&id=a6e382a0-6a76-48b8-8f69-59597fc0b6fe&t=a6e382a0-6a76-48b8-8f69-59597fc0b6fe&width=1500&cache=v2)
访问
hack.php
在 phpinfo
页面搜索 flag
关键字即可![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F0593d40a-31c0-4b31-9d0b-b016b4d871ca%2FUntitled.png?table=block&id=23bdaffe-96d8-4b81-a8c3-2365c3c06038&t=23bdaffe-96d8-4b81-a8c3-2365c3c06038&width=1500&cache=v2)
framework
目录爆破得源码
www.zip
看网页源码和源码易知框架为
Yii2
找控制器,
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F50bac56f-25db-44e5-aee8-b115c5031725%2FUntitled.png?table=block&id=e285f335-9188-4416-9140-ead268bae246&t=e285f335-9188-4416-9140-ead268bae246&width=1500&cache=v2)
刚好之前复现了一点 yii2 的反序列化,不过没详细分析
不过知道控制点在
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F0548f143-c237-4948-8bbf-4263cc6001f7%2FUntitled.png?table=block&id=00de862a-62c9-4ba3-87f6-b9648d86a4ab&t=00de862a-62c9-4ba3-87f6-b9648d86a4ab&width=1500&cache=v2)
即通过 call_user_func 调用函数,找个POC,有兴趣可以看看分析过程,传送门
Yii2
的控制器路由说明(即 index.php?r=site/about&message=
部分)可参考构造 EXP
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F8190825e-eb4c-4860-89eb-c93a3c4a2d9b%2FUntitled.png?table=block&id=3822fc6b-d520-4ade-b753-a95beec0cbda&t=3822fc6b-d520-4ade-b753-a95beec0cbda&width=1500&cache=v2)
搜了下发现有
disable function
禁用了这些函数虽然没有过滤
eval
但 call_user_func
第一个参数只能为回调函数,试了很久,发现 assert
可用,于是构造POC。写入一句话,连接
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F4c10b512-3b6a-4945-a3f8-a337e4fac719%2FUntitled.png?table=block&id=f3674bd1-6656-4227-98a5-1a32f0c8f9c3&t=f3674bd1-6656-4227-98a5-1a32f0c8f9c3&width=1500&cache=v2)
因为有
disable function
限制执行命令,因此需要bypass尝试常用bypass 方法
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fa2ac5853-aa8f-4c12-9e22-34f7ceceeae4%2FUntitled.png?table=block&id=218849f0-67a5-4036-bb99-8afc880dbb97&t=218849f0-67a5-4036-bb99-8afc880dbb97&width=1232&cache=v2)
无效,然后下面链接有一些姿势没来得及试,等复现出来可以试试
坐等其他师傅WP (
5月12日更新
然后绕过 disable function 的方法是
Apache_mode_cgi
,晚些搭环境看看为啥比赛时我没法成功绕过的..WebsiteManger
注入点在
image.php
二分法时间延迟注入
脚本来自 Challenger 师傅
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F9953e4f1-155a-47f8-95d0-a3c64c6bcb5a%2FUntitled.png?table=block&id=c093d2fd-d686-4a14-9a73-55fbafa526a4&t=c093d2fd-d686-4a14-9a73-55fbafa526a4&width=688&cache=v2)
使用
admin
和 密码
登录后 SSRF
即可![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F2721380b-4dc0-4662-a287-6d29bc95abe0%2FUntitled.png?table=block&id=74217bf0-0fb2-491d-863f-07cad5b813d8&t=74217bf0-0fb2-491d-863f-07cad5b813d8&width=1500&cache=v2)
5月12日更新
看到有人说
modify.php
是可以未授权访问的…ezlight
还没看。。。撇了一眼源码,好像是 Laravel?出题人怕不是在 ctfshow 出题的。。
一个 Yii2 一个 Laravel。。。
5月12日更新
晚点如果有环境就复现吧(
总结
emm,不知怎么回事,第一题一开始访问
.1ndexx.php.swp
竟然没反应,当然还试了 gedit
的 xx~
,佛了第二题,,一开始
assert
用不了,说什么参数不能是可控的,后面又行了,,这中间找函数和尝试浪费了好多好多时间。。。导致后面绕过 disable function 时间不够。第三题,总体难度不大 (逃
反思:
虽然之前看了很多 disable function bypass 的文章,但是没动手做过,不够熟练,
把常用 disable function bypass 过一遍
刷了部分然后一直在吃灰的 sqli-labs 是时候理理了…