Skip to content
RCE Write-up Beginner

RCE via Internal Access to Adminer Database Management (Critical)

An Adminer database management panel was exposed with default credentials, allowing the attacker to log in and access the internal database. The attacker could then manipulate the database, potentially leading to remote code execution.

Ahmad Halabi Follow

Published on infosecwriteups.com

Bounty$3,000 View original

My name is Ahmad Halabi, I do bug bounty hunting on my free time. I mainly hunt on HackerOne.

Ahmad Halabi, 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.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 4 min read.

Context

While hunting on a public bug bounty program, Ahmad Halabi found a subdomain, remoteservices.target.com, that looked like it should hold something interesting. The host itself returned nothing useful, but a directory underneath it exposed an Adminer login panel. Adminer is a database management tool that allows connecting to and managing different database management systems such as MySQL and Oracle. The panel accepted default credentials, and successful login gave access to the company's internal database, leading to Remote Code Execution.

Setup

The researcher was hunting on a public program on HackerOne. The only tool named in the write-up is FFUF, used for directory brute forcing. No versions, headers or authentication state are described beyond the credentials found later.

Finding it

Browsing https://remoteservices.target.com returned a 404 with nothing found in the response. The researcher treats a 404 Not Found as a sign that something may be hidden on the site, and the recommended next move is directory brute force and enumeration.

On wordlists, the write-up is explicit that no single list is used. The choice depends on the target: an IIS server calls for a wordlist containing IIS directories and files, an Apache server for one containing Apache directories and files, and so on for any target. The researcher keeps multiple wordlists and edits them whenever a new interesting directory or file path turns up, which is how the recon is optimised to be faster and more accurate.

FFUF was run against the subdomain's directories and returned an interesting 403 Forbidden for the admin directory at https://remoteservices.target.com/admin.

403 Forbidden Response From the original on infosecwriteups.com

The screenshot shows the 403 Forbidden response for that directory. A Forbidden response is read here as a sign that there is hidden content or a section the owner does not want visitors to see or access.

Exploitation

Step 1: Brute force inside the forbidden directory

The first idea was to brute force the admin directory as well. That produced an Adminer login panel at https://remoteservices.target.com/admin/adminer.php.

Adminer Login From the original on infosecwriteups.com

The screenshot shows the Adminer login panel reached at that path.

Step 2: Look for a known vulnerability

The researcher first searched for CVEs and known exploits matching the version number identified by the Adminer login panel. This produced no luck.

Step 3: Look for leaked credentials

Next, the target program's GitHub repository was checked for exposed credentials pointing to the Adminer login panel. Nothing interesting was found there either.

Step 4: Try default and common credentials

Finally, the researcher searched Google for default Adminer login credentials and for credentials commonly used with Adminer login. The results were useful. After trying them all out over about two hours, access to the company's internal database succeeded, leading to Remote Code Execution with the ability to manipulate the database.

The credentials that worked were:

Root cause

The panel was reached through a login form that accepted a well known default pair. The write-up frames the underlying problem generally: some well known companies still use default credentials or credentials that can be easily guessed, and this sometimes leads to critical issues that could cause harmful damage if discovered by criminals instead of ethical hackers. The report does not describe any rate limiting, account lockout or additional authentication in front of the login.

Impact

Successful login gave the researcher access to the internal database of the company, leading to Remote Code Execution, with the ability to manipulate their database. The write-up does not enumerate which database system was behind the panel or what data it held.

Fix

The program immediately removed access to the target website, then fixed the issue and changed the credentials. The broader lesson in the write-up is to stop relying on default or easily guessed credentials, since they can turn into critical issues.

Report timeline

Date Event
Sep 17, 2020 Initial report
Oct 18, 2020 Report resolved and bounty awarded
From the original on infosecwriteups.com

Variants to test

  1. Forbidden directories with content one level deeper. When a directory answers 403, brute force inside it rather than stopping. A positive result is a reachable file such as a login panel or management script under the forbidden path.
  2. Database management panels on forgotten subdomains. Enumerate subdomains and look for Adminer, phpMyAdmin and similar tools. A positive result is a login form for a database tool on a host that is not part of the main application.
  3. Default credential pairs. Search for default and commonly used credentials for the specific product and try them against the login form. A positive result is a session that reaches the database management interface.
  4. Version fingerprinting before exploitation. Identify the version shown by the login panel and check for matching CVEs and public exploits. A positive result is a version with a known issue that is actually exploitable on the host.
  5. Credential leaks in public repositories. Check the program's GitHub repositories for credentials that point at internal tooling. A positive result is a working username and password for a panel found during recon.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 8 min read.

What happened, in plain words

A security researcher was taking part in a bug bounty programme, which is a scheme where companies invite independent testers to look for weaknesses in their systems and pay them for reporting what they find. While looking around, he found a web address (a subdomain) that seemed to be hiding something. The front page of that address showed nothing useful, but by guessing the names of folders that might exist on the server, he found a folder called admin that the server refused to show him. That refusal is a clue: it means there is something there. He then guessed names of files inside that folder and found a login page for a tool called Adminer, which is used to manage databases. The login page accepted a very common default username and password. Once inside, he had access to the company's internal database, leading to Remote Code Execution, where he could manipulate their database. The company fixed the problem and awarded a bounty.

This article walks through the same steps in the same order, explaining every term as it appears. You only need to know how to use a browser and a computer.

Overview

The researcher was hunting on a public bug bounty programme on HackerOne, a platform where such programmes are listed. He found a subdomain, remoteservices.target.com. A subdomain is a prefix added to a main domain name; for example, mail.example.com is a subdomain of example.com. Companies often use subdomains for separate services, and these are sometimes forgotten or less protected than the main site. He thought there must be something hidden there.

Recon approach

Recon (short for reconnaissance) is the information-gathering phase: finding out what exists on a target before trying to break anything. The researcher says he loves recon and spends more time on it than on actual hacking.

Browsing https://remoteservices.target.com returned a 404 code with nothing found in the response. A 404 is the standard HTTP status code a web server sends when the requested page does not exist. (HTTP is the language browsers and servers use to talk; a status code is a three-digit number summarising the result.) Seeing a 404 does not necessarily mean the site is empty; it can mean the content is at a path you have not guessed yet. The recommended next move is directory brute force, also called directory enumeration: automatically trying a long list of common folder and file names to see which ones exist.

Directory enumeration

A common question is which wordlist to use. A wordlist is simply a text file with one candidate name per line. The researcher says he does not use one specific list; it depends on the target. For example, if the server is an IIS server (Microsoft's web server), use a wordlist containing IIS directories and files. If it is an Apache server (another popular web server), use one containing Apache directories and files. Do this for any target. He keeps multiple wordlists and edits them whenever he finds a new interesting directory or file path. That is how you optimise recon, making it faster and more accurate.

He used a tool called FFUF to brute force the directories of the target subdomain. FFUF sends many requests quickly, each with a different path from the wordlist, and shows which ones return interesting responses. He got an interesting 403 Forbidden for the directory admin at https://remoteservices.target.com/admin.

403 Forbidden Response From the original on infosecwriteups.com

The screenshot shows the 403 Forbidden response for that directory. A 403 is the status code for "forbidden": the server understood the request but refuses to fulfil it. This looks promising because Forbidden suggests there is hidden content or a section the owners do not want you to see or access. It is like a door that is locked rather than missing.

Next step to bypass 403 Forbidden

The first thing he thought of was to brute force the admin directory as well, meaning to try file names inside it. That produced an Adminer login panel at https://remoteservices.target.com/admin/adminer.php.

Adminer Login From the original on infosecwriteups.com

The screenshot shows the Adminer login panel reached at that path. Adminer is a database management tool that allows you to connect to and manage different database management systems such as MySQL and Oracle. A database is an organised collection of data; a database management system (DBMS) is the software that stores and lets you query that data.

Getting internal access

First, he searched for CVEs and known exploits belonging to the version number identified by this Adminer login panel, but had no luck. A CVE (Common Vulnerabilities and Exposures) is a public identifier for a known security flaw. An exploit is code or a technique that takes advantage of such a flaw. The version number is often shown on a login page or in the page source; if a version has a known flaw, that can be a shortcut in.

Second, he checked the target programme's GitHub repository for any exposed credentials pointing to the Adminer login panel, but found nothing interesting. GitHub is a website where code is hosted; a repository is a project's storage. Sometimes developers accidentally commit passwords or keys to a public repository, which is called a credential leak.

Third, he searched Google for default Adminer login credentials and for commonly used credentials for Adminer login. Default credentials are the username and password a product ships with, meant to be changed on installation. Common credentials are pairs people often choose, like admin/admin or root/root. He got quite cool results. After trying them all out over about two hours, he gained successful access to the company's internal database, leading to Remote Code Execution, where he could manipulate their database.

The username was: homestead

The password was: secret

In plain words, the login form accepted a pair of credentials that is widely known. Once logged in, Adminer gives the ability to run SQL, the language databases use.

Remediation

The programme immediately removed access to the target website, then fixed the issue and changed the credentials. The researcher notes that sadly some well-known companies still use default credentials or credentials that can be easily guessed. This sometimes leads to critical issues that could cause harmful damage if they were discovered by criminals instead of ethical hackers.

Report timeline

Date Event
Sep 17, 2020 Initial report
Oct 18, 2020 Report resolved and bounty awarded
From the original on infosecwriteups.com

The final image shows the researcher's HackerOne profile and social media links for his company, Cybit Sec.

Variants to test

These are the same ideas generalised so you can try them on your own authorised targets.

  1. Forbidden directories with content one level deeper. When a directory answers 403, brute force inside it rather than stopping. A positive result is a reachable file such as a login panel or management script under the forbidden path.
  2. Database management panels on forgotten subdomains. Enumerate subdomains and look for Adminer, phpMyAdmin and similar tools. A positive result is a login form for a database tool on a host that is not part of the main application.
  3. Default credential pairs. Search for default and commonly used credentials for the specific product and try them against the login form. A positive result is a session that reaches the database management interface.
  4. Version fingerprinting before exploitation. Identify the version shown by the login panel and check for matching CVEs and public exploits. A positive result is a version with a known issue that is actually exploitable on the host.
  5. Credential leaks in public repositories. Check the programme's GitHub repositories for credentials that point at internal tooling. A positive result is a working username and password for a panel found during recon.

Glossary

  • Bug bounty programme: A scheme where an organisation invites independent testers to find and report security weaknesses in exchange for a reward.
  • Subdomain: A prefix added to a main domain name, such as mail.example.com under example.com.
  • Recon (reconnaissance): The information-gathering phase of a security test, finding what exists before attempting to break anything.
  • HTTP status code: A three-digit number a web server returns to summarise the result of a request, such as 404 or 403.
  • 404 Not Found: The status code meaning the requested page does not exist.
  • 403 Forbidden: The status code meaning the server understood the request but refuses to fulfil it.
  • Directory brute force / enumeration: Automatically trying a long list of common folder and file names to discover which ones exist.
  • Wordlist: A text file with one candidate name per line, used by brute-force tools.
  • FFUF: A command-line tool that sends many HTTP requests quickly, each with a different path from a wordlist, and shows interesting responses.
  • IIS: Microsoft's web server software.
  • Apache: A popular open-source web server software.
  • Adminer: A single-file web application for managing databases such as MySQL and Oracle.
  • Database: An organised collection of data.
  • Database management system (DBMS): Software that stores and lets you query a database.
  • MySQL: A popular open-source database management system.
  • Oracle: A commercial database management system.
  • CVE (Common Vulnerabilities and Exposures): A public identifier for a known security flaw.
  • Exploit: Code or a technique that takes advantage of a security flaw.
  • Version number: An identifier for a specific release of software, often shown on a login page or in the page source.
  • GitHub: A website where code is hosted.
  • Repository: A project's storage on a code-hosting site.
  • Credential leak: When passwords, keys or other secrets are accidentally exposed, for example in a public repository.
  • Default credentials: The username and password a product ships with, meant to be changed on installation.
  • Common credentials: Username and password pairs people often choose, such as admin/admin.
  • Remote Code Execution (RCE): The ability to run your own commands on a remote server.
  • SQL: The language used to query and manipulate databases.
  • Session: A period of interaction between a user and a system after logging in, often tracked by a cookie or token.
  • Cookie: A small piece of data a website stores in your browser to remember state, such as a login session.
  • Token: A value used to prove identity or authorise an action, often replacing or supplementing a password.
  • API: An interface that lets one piece of software talk to another, often over HTTP.
  • Vulnerability class: A category of security flaw, such as RCE or credential reuse.
  • Severity: A rating of how serious a flaw is.
  • CVSS: A standard scoring system for the severity of a vulnerability.
  • Bounty: The reward paid for a valid report.
  • Disclosure: The act of making a vulnerability report public.

More by Ahmad Halabi

View all

7 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.