Execute and Identify Credential Abuse in AWSb
| 2024-7-14
0  |  阅读时长 0 分钟
Field
RedTeam
Intermediate
Free
Tags
hash cracking
john
s3
dynamodb
vim
macro
cloudtrail
athena
credential stuffing
Status
Done
During your routine audit for Huge Logistics, you've come across an unsecured S3 bucket. Your task for the day: Dive into the bucket's contents and scrutinize it. If you stumble upon any sensitive data, document them and use them as pivots to understand the broader security posture of Huge Logistics' cloud environment. Your goal is to determine the risk exposure of this open bucket and gain access to other connected systems.
题目提供的信息:S3 bucket hl-storage-general
 
真实场景:凭证复用
 
这个桶版本就是只有当前看到的,拉下来
 
这个貌似是 asana 工作软件的对话记录,然后 notes 字段是对话内容,在商量从本地迁移上云的事,在第12个 notes 中提供了一个 AKSK
 
aws-enumerator 枚举一下这个账户的权限
 
查看 endpoint
 
其他三个返回空,先看一下桶的 region
 
原来是我这里保留了上一题的 region,aws configure 重新配置一下 region
其他两个还是返回空,不过起码这个有数据了
 
查看 analytics_app_users 表,另一个没权限看不了
ItemCount 有 51条数据
 
查看数据
 
貌似是用户名和密码表,主要关注的数据字段是 UserIDPasswordHash,先看看密码 hash 类型,hashid 小工具
 
比较有可能是 SHA-256
 
提取数据库查询的舒适,并把 UserID 和 PasswordHash 变为 用户名:密码 的形式
运行,复制粘贴结束后按 ctrl+d 结束输入
 
不知为啥 brew 安装的 john 不行
 
编译安装倒是没问题
 
破解
 
查看用户名对应密码
 
 
账户密码分开两个文件
 
查看账户id
 
开喷,爆破出来了一个
 
刚刚还有一个数据库是看不了的,前往 DynamoDB 服务看看
notion image
 
在该表找到 flag
notion image
 
防御
  1. 罪魁祸首是公开桶,可以查看其他WP防御部分参考规避,比如 防御S3 Bucket Brute Force to Breach)
  1. SHA256 没有加盐
  1. 密码喷洒其实在 CloudTrail 是能检测出来的,因为带来大量的登录失败日志
  1. 此外 IAM 用户没有启用 MFA
  1. IAM 用户密码策略有待提升,比如长度、密码组成等
  1. 通过 Athena 查看控制台登录的异常成功行为
然后马上撤回访问、修改 IAM 用户密码、轮换 IAM 密钥、审计账户和根因溯源、使用 MFA、审计 CloudTrail 日志、回滚异常修改、检查其他账、审计 IAM 策略、检查新增资源
 
进一步阅读
  1. https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-63b.pdf 可以查看 NIST 关于加盐 hash 的指南
  1. https://www.theregister.com/2021/10/25/nobelium_russia_svr_msp_warning_microsoft/ 披露了针对 MSP(托管服务提供商)、云经销商的攻击增加了两倍,其中密码喷洒是其中一种方式
Loading...
目录