Search code examples
phplinuxapachemariadbdebian

Mutillidae Error Blank Page when setting up database


I'm currently having issues using mutillidae. When i go too http://localhost/mutillidae/set-up-database.php their is no screen available and everything is blank. I have attached the screen shot as well. This is the error that displays on the Mutillidae home screen enter image description here Database Error message: Failed to connect to MySQL database. Access denied for user 'root'@'localhost' im currently using Debian Linux.


Solution

  • @Inazo is correct, here's a breakdown of how to get it up and running.

    I just wrote a Medium article on this, and ran into the same issues, but I'm not going to self-promote my feed and will just lay out the steps here for you :)

    1. Make sure you are running the LAMP stack (Linux, Apache,MySQL, PHP) For those instructions: https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-20-04

    Ignore the secure configuration steps for MySQL, since we are setting the VM up as a host-only network.

    The following commands you will need are as follows:

    sudo apt update
    
    sudo apt install apache2
    
    sudo ufw app list
    
    sudo ufw allow in “Apache”
    
    sudo apt install mysql-server
    
    sudo apt install php libapache2-mod-php php-mysql
    

    After these commands are run, proceed to Step 4 — Creating a Virtual Host for your Website

    Within /var/www

    sudo git clone https://github.com/webpwnized/mutillidae
    

    You should see a new Mutillidae folder

    sudo nano /etc/apache2/sites-available/mutillidae.conf
    

    Paste in the following contents, and save the file:

    <VirtualHost *:80>
        ServerName mutillidae
        ServerAlias mutillidae.local
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/mutillidae
        ErrorLog ${APACHE_LOG_DIR}/mutillidae-error.log
        CustomLog ${APACHE_LOG_DIR}/mutillidae-access.log combined
    </VirtualHost>
    

    file content

    sudo a2ensite Mutillidae (this will enable the site)
    
    sudo a2dissite 000-default (disables the default Apache site)
    
    sudo systemctl reload apache2
    

    Now open Firefox and browse to your internal IP. You will be presented with the following error

    Mutillidae Error

    sudo MySQL
    
    ALTER USER ‘root’@’localhost’ IDENTIFIED WITH mysql_native_password BY ‘mutillidae’;
    

    This is changing the root password to mutillidae

    sudo nano /var/html/mutillidae/includes/database-config.inc
    

    Change the DB password to mutillidae and save the file

    mutillidae DB Info

    Now refresh FireFox and you should see the setup DB screen. The important line is the fact that the DB mutillidae is unknown, as long as this error exists, we can setup the DB via the click here option

    If you run into any issues with this, please don't hesitate to reach out. I hope this helps, and am sorry for such a late response :(