任意文件下载(Arbitrary File Download)是一种常见的 Web 攻击技术,用于窃取服务器上任意文件的内容。攻击者利用应用程序中的漏洞,通过构造恶意请求,使应用程序将任意文件(如配置文件、敏感数据等)发送给攻击者。一旦攻击者成功利用这种漏洞,就可以从服务器上获取应用程序所拥有的任意文件,并且可以获取到这些文件的敏感信息
在日常的渗透中,看到下载功能是可以去看一下有没有该漏洞的,利用下载获取源码或数据库配置文件及系统敏感文件为后续出思路 在日常渗透中,应该注重前台的每个功能点,最好做个Checklist
0x01 任意文件下载
1. 进行测试
在本次渗透中
首页->资料下载->公共资料 去点击该功能进行测试

2. 发现敏感路径
看到此链接,感觉很有机会,继续尝试

3. 尝试下载 index.php
发现成功下载,嘿嘿去找找 ThinkPHP 数据库配置文件在哪先

4. 尝试下载数据库配置文件
先去百度一下,ThinkPHP3.2的目录结构

最终在/Application/Common/Conf/目录下找到了数据库配置文件
/Application/Common/Conf/config.php

0x02 尝试连接数据库
5. 获取数据库账号密码
好,数据库账号密码到手,接下来看看端口开放在外网没有

发现数据库端口开在外网

6. 连接数据库
成功连上数据库

7. 查看管理员账号密码
这个 MD5 只能看一眼,多看一眼就是123456


0x03 寻找后台
8. 寻找后台
好,后台管理员账号密码都有了,那么后台呢。。。
目录扫描没扫出来,前台仔细找找也没有
那时候卡了我好久。。。。。。
9. 细心决定成败
再回到那个数据库配置文件,找到那个被忽视的神秘路径。。
原来它一直在这里等我,是我忽视它了
成功找到后台

0x04 有手就行文件上传
10. 进入后台后寻找功能点

11. 记住该分类

12. 上传 Webshell
抓包直接把jpg修改php就可以上传成功,但是没有回显

13. 成功 Getshell
在前台找到自己刚刚上传选择的分类,复制下载链接,即可得到Webshell地址


收工!