This script automates the installation and configuration of Damn Vulnerable Web Application (DVWA) on macOS, Linux, and Windows (via WSL). It checks for prerequisites, clones the DVWA repository, configures database settings, modifies necessary configurations, and starts required services.
Ensure the following are installed:
- Git
- MySQL (MariaDB recommended)
- Apache2
- PHP
For Debian-based systems:
sudo apt update && sudo apt install git mysql-server apache2 php php-mysql libapache2-mod-php -yFor RedHat-based systems:
sudo yum install git mariadb-server httpd php php-mysql -yFor macOS (using Homebrew):
brew install git mysql apache2 phpInstall Windows Subsystem for Linux (WSL) and follow the Linux setup above.
git clone https://github.com/your-repo/dvwa-setup.git
cd dvwa-setup
chmod +x install_dvwa.py
python3 install_dvwa.py- Navigate to
http://127.0.0.1/DVWAin your browser. - Log in with:
- Username:
admin - Password:
password
- Username:
- Go to the Setup page and click Create / Reset Database.
- Log in again to start using DVWA.
- Command Not Found Errors: Ensure required packages are installed.
- Permission Issues: Run with
sudoif necessary. - MySQL Connection Errors: Ensure MySQL is running (
sudo service mysql start).