Are you happy with your logging solution? Would you help us out by taking a 30-second survey? Click here

DVWA

Damn Vulnerable Web Application (DVWA)

Star full 4f7b624809470f25b6493d5a7b30d9b9cb905931146e785d67c86ef0c205a402Star full 4f7b624809470f25b6493d5a7b30d9b9cb905931146e785d67c86ef0c205a402Star full 4f7b624809470f25b6493d5a7b30d9b9cb905931146e785d67c86ef0c205a402Star blank 374f33e4d622a2930833db3cbea26b5d03dc44961a6ecab0b9e13276d97d6682Star blank 374f33e4d622a2930833db3cbea26b5d03dc44961a6ecab0b9e13276d97d6682 (1 ratings)
Rated 3.0 out of 5
Subscribe to updates I use DVWA


Statistics on DVWA

Number of watchers on Github 2049
Number of open issues 17
Average time to close an issue 19 days
Main language PHP
Average time to merge a PR 13 days
Open pull requests 6+
Closed pull requests 8+
Last commit over 1 year ago
Repo Created over 6 years ago
Repo Last Updated over 1 year ago
Size 1.44 MB
Homepage http://dvwa.co.uk
Organization / Authorethicalhack3r
Latest Releasev1.9
Contributors10
Page Updated
Do you use DVWA? Leave a review!
View open issues (17)
View on github
Fresh, new opensource launches 🚀🚀🚀
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

Evaluating DVWA for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

DAMN VULNERABLE WEB APPLICATION

Damn Vulnerable Web Application (DVWA) is a PHP/MySQL web application that is damn vulnerable. Its main goal is to be an aid for security professionals to test their skills and tools in a legal environment, help web developers better understand the processes of securing web applications and to aid both students & teachers to learn about web application security in a controlled class room environment.

The aim of DVWA is to practice some of the most common web vulnerabilities, with various levels of difficulty, with a simple straightforward interface. Please note, there are both documented and undocumented vulnerabilities with this software. This is intentional. You are encouraged to try and discover as many issues as possible.


WARNING!

Damn Vulnerable Web Application is damn vulnerable! Do not upload it to your hosting provider's public html folder or any Internet facing servers, as they will be compromised. It is recommended using a virtual machine (such as VirtualBox or VMware), which is set to NAT networking mode. Inside a guest machine, you can download and install XAMPP for the web server and database.

Disclaimer

We do not take responsibility for the way in which any one uses this application (DVWA). We have made the purposes of the application clear and it should not be used maliciously. We have given warnings and taken measures to prevent users from installing DVWA on to live web servers. If your web server is compromised via an installation of DVWA it is not our responsibility it is the responsibility of the person/s who uploaded and installed it.


License

This file is part of Damn Vulnerable Web Application (DVWA).

Damn Vulnerable Web Application (DVWA) is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Damn Vulnerable Web Application (DVWA) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Damn Vulnerable Web Application (DVWA). If not, see http://www.gnu.org/licenses/.


Download and install as a docker container

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.

Download

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

Installation

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.

Installation Videos

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

Linux Packages

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 libapache2-mod-php

Database Setup

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)


Other Configuration

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.

Folder Permissions:

  • ./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).

PHP configuration:

  • 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]

File: config/config.inc.php:

  • $_DVWA[ 'recaptcha_public_key' ] & $_DVWA[ 'recaptcha_private_key' ] - These values need to be generated from: https://www.google.com/recaptcha/admin/create

Default Credentials

Default username = admin

Default password = password

...can easily be brute forced ;)

Login URL: http://127.0.0.1/dvwa/login.php

Troubleshooting

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.

In .htaccess:

Replace (please note it may say mod_php7):

<IfModule mod_php5.c>
    php_flag magic_quotes_gpc off
    #php_flag allow_url_fopen on
    #php_flag allow_url_include on
</IfModule>

With:

<IfModule mod_php5.c>
    magic_quotes_gpc = Off
    allow_url_fopen = On
    allow_url_include = On
</IfModule>

+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.


Links

Homepage: http://www.dvwa.co.uk/

Project Home: https://github.com/ethicalhack3r/DVWA

Created by the DVWA team

DVWA open issues Ask a question     (View All Issues)
  • over 2 years DVWA on PHP version: 7.0.9-2 cannot solve default installation errors
  • over 2 years xss possible with sql injection
  • over 2 years Cannot change Security Level from Impossible
  • over 2 years Medium CSRF is effectively the same as easy
  • over 2 years SQL Injection in Security Level Medium causes fatal error
  • over 2 years Wrong code in sqli & sqli_blind causes parse error
  • over 2 years Writable file /var/www/html/dvwa/external/phpids/0.6/lib/IDS/tmp/phpids_log.txt: No
  • over 2 years [bruteforce]impossible level, why account "locked" if $timenow > $timeout ?
  • over 2 years error 500 in login page
  • over 2 years Cannot set up database
  • over 2 years Dvaw Folder is at Same Level as Config Folder?
  • almost 3 years phpids bypass
  • almost 3 years Could not connect to the database. Please check the config file.
  • almost 3 years DVWA works fine in PHP7
  • almost 3 years Call to undefined function mysql_connect
  • almost 3 years Blank login and wrong permissions
  • almost 3 years Can't "create/reset db" // login.php is blank
  • almost 3 years Password Reset
  • almost 3 years PHP module gd: Missing
  • almost 3 years Object Not Found!
  • almost 3 years Fatal error
  • almost 3 years Security Level in DVWA not really changing
  • almost 3 years help out with this....../
  • almost 3 years erreur plugin
  • almost 3 years Cannot connect to database
  • about 3 years Can't find php5-gd on kali2 by apt-get install php5-gd
  • about 3 years PHP7 shows PHP code
  • about 3 years Uncaught Error: Call to undefined function mysql_result()
  • about 3 years Deprecated: Function mysql_numrows() while sql injection low level test dvwa V1.9
DVWA open pull requests (View All Pulls)
  • Remove usages of php-mysql
  • Update high.php
  • Added a bad CAPTCHA vulnerability
  • feat(global) adding support with docker
  • Javascript Module
  • Fix avatar image links for server on non-standard port
DVWA questions on Stackoverflow (View All Questions)
  • Hydra is not working when bruteforcing dvwa login form(false positive)
  • Why can't I login to DVWA (Damn Vulnerable Web Application)?
  • DVWA SQL Injection Not working
  • Problems setting up dvwa
  • DVWA setup PHP function allow_url_include: Disabled
  • Command Injection DVWA Hard Difficulty
  • DVWA database connection is not working
  • Infinite Loading When Trying to Connect Into MySQL DVWA
  • Setting up DVWA with XAMPP on virtual Ubuntu
  • DVWA 1.9 Setup Error
  • Access Denied for DVWA in Xampp running in Backtrack 5 r3
  • Error installing DVWA in xampp
  • DVWA login error
  • install DVWA on fedora 24
  • DVWA Installation issue
  • Issue with DVWA website displaying
  • how to use cookies in DVWA
  • DVWA Error: Call to undefined function mysql_connect()
  • OWASP-ZAP Pentesting DVWA
  • DVWA can not create a database?
  • Cannot get value of field from iframe of DVWA
  • Problems with creation of database DVWA
  • DVWA is not accessible
  • DVWA Can't Login, It Just Refreshes the Page
  • DVWA 1.8 - SQL Injection - Change a users password
  • Microsoft SQL Server 2005 - DVWA - SQL Injection
  • SQL Server 2000 - DVWA - including '-' character
  • Any way to bypass php login page? Testing SQLi on my Damn Vulnerable Web App (DVWA)
DVWA list of languages used
DVWA latest release notes
  • Added a dedicated objective (or flag) for file include. (@g0tmi1k)
  • Added a warning to any module that requires a certain configuration. (@g0tmi1k)
  • Added comments to all source code that would be visible via DVWA modules. (@g0tmi1k)
  • Added CSRF token to pre-auth forms (login/setup/security pages). (@g0tmi1k + @Shinkurt)
  • Added HttpOnly cookie flag on impossible levels. (@g0tmi1k)
  • Added more detail to the documentation. (@g0tmi1k)
  • Added PDO to all impossible levels requiring MySQL. (@g0tmi1k)
  • Added PHPIDS options into the config file. (@g0tmi1k)
  • Added system check to setup. (@g0tmi1k)
  • Added various information to all help pages for every module. (@g0tmi1k)
  • Changed brute force medium to be harder due to sleep. (@g0tmi1k)
  • Changed file include landing page + added 3x example pages. (@g0tmi1k)
  • Changed file include medium to be harder due to more filters. (@g0tmi1k)
  • Changed HTTP REFERER check for medium level CSRF. (@g0tmi1k)
  • Changed input box for medium level with SQLi + SQLi Blind. (@g0tmi1k)
  • Changed SQLi + SQLi Blind to be $_POST rather than $_GET. (@g0tmi1k)
  • Changed SQLi Blind to be a real example of the vulnerability. (@g0tmi1k)
  • Fixed brute force and file upload impossible levels, as they were vulnerable. (@g0tmi1k + @Shinkurt)
  • Fixed bug with file fnclude page not loading. (@g0tmi1k)
  • Fixed CAPTCHA bug to read URL parameters on impossible. (@g0tmi1k)
  • Fixed CAPTCHA bug where the form wouldn't be visible. (@g0tmi1k)
  • Fixed CAPTCHA bug where the URL parameters were not being used for low + medium. (@g0tmi1k)
  • Fixed CSRF medium level bug when not on localhost. (@g0tmi1k)
  • Fixed setup bug with custom URL path. (@g0tmi1k)
  • Removed PostgreSQL DB support. (@g0tmi1k)
  • Renamed 'Command Execution' to 'Command Injection'. (@g0tmi1k)
  • Renamed 'high' level to 'impossible' and created new vectors for 'high'. (@g0tmi1k)
  • Updated README and documentation. (@g0tmi1k)
  • Various code cleanups in the core PHP files+CSS. (@g0tmi1k)
  • Various setup improvements (e.g. redirection + limited menu links). (@g0tmi1k)
Other projects in PHP