漏洞原理在《劫持亚马逊S3 Bucket》一文中已经分析的很透彻了,这里就不再赘述,链接如下:
https://articles.zsxq.com/id\_koruae6lrsw9.html
https://blog.securelayer7.net/hands-on-aws-s3-bucket-account-takeover-vulnerability/
本文主要对国内主流的阿里云Bucket劫持利用姿势进行总结
FOFA语法
精准检索:
body="NoSuchBucket" && body="BucketName" && body="aliyuncs.com"
粗略检索
body="NoSuchBucket" && body="BucketName"

打开 http://target/,泄露了BucketName以及HostID

后续会用到的信息整理如下
HostId:abc.oss-cn-beijing.aliyuncs.com
BucketName:abc
打开OSS浏览器

输入你的AccessKeyId和AccessKeySecret,其他参数保持默认即可,登录到OSS管理后台

点击“新建Bucket”

输入Bucket名称,选择Bucket所在区域(HostId中有标记),确定

Bucket创建成功,点击Bucket名称,进入文件目录

此时的Bucket中还是空的,我们点击“文件”按钮,上传index.html文件

点击“打开”,index.html文件上传成功,并显示在页面中

index.html代码如下
<!doctype html>
<html lang="zh">
<head>
<title>Bucket Takeover Test</title>
</head>
<body>
<h1>The Website is takeover by laraveek</h1>
</body>
</html>
勾选index.html文件,点击“更多”,点击“ACL权限”

设置权限为“公共读”,点击“确定”

此时,我们访问 http://target/index.html

Bucket接管成功!
此时再访问 http://target/

已经不再显示 NoSuchBucket 了
本文迁移自知识星球“火线Zone”