Secure S3 with Amazon Macieb
| 2024-6-25
字数 1038阅读时长 3 分钟
Amid the undercurrents of the dark web, chatter is growing louder: Huge Logistics might be the next big target. Forensic traces hint at advanced adversaries conducting OSINT and mapping out their digital terrain. Hearing the whispers, the higher-ups at Huge Logistics are starting to sweat. They've reached out to your team to assess Huge Logistics' cloud security posture, starting with S3. Your primary tool for this mission: Amazon Macie. Your tasks are multi-fold: learn how to set up and configure Amazon Macie in order to discover and classify the company's crown jewels, and unearth any sensitive data in the deployed S3 data estate. The clock is ticking, and every piece of data could be a potential way in for threat actors.
题目提供的信息:
https://243687662613.signin.aws.amazon.com/console 用户名密码:macie-user/K33pTh0seBuck3tsS3cure!
Note: the flag for this lab is the name of the S3 bucket that is an MD5 hash.
 
Amazon Macie 是一个托管的数据安全和隐私服务,用于发现账户存在的公开桶以及里面的敏感信息,偏主动防御的产品
 
收费模式有两种,根据需要评估的数据量和发现的敏感数据量,前30天免费试用
 
先来看看 Macie 怎么创的,登录自己号,打开 Macie,开始使用 → 启用 Macie
 
开始使用 → 分析公有存储桶 → 指定存储桶条件 → 下一个 → 下一个 → 一次性作业 → 下一个 → 选 推荐 → 下一个 → 下一个 → 下一个 → 作业名称 随便填个 → 下一个 → 提交
notion image
 
接着配置存储库
notion image
 
创建新密钥
notion image
 
notion image
 
随便写个名
notion image
后面全部直接下一步即可,最后完成
 
然后回到 macie 这,选择刚刚的密钥,然后点击查看策略
notion image
 
把内容复制到 kms 刚刚创建的密钥策略 Statement 里
notion image
 
然后回到 macie 这点保存,就可以了
 
notion image
 
这时我们登录题目账号,注意区域是 eu-west-2 (London)
notion image
这里没有 Public world writeable,也就是不是所有人可写,还好,不然别人就能随便改桶内容了
 
有个显眼的 Sensitive 1,点进去,点小箭头,有个 AWS 凭证泄漏,不知为啥点进去没东西,点 Object samples 就可以看到一个脚本了
notion image
 
访问
notion image
 
发现硬编码的 aksk 和 region
notion image
 
接下来是用题目提供的 aksk 进行 Macie 的 CLI 操作,region eu-west-2 AKIATRPHKUQKWEPSZKMW / gWNZLtjx8/lnxlqh4fEW/tWFZX/w2OjbiWkuJbgE
 
如果是特权账户,可以通过 aws macie2 enable-macie 启用 Macie,不过这个 aksk 已经开启了
 
以是否公开维度查询桶,有 4 个
到这里 flag 已经可以拿到了,就是这个 md5 桶的名字
 
查询是否有公开可写的桶,不过没有
 
不知为啥我这里没有找到 findingIds
 
后面的操作直接摘要一下吧
 
查看特定 findings 的存储对象资源
 
查看所有 findings 的存储对象资源
 
查看包含 Credentials 的存储对象
 
查看包含 Credentials 的存储对象,并以 json 格式显示(自动去重)
 
把所有 Macie 认为敏感资源的内容下载到本地
Loading...
目录