-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaws_s3_enum.sh
More file actions
70 lines (62 loc) · 3.83 KB
/
Copy pathaws_s3_enum.sh
File metadata and controls
70 lines (62 loc) · 3.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/bash
# Faster version - skip log buckets, limit 100 files per bucket
# Colors
CYAN='\033[0;36m'
YELLOW='\033[1;33m'
GREEN='\033[0;32m'
NC='\033[0m'
OUTPUT_FILE="/path/to/save/s3_quick_enum.txt"
# Banner
echo -e "${CYAN}"
cat << 'EOF'
┌─────────────────────────────────────────────────────────────┐
│ │
│ ███████╗██████╗ ███████╗███╗ ██╗██╗ ██╗███╗ ███╗ │
│ ██╔════╝╚════██╗ ██╔════╝████╗ ██║██║ ██║████╗ ████║ │
│ ███████╗ █████╔╝ █████╗ ██╔██╗ ██║██║ ██║██╔████╔██║ │
│ ╚════██║ ╚═══██╗ ██╔══╝ ██║╚██╗██║██║ ██║██║╚██╔╝██║ │
│ ███████║██████╔╝ ███████╗██║ ╚████║╚██████╔╝██║ ╚═╝ ██║ │
│ ╚══════╝╚═════╝ ╚══════╝╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ │
│ │
└─────────────────────────────────────────────────────────────┘
EOF
echo -e "${YELLOW}"
cat << 'EOF'
╔═══════════════════════════════════╗
║ 🪣 S3 Bucket Quick Enumerator ║
║ 📦 Recursive File Listing ║
╚═══════════════════════════════════╝
⠀⠀⠀⠀⢀⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⡀
⠀⠀⠀⠀⣿⠀ 🔓 BUCKET ACCESS ⠀⣿
⠀⠀⠀⠀⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿
⠀⠀⠀⠀⣿⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣤⣿
⠀⠀⠀⠀⠈⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠈
EOF
echo -e "${NC}"
echo "S3 Quick Enumeration - $(date)" > "$OUTPUT_FILE"
echo -e "${GREEN}[+] Starting S3 enumeration...${NC}"
for bucket in $(awk '{print $3}' /path/to/s3_buckets.txt); do
# Skip known log/audit buckets
case "$bucket" in
*cloudtrail*|*awslog*|*macie*|*flowlog*|*access-log*|*AWSLogs*)
echo "Skipping log bucket: $bucket"
continue
;;
esac
echo "Processing: $bucket"
{
echo ""
echo "=========================================="
echo "BUCKET: $bucket"
echo "=========================================="
aws s3 ls "s3://$bucket" --recursive 2>&1 | head -100
} >> "$OUTPUT_FILE"
done
echo -e "${GREEN}"
cat << 'EOF'
╔═══════════════════════════════════════════════════════════╗
║ ✅ S3 ENUMERATION COMPLETE ║
╚═══════════════════════════════════════════════════════════╝
EOF
echo -e "${NC}"
echo -e "${GREEN}[✓] Done! Results saved to: $OUTPUT_FILE${NC}"