Huge Logistics, known for its global operations, has brought your team on board to scrutinize the integrity of their external defenses. They've pointed you towards an IP address that leads to their invoicing portal. Your assignment: rigorously test the website's security, then extend that scrutiny to any linked cloud infrastructure. Dive deep, expose vulnerabilities, and illustrate their potential consequences to help protect Huge Logistics against cyber threats.
题目提供的信息:13.50.73.5
nmap 端口扫描只扫到 80 端口,F12 看了下有桶

不过直接访问没有权限

直接目录爆破也爆破不出来啥~
访问个不存在的 URL

提示,网上搜一下,会发现是 flask 的错误提示
注册个账号,没有模板注入,功能上貌似只有导出 CSV

触发接口

尝试目录穿越

发现有个 ec2-user 用户,大概率是 AWS 的 EC2 实例
不过他不开放 SSH 端口,虽然能读,但好像没啥用
所以题目尝试爆破 shadow 密码其实也是没什么用的,不过这里记录一下
尝试读 AWS CLI 的凭证,但好像读不到啥
仔细看一下读
/etc/passwd 还有一个可登录用户 nedf读一下拿到 aksk

请求包
得到凭证
就可以请求桶拿到 flag 了
防御
WP 给了源码,导致目录穿越的原因是传入文件名直接拼接
如果用
send_from_directory 函数代替 send_file 就不会有目录穿越的问题了此外,查看端口监听,uWSGI 进程是以 root 启动的,如果使用非 root,就不一定能读到
nedf 用户的家目录
进一步阅读
- https://hackerone.com/reports/1415820 利用 Grafana 8.c 的漏洞进行任意文件读取,如果服务器刚好是 ec2 就能结合本题的姿势,其实不仅局限于 AWS,比如 GCloud、Azure、阿里云等都有可能存在这个问题,就看默认的目录是什么了,这也是一种传统漏洞的云上攻防漏洞危害升级~
