Skip to content
Leaked secrets Write-up Beginner

How I Found Aws Api Keys Using Trufflehog And Validated Them Using Enumerate Iam Tool

A website's JavaScript source code exposed both an AWS access key and secret key in plain text. The author validated the keys with a tool and found they granted only basic account information, with no further impact.

Satya Prakash Follow

Published on infosecwriteups.com

I started Bug hunting somewhere after the summer in 2022 due to my interest in it.

Satya Prakash, on infosecwriteups.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely, the AWS credentials were hard-coded in client-side JavaScript that was publicly accessible.

Impact

The exposed keys could allow an attacker to access the AWS account, but in this case they only provided basic information with no useful impact.

What the attacker needed

Trufflehog browser extension installed; Target website with exposed keys

How it was found

  1. Install the Trufflehog browser extension.
  2. Visit a target website with the extension active.
  3. Note the pop-up alerting to AWS API keys and the path where they are found.
  4. Open the indicated path and locate the AWS access key and secret key in the source.
  5. Run the enumerate-iam tool against the leaked keys to validate them.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

Websites often include JavaScript files that run in your browser. Sometimes developers accidentally leave secret passwords, called API keys, inside that code. Here, both an AWS access key and secret key were visible, which could let someone use the website owner's cloud account, but in this case the keys only allowed reading basic account details.

What is Leaked secrets?

Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.

More by Satya Prakash

View all

5 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Leaked secrets and credentials

The lesson behind this report.

Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.