Directory Listing Vulnerability Leading to Information Disclosure and Full Database Access on an Medical Service International Website
An exposed vendor directory on an Apache server allowed directory listing, and it contained a large Laravel log file with a database connection error that revealed the database username and password. The attacker used these credentials to gain full access to the databases on the SQL server.
Published on waleedosamaeg.medium.com
Hey there, welcome back to another adventure in the world of hacking! In this write-up, I’ll show you how I managed to sneak into the database of a medical website just by exploiting a little oopsie in the Apache server — yep, good old directory listing vulnerability.
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 Apache server had directory listing enabled for the vendor folder, and a Laravel log file containing database credentials was stored inside that publicly accessible folder.
Impact
The attacker could access the full databases on the SQL server, which could lead to data theft or modification, though the text does not specify what data was present.
What the attacker needed
None
How it was found
- Scan the website with a tool to find hidden files and folders.
- Discover that the vendor folder is accessible and lists its contents.
- Download the entire vendor folder to a local machine.
- Search the downloaded files for log files and find a large Laravel log.
- Search the log for SQL errors and find a database connection error that includes the username and password.
- Use the credentials to connect to the MySQL server and access the databases.
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.
A directory listing means the web server shows a list of files in a folder instead of a normal web page. Here, a folder that should have been private was visible, and it held a log file that accidentally recorded the database username and password. With those, someone could log in to the database and see or change everything.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.