
🏰 AWS S3 버킷 열거를 위한 Python 스크립트.
Instacart의 @nickelser와 HackerOne에서의 대화에서 영감을 받아, Sandcastle을 최적화하여 공개했습니다. 이전에는 bucketCrawler로 알려졌던 AWS S3 버킷 열거 Python 스크립트입니다.
이 스크립트는 대상 이름을 줄기 인수(예: shopify)로 사용하고 아래와 같은 버킷 이름 변형 파일을 반복 처리합니다.
-training
-bucket
-dev
-attachments
-photos
-elasticsearch
[...]
시작하는 방법은 다음과 같습니다.
sandcastle.py를 실행하세요 (이 리포지토리에서 예시 파일을 가져오세요).usage: sandcastle.py [-h] -t targetStem [-f inputFile]
arguments:
-h, --help show this help message and exit
-t targetStem, --target targetStem
Select a target stem name (e.g. 'shopify')
-f inputFile, --file inputFile
Select a bucket permutation file (default: bucket-
names.txt)
____ __ __ __
/ __/__ ____ ___/ /______ ____ / /_/ /__
_\ \/ _ `/ _ \/ _ / __/ _ `(_-</ __/ / -_)
/___/\_,_/_//_/\_,_/\__/\_,_/___/\__/_/\__/
S3 bucket enumeration // release v1.2.4 // ysx
[*] Commencing enumeration of 'shopify', reading 138 lines from 'bucket-names.txt'.
[+] Checking potential match: shopify-content --> 403
An error occurred (AccessDenied) when calling the ListObjects operation: Access Denied
| 상태 코드 | 정의 | 비고 |
|---|---|---|
| 404 | 버킷 없음 | 분석 대상 아님 (기본적으로 숨김) |
| 403 | 접근 거부 | CLI를 통한 분석 가능 대상 |
| 200 | 공개 접근 가능 | CLI를 통한 분석 가능 대상 |
다음은 유용한 AWS CLI 명령어의 빠른 참조입니다.
aws s3 ls s3://bucket-nameaws s3 cp s3://bucket-name/<file> <destination>aws s3 cp/mv test-file.txt s3://bucket-nameaws s3 rm s3://bucket-name/test-file.txtAmazon 문서 Amazon S3 버킷 작업에서 발췌:
Amazon S3 [Simple Storage Service]는 인터넷용 클라우드 스토리지입니다. 데이터(사진, 동영상, 문서 등)를 업로드하려면 먼저 AWS 리전 중 하나에 버킷을 생성합니다. 그런 다음 버킷에 원하는 수의 객체를 업로드할 수 있습니다.
구현 측면에서 버킷과 객체는 리소스이며, Amazon S3는 이를 관리하기 위한 API를 제공합니다.