黑客技术
点击放大


Damn Web Application (DVWA) is a PHP/MariaDB web application that is damn . Its main goal is to be an aid for security professionals to test their skills and tools in a legal en, help web de 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 en.
The aim of DVWA is to practice some of the most common web , with levels of difficulty, with a simple straightforward interface.
Please note, there are both documented and undocumented with this software. This is intentional. You are encouraged to try and discover as many issues as possible.
Damn Web Application is damn ! 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 machine (such as or ), which is set to NAT networking mode. Inside a guest machine, you can download and install XAMPP for the web 服务端 and 数据库.
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 ha warnings and taken measures to prevent users from installing DVWA on to live web servers. If your web 服务端 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.
This file is part of Damn Web Application (DVWA).
Damn 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 3 of the License, or
(at your option) any later .
Damn 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 ha a copy of the GNU General Public License
along with Damn Web Application (DVWA). If not, see <
This file is a in multiple languages:
If you would like to contribute a translation, please submit a PR. Note though, this does not mean just run it through Google Translate and send that in, those will be rejected. Submit your translated by adding a new 'README.xx.md' file where xx is the two-letter 代码 of your desired language (based on ISO 639-1).
While there are of D, the only supported is the latest 源码 from the official GitHub repository. You can either clone it from the repo:
Or download a ZIP of the files.
Note, this is not an official D, it was written by and is maintained at D. A lot of work went into creating the script and, when it was created, it did not do anything malicious, however it is recommended you review the script before blindly running it on your system, just in case. Please report any bugs to the D repository, not here.
An automated installation script for DVWA on Debian-based machines, including Kali, Ubuntu, Kubuntu, Linux Mint, Zorin OS... It automatically installs dependencies, configures PHP/Apache, and initializes the 数据库 tables ready for login (admin / password).
Note: This script requires root pri and is tailored for Debian-based systems. Ensure you are running it as the root user.
#### Installation Requirements
#### Installation Steps
##### One-Liner
This will download an install script written by and run it automatically. This would not be included here if we did not trust the author and the script as it was when we re it, but there is always the chance of someone going rogue, and so if you don't feel safe running someone else's 代码 without re it yourself, follow the manual process and you can review it once downloaded.
##### Manually Running the Script
1. Download the script:
2. Make the script executable:
3. Run the script as root:
The easiest way to install DVWA is to download and install XAMPP if you do not already have a web ser.
XAMPP is a very easy to install Apache Distribution for Linux, Solaris, Windows and Mac OS X. The package includes the Apache web 服务端, MySQL, PHP, Perl, a FTP 服务端 and phpMyAdmin.
This video walks you through the installation process for Windows but it should be similar for other OSs.
Thanks to hoang-himself and JGillam, every commit to the master branch causes a Docker image to be built and ready to be pulled down from GitHub Container Registry.
For more information on what you are getting, you can browse the prebuilt Docker images.
#### Getting Started
Prerequisites: Docker and Docker Compose.
We provide support for the latest Docker release as shown above.
If you are using Linux and the Docker package that came with your package manager, it will probably work too, but support will only be best-effort.
Upgrading Docker from the package manager to upstream requires that you uninstall the old as seen in their manuals for Ubuntu, Fedora and others.
Your Docker data (containers, images, , etc.) should not be affected, but in case you do run into a problem, make sure to tell Docker and use search engines in the mean time.
Then, to get started:
1. Run docker and docker compose to see if you ha and Docker Compose properly installed. You should be able to see their in the output.
For example:
If you don't see anything or get a command not found error, follow the prerequisites to setup Docker and Docker Compose.
2. Clone or download this repository and extract (see Download).
3. Open a terminal of your choice and change its working directory into this folder (DVWA).
4. Run docker compose up -d.
DVWA is now a at .
Notice that for running DVWA in containers, the web 服务端 is listening on port 4280 instead of the usual port of 80.
For more information on this decision, see I want to run DVWA on a different port.
#### Local Build
If you made local changes and want to build the project from local, go to compose.yml and change pull_policy: always to pull_policy: build.
Running docker compose up -d should trigger Docker to build an image from local regardless of what is a in the registry.
See also: pull_policy.
#### Ser files
If your making local changes and don't want to build the project for every change :
1. Go to compose.yml and uncomment :
2. Run cp config/config.inc.php.dist config/config.inc.php to copy the default config file.
3. Run docker compose up -d and changes to local files will reflect on the container.
Ideally you should be using the latest stable of PHP as that is the that this app will be de and tested on.
Support will not be given for anyone trying to use PHP 5.x.
less than 7.3 ha issues that will cause problems, most of the app will work, but random things may not. Unless you have a very good reason for using such an old , support will not be given.
If you are using a Debian based Linux distribution, you will need to install the following packages _(or their equi)_:
I would recommend doing an update before this, just so you make sure you are going to get the latest of e.
The site will work with MySQL instead of MariaDB but we strongly recommend MariaDB as it works out of the box whereas you have to make changes to get MySQL to work correctly.
If you want to use the API lab you must have the Apache module mod_rewrite enabled. To do this in Linux run:
And then restart Apache with:
If you want to use the API module you will need to install a set of files using Composer.
First, make sure you ha installed. There seem to be backward compatibility issues so I always get the latest from here:
Follow the instructions the site gives to get it installed.
Now go into the /api directory and run:
If you did not install Composer to the system path, make sure you reference its full location.
D with a dummy copy of its config file which you will need to copy into place and then make the appropriate changes. On Linux, assuming you are in the D, this can be done as follows:
cp config/config.inc.php.dist config/config.inc.php
On Windows, this can be a bit harder if you are hiding file extensions, if you are unsure about this, this blog post explains more about it:
How to Make Windows Show File Extensions
Instead of modifying the configuration file, you can also set most settings using en . In a Docker or Kubernetes deployment, this allows you to modify the configuration without creating a new Docker image. You'll find the in the config/config.inc.php.dist file.
If you want to set the default security level to "low", simply add the following line to the compose.yml file:
To set up the 数据库, simply click on the Setup DVWA button in the main menu, then click on the Create / Reset Database button. This will create / reset the 数据库 for you with some data in.
If you receive an error while trying to create your 数据库, make sure your 数据库 credentials are correct within ./config/config.inc.php. _This differs from config.inc.php.dist, which is an example file._
The are set to the following by default:
Note, if you are using MariaDB rather than MySQL (MariaDB is default in Kali), then you can't use the 数据库 root user, you must create a new 数据库 user. To do this, connect to the 数据库 as the root user then use the following commands:
Some tools don't work well with authentication so can't be used with DVWA. To get around this, there is a config option to disable authentication checking. To do this, simply set the following in the config file:
You will also need to set the security level to one that is appropriate to the testing you want to do:
In this state, you can access all the features without needing to log in and set any cookies.
./hackable/uploads/ - Needs to be writeable by the web service (for File Upload).On Linux systems, likely found in /etc/php/x.x/fpm/php.ini or /etc/php/x.x/apache2/php.ini.
allow_url_include = on [allow_url_include]allow_url_fopen = on [allow_url_fopen]display_errors = on [display_errors]display_startup_errors = on [display_startup_errors]Make sure you restart the php service or Apache after making the changes.
This is only required for the "Insecure CAPTCHA" lab, if you aren't playing with that lab, you can ignore this section.
Generated a pair of API keys from <
These then go in the following sections of ./config/config.inc.php:
$_DVWA[ 'recaptcha_public_key' ]$_DVWA[ 'recaptcha_pri' ]Default username = admin
Default password = password
_...can easily be brute forced ;)_
Login URL: <
_Note: This will be different if you installed DVWA into a different directory._
These assume you are on a Debian based distro, such as Debian, Ubuntu and Kali. For other distros, follow along, but update the command where appropriate.
If you'd rather watch a video than read words, the most common issues are covered in the video Fixing D Issues.
#### I want to access the logs
If you are using Docker Desktop, logs can be accessed from the graphical application.
Some minor details may change with newer , but the access method should be the same.
!O of D
! DVWA logs
Logs can also be accessed from the terminal.
1. Open a terminal and change its working directory to DVWA
2. Show the merged logs
In case you want to export the logs to a file, e.g. dvwa.log
#### I want to run DVWA on a different port
We don't use port 80 by default for a few reasons:
net.ipv4.ip_unpri) is required, but you will have to research on your own.You can expose DVWA on a different port by changing the port binding in the compose.yml file.
For example, you can change
to
DVWA is now accessible at .
In cases in which you want DVWA to not only be accessible exclusively from your own device, but
on your local 网络 too (e.g. because you are setting up a test machine for a workshop), you
can remove the 127.0.0.1: from the port mapping (or replace it with you LAN IP). This way it
will listen on all a device. The safe default should always be to only listen on your
local loopback device. After all, it is a damn web application, running on your machine.
#### DVWA auto starts when Docker runs
The included compose.yml file automatically runs DVWA and its 数据库 when Docker starts.
To disable this, you can delete or comment out the restart: unless-stopped lines in the compose.yml file.
If you want to disable this behavior temporarily, you can run docker compose stop, or use Docker Desktop, find dvwa and click Stop.
Additionally, you can delete the containers, or run docker compose down.
On Linux systems Apache generates two log files by default, access.log and error.log and on Debian based system these are usually found in /var/log/apache2/.
When submitting error reports, problems, anything like that, please include at least the last fi from each of these files. On Debian based systems you can get these like this:
Video Help
If you are having this problem you need to understand file locations. By default, the Apache document root (the place it starts looking for web content) is /var/www/html. If you put the file hello.txt in this directory, to access it you would browse to .
If you created a directory and put the file in there - /var/www/html/mydir/hello.txt - you would then need to browse to .
Linux is by default case sensitive and so in the example above, if you tried to browse to any of these, you would get a 404 Not Found:
How does this affect DVWA? Most people use git to clone DVWA into /var/www/html, this gives them the directory /var/www/html/DVWA/ with all the D inside it. They then browse to and get either a 404 or the default Apache welcome page. As the files are in DVWA, you must browse to .
The other common mistake is to browse to which will give a 404 because dvwa is not DVWA as far as Linux directory matching is concerned.
So after setup, if you try to visit the site and get a 404, think about where you installed the files to, where they are relative to the document root, and what the case of the directory you used is.
Video Help
This is usually one configuration issue hiding another issue. By default, PHP does not display errors, and so if you forgot to turn error display on during the setup process, any other problems, such as failure to connect to the 数据库, will stop the app from loading but the message to tell you what is wrong will be hidden.
To fix this, make sure you set display_errors and display_startup_errors as covered in PHP Configuration and then restart Apache.
If you see the following when running the setup script it means the username or password in the config file do not match those configured on the 数据库. Video Help
The error is telling you that you are using the username notdvwa.
The following error says you ha the config file at the wrong 数据库. Video Help
It is saying that you are using the user dvwa and trying to connect to the database notdvwa.
The first thing to do is to double check what you think you put in the config file is what is actually there.
If it matches what you expect, the next thing to do is to check you can log in as the user on the command line. Assuming you have a 数据库 user of dvwa and a password of p, run the following command:
_Note: There is no space after the -p_
If you see the following, the password is correct:
As you can connect on the command line, it is likely something wrong in the config file, double check that and then raise an issue if you still can't get things working.
If you see the following, the username or password you are using is wrong. Repeat the 数据库 Setup steps and make sure you use the same username and password throughout the process.
If you get the following, the user credentials are correct but the user does not ha to the 数据库. Again, repeat the setup steps and check the 数据库 name you are using.
The final error you could get is this:
This is not an authentication issue but tells you that the 数据库 服务端 is not running. Start it with the following
Video Help
An error similar to this one:
Means your 数据库 服务端 is not running or you've got the wrong IP address in the config file.
Check this line in the config file to see where the 数据库 服务端 is expected to be:
Then go to this 服务端 and check that it is running. In Linux this can be done with:
And you are looking for something like this, the important bit is that it says acti).
If it is not running, you can start it with:
Note the sudo and make sure you put your Linux user password in if requested.
In Windows, check the status in the XAMPP console.
With the most recent of MySQL, PHP can no longer talk to the 数据库 in its default configuration. If you try to run the setup script and get the following message it means you ha.
You have two options, the easiest is to uninstall MySQL and install MariaDB. The following is the official guide from the MariaDB project:
<
Alternatively, follow these steps:
1. As root, edit the following file: /etc/mysql/mysql.conf.d/mysqld.cnf
1. Under the line [mysqld], add the following:
default-authentication-plugin=mysql_nati
1. Restart the database: sudo service mysql restart
1. Check the authentication method for your 数据库 user:
1. You'll likely see caching_sha2_password. If you do, run the following command:
1. Re-running the check, you should now see mysql_nati.
After all that, the setup process should now work as normal.
If you want more information see the following page: <
The 数据库 服务端 is not running. In a Debian based distro this can be done with:
There are a few reasons you could be getting these errors, but the most likely is the of 数据库 服务端 you are running is not compatible with the of PHP.
This is most commonly found when you are running the latest of MySQL as PHP and it do not get on well. Best advice, ditch MySQL and install MariaDB as this is not something we can support.
For more information, see:
<
You may be running into problems with SELinux. Either disable SELinux or run this command to allow the web 服务端 to talk to the 数据库:
If you see the following error in the Docker logs while trying to start MariaDB, it is likely due to the host machine not having enough memory. If you are using this in a hosted en, the best solution is to step up a machine size to get more memory and to try again.
You might also need to add the following line to the section of your compose.yml file:
Doing that would change the section of a default config file to the following:
For more information on why this works, see this issue.
For the latest troubleshooting information please read both open and closed tickets in the git repo:
<
Before submitting a ticket, please make sure you are running the latest of the 代码 from the repo. This is not the latest release, this is the latest 代码 from the master branch.
If raising a ticket, please submit at least the following information:
I am going to try to put together some tutorial that walk through some of the and show how to detect them and then how to exploit them. Here are the ones I've made so far:
Finding and Exploiting Reflected XSS
_Support for this is limited, before raising issues, please ensure you are prepared to work on debugging, do not simply claim "it does not work"._
By default, SQLi and Blind SQLi are done against the MariaDB/MySQL 服务端 used by the site but it is possible to switch to do the SQLi testing against SQLite3 instead.
I am not going to cover how to get SQLite3 working with PHP, but it should be a simple case of installing the php-sqlite3 package and making sure it is enabled.
To make the switch, simply edit the config file and add or edit these lines:
By default it uses the file database/sqli.db, if you mess it up, simply copy database/sqli.db.dist over the top.
The challenges are exactly the same as for MariaDB, they just run against SQLite3 instead.
👨💻 Contributors
-----
Thanks for all your contributions and keeping this project updated. :heart:
If you have an idea, some kind of impro or just simply want to collaborate, you are welcome to contribute and participate in the Project, feel free to send your PR.
<p align="center">
<a href="
<img src="
</a>
</p>
To put it simply, please don't!
Once a year or so, someone will submit a report for a they' in the app, some are well written, sometimes better than I've seen in paid pen test reports, some are just "you are missing headers, pay me".
In 2023, this elevated to a whole new level when someone decided to request a CVE for one of the , they were given C. Much hilarity ensued and time was wasted getting this corrected.
The app has , it is deliberate. Most are the well documented ones that you work through as lessons, others are "hidden" ones, ones to find on your own. If you really want to show off your skills at finding the hidden extras, write a blog post or create a video as there are probably people out there who would be interested in learning about them and about how your found them. If you send us the link, we may e it in the references.
Project Home: <
_Created by the D
开发语言:PHP
Star 数:13771
该项目属于黑客技术方向的开源资源,代码结构清晰,适合安全研究人员学习参考。项目围绕Damn Vulnerable Web Application (DVWA)展开,提供了可运行的实现,对理解相关安全机制、工具原理与攻防技术具有较高的研究价值。
从技术实现角度看,此类项目的核心在于对底层原理的深入理解与工程化落地。开发者在研究过程中可以结合官方文档与社区讨论,梳理项目的初始化流程、核心模块职责与数据流转,逐步掌握其中的技术细节与设计思路。
1. 下载源码压缩包,解压到本地环境。
2. 根据项目类型准备对应的运行环境与依赖。
3. 按照 README 中的步骤完成配置与部署。
4. 在隔离的测试环境中运行验证,避免影响生产系统。
本资源来源于开源社区,仅供安全研究、技术学习与合法授权范围内的攻防演练使用,请勿用于任何非法或侵害他人权益的用途。使用本项目产生的一切后果由使用者自行承担。
| 资源标题 | DVWA - Damn Vulnerable Web Application (DVWA) |
| 所属分类 | 黑客技术 |
| 发布作者 | admin |
| 发布时间 | 2026-10-05 22:29:07 |
| 下载权限 | 免费下载 |
| 附件数量 | 2 个下载链接 |
| 浏览次数 | 270 |
| 讨论数量 | 0 |
| 主题状态 | 正常讨论中 |