Download and install as a docker container
- dockerhub page
docker run --rm -it -p 80:80 vulnerables/web-dvwa
Please ensure you are using aufs due to previous MySQL issues. Run
docker info to check your storage driver. If it isn’t aufs, please change it as such. There are guides for each operating system on how to do that, but they’re quite different so we won’t cover that here.
DVWA is available either as a package that will run on your own web server or as a Live CD:
- DVWA v1.9 Source (Stable) – [1.3 MB] Download ZIP – Released 2015-10-05
- DVWA v1.0.7 LiveCD – [480 MB] Download ISO – Released 2010-09-08
- DVWA Development Source (Latest) Download ZIP //
git clone https://github.com/ethicalhack3r/DVWA
Please make sure your config/config.inc.php file exists. Only having a config.inc.php.dist will not be sufficient and you’ll have to edit it to suit your environment and rename it to config.inc.php. Windows may hide the trailing extension.
Windows + XAMPP
The easiest way to install DVWA is to download and install XAMPP if you do not already have a web server setup.
XAMPP is a very easy to install Apache Distribution for Linux, Solaris, Windows and Mac OS X. The package includes the Apache web server, MySQL, PHP, Perl, a FTP server and phpMyAdmin.
XAMPP can be downloaded from: https://www.apachefriends.org/en/xampp.html
Simply unzip dvwa.zip, place the unzipped files in your public html folder, then point your browser to: http://127.0.0.1/dvwa/setup.php
If you are using a Debian based Linux distribution, you will need to install the following packages (or their equivalent):
apt-get -y install apache2 mysql-server php php-mysqli php-gd
To set up the database, simply click on the
Setup DVWA button in the main menu, then click on the
Create / Reset Database button. This will create / reset the database for you with some data in.
If you receive an error while trying to create your database, make sure your database credentials are correct within
./config/config.inc.php. This differs from config.inc.php.dist, which is an example file.
The variables are set to the following by default:
$_DVWA[ 'db_user' ] = 'root';
$_DVWA[ 'db_password' ] = 'p@ssw0rd';
$_DVWA[ 'db_database' ] = 'dvwa';
Note, if you are using MariaDB rather than MySQL (MariaDB is default in Kali), then you can’t use the database root user, you must create a new database user. To do this, connect to the database as the root user then use the following commands:
mysql> create database dvwa;
Query OK, 1 row affected (0.00 sec)
mysql> grant all on dvwa.* to dvwa@localhost identified by 'xxx';
Query OK, 0 rows affected, 1 warning (0.01 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
Depending on your Operating System as well as version of PHP, you may wish to alter the default configuration. The location of the files will be different on a per-machine basis.
./hackable/uploads/– Needs to be writable by the web service (for File Upload).
./external/phpids/0.6/lib/IDS/tmp/phpids_log.txt– Needs to be writable by the web service (if you wish to use PHPIDS).
allow_url_include = on– Allows for Remote File Inclusions (RFI) [allow_url_include]
allow_url_fopen = on– Allows for Remote File Inclusions (RFI) [allow_url_fopen]
safe_mode = off– (If PHP <= v5.4) Allows for SQL Injection (SQLi) [safe_mode]
magic_quotes_gpc = off– (If PHP <= v5.4) Allows for SQL Injection (SQLi) [magic_quotes_gpc]
display_errors = off– (Optional) Hides PHP warning messages to make it less verbose [display_errors]
$_DVWA[ 'recaptcha_public_key' ]&
$_DVWA[ 'recaptcha_private_key' ]– These values need to be generated from: https://www.google.com/recaptcha/admin/create
Default username =
Default password =
…can easily be brute forced 😉
Login URL: http://127.0.0.1/dvwa/login.php
For the latest troubleshooting information please visit: https://github.com/ethicalhack3r/DVWA/issues
+Q. SQL Injection won’t work on PHP v5.2.6.
-A.If you are using PHP v5.2.6 or above you will need to do the following in order for SQL injection and other vulnerabilities to work.
Replace (please note it may say mod_php7):
php_flag magic_quotes_gpc off
#php_flag allow_url_fopen on
#php_flag allow_url_include on
magic_quotes_gpc = Off
allow_url_fopen = On
allow_url_include = On
+Q. Command Injection won’t work.
-A. Apache may not have high enough privileges to run commands on the web server. If you are running DVWA under Linux make sure you are logged in as root. Under Windows log in as Administrator.