
How to Install Mutillidae in Kali Linux with a Script
Follow these steps to install Mutillidae using the script:
Download and run the script provided. The installation will begin after executing the script.
Script Link:
Click on the link to view the script.
Installation Script:
#!/bin/bash
# Update package lists and install necessary dependencies
sudo apt update
sudo apt install php-xml php-fpm libapache2-mod-php php-mysql php-gd php-imap php-mysql php-curl php-mbstring -y
# Enable Apache2 modules and restart the service
sudo a2enmod proxy_fcgi setenvif
sudo systemctl restart apache2
sudo a2enconf php7.4-fpm
sudo systemctl reload apache2
sudo systemctl restart apache2.service
# Restart PHP and MySQL services
sudo service php7.4-fpm restart
sudo systemctl restart mysql
# Clone the Mutillidae repository
cd /tmp
git clone https://github.com/webpwnized/mutillidae
# Check if the cloning was successful
if [ $? -ne '0' ]; then
exit 1
fi
# Backup existing Mutillidae directory if it exists
if [ -d "/var/www/html/mutillidae.backup" ]; then
sudo rm -rf /var/www/html/mutillidae.backup
fi
# Move the existing Mutillidae directory to backup if necessary
if [ -d "/var/www/html/mutillidae" ]; then
sudo mv /var/www/html/mutillidae /var/www/html/mutillidae.backup
fi
# Create a new directory for Mutillidae and move the files
sudo mkdir /var/www/html/mutillidae
sudo mv mutillidae*/* /var/www/html/mutillidae/
# Update the database configuration
sudo sed -i "s/'DB_PASSWORD', 'mutillidae'/'DB_PASSWORD', ''/" /var/www/html/mutillidae/includes/database-config.inc
# Set proper permissions
sudo chown -R www-data:www-data /var/www/html/mutillidae/
# Clean up
sudo rm -rf mutillidae*
# Return to the home directory
cd
Explanation of the Script:
The script updates the system and installs the necessary PHP packages and modules.
It configures Apache2, PHP-FPM, and MySQL services.
It clones the Mutillidae repository from GitHub.
It backs up the existing Mutillidae directory if it exists.
It moves the files to the correct location and updates the database configuration.
Finally, it sets the proper file permissions and cleans up the temporary files.