Lab 3 : Source code disclosure via backup files
Just nowLab ObjectiveThe goal of this lab is to locate leaked backup files and extract a hard-coded 2026-7-17 07:5:38 Author: infosecwriteups.com(查看原文) 阅读量:7 收藏

Zeyad Naguib

Just now

Lab Objective

The goal of this lab is to locate leaked backup files and extract a hard-coded database password from the disclosed source code.

Step-by-Step Solution

1. Check robots.txt for hidden paths

robots.txt is designed to tell search engine crawlers which paths not to index :

/robots.txt

revealed a disallowed /backup directory.

Press enter or click to view image in full size

2. Enumerate the backup directory

Browsing directly to /backup surfaced a file named:

Get Zeyad Naguib’s stories in your inbox

Join Medium for free to get updates from this writer.

Remember me for faster sign in

ProductTemplate.java.bak

Press enter or click to view image in full size

3. Retrieve and read the leaked source file

Navigating to:

/backup/ProductTemplate.java.bak

4. Extract the hard-coded credential

Reading through the disclosed source, the database connection logic contained a hard-coded password used to authenticate against a Postgres database.

Press enter or click to view image in full size

5. Submit the solution

I copied the password value, returned to the lab, clicked Submit solution, and entered it. The lab was marked as solved.

Press enter or click to view image in full size

Written by Zeyad Naguib,
🔗 https://www.linkedin.com/in/zeyadnageeb
✍️ https://medium.com/@zeyadnaguib1


文章来源: https://infosecwriteups.com/lab-3-source-code-disclosure-via-backup-files-54b056ee6d36?source=rss----7b722bfd1b8d---4
如有侵权请联系:admin#unsafe.sh