Keys to the Kingdom: How I Hacked a Fortune 500 Company Through Their Mobile App
Hardcoded AWS credentials and database credentials were found in a decompiled Android app. The attacker used the AWS keys to access S3 buckets and the database credentials to SSH into a production server.
infosecwriteups.com
Published on infosecwriteups.com
Free Link🎈
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, developers hardcoded sensitive credentials in the mobile app's source code and reused the same credentials across multiple services.
Impact
The attacker could read, write, and delete files in production S3 buckets, and gained SSH access to a production server, potentially compromising all user data.
What the attacker needed
Download the APK; No special access needed
The fix
Secrets should not be hardcoded; use secure storage like AWS Secrets Manager or environment variables, and use different credentials per service.
How it was found
- Downloaded the Android APK from a mirror site.
- Unpacked the APK and decompiled the code using dex2jar and JD-GUI.
- Searched the decompiled code for secret patterns using grep.
- Found hardcoded AWS credentials and database credentials.
- Used the AWS credentials to list S3 buckets and enumerate permissions.
- Used the database credentials to SSH into a production server.
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.
The app contained secret passwords and keys written directly in its code. Anyone who downloads the app can extract these secrets and use them to access the company's cloud storage and servers.
What is Leaked secrets?
Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.