Hacking Wordpress Server Database
The article describes a scenario where an attacker with a reverse shell on a WordPress server finds database credentials in a configuration file, accesses the MySQL database, and extracts user password hashes. The attacker then identifies the hash type as MD5 and cracks it to obtain plaintext passwords.
Welcome to this new article, today I am going to show you how to attack a database on a machine that uses Wordpress to get the all users encrypted credentials.
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 WordPress configuration file contained plaintext database credentials and the user passwords were stored as unsalted MD5 hashes, which are fast to crack.
Impact
An attacker who already has a reverse shell could obtain all WordPress user password hashes and crack them to recover plaintext passwords, potentially leading to further account compromise.
What the attacker needed
Reverse shell on the server; read access to wp-config.php; database credentials in the file
How it was found
- Find the WordPress configuration file wp-config.php.
- Read the file to obtain database credentials.
- Log into the MySQL database using the credentials.
- List databases and select the WordPress database.
- List tables and query the wp_users table to retrieve user login names and password hashes.
- Identify the hash type and crack it with John the Ripper.
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.
This is a walkthrough of what an attacker can do after already breaking into a server. The attacker finds the database password in a WordPress configuration file, logs into the database, and steals the scrambled passwords of all users. Then they use a tool to guess the original passwords from those scrambled versions.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.