You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -78,15 +78,54 @@ XAMPP is a very easy to install Apache Distribution for Linux, Solaris, Windows
78
78
79
79
This [video](https://youtu.be/Yzksa_WjnY0) walks you through the installation process for Windows but it should be similar for other OSs.
80
80
81
-
### Config File
81
+
### Docker
82
82
83
-
DVWA ships 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 DVWA directory, this can be done as follows:
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:
87
+
- If you are using Docker Desktop, both of these should be already installed.
88
+
- If you prefer Docker Engine on Linux, make sure to follow their [installation guide](https://docs.docker.com/engine/install/#server).
88
89
89
-
[How to Make Windows Show File Extensions](https://www.howtogeek.com/205086/beginner-how-to-make-windows-show-file-extensions/)
90
+
**We provide support for the latest Docker release as shown above.**
91
+
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.
92
+
93
+
Upgrading Docker from the package manager version to upstream requires that you uninstall the old versions as seen in their manuals for [Ubuntu](https://docs.docker.com/engine/install/ubuntu/#uninstall-old-versions), [Fedora](https://docs.docker.com/engine/install/fedora/#uninstall-old-versions) and others.
94
+
Your Docker data (containers, images, volumes, etc.) should not be affected, but in case you do run into a problem, make sure to [tell Docker](https://www.docker.com/support) and use search engines in the mean time.
95
+
96
+
Then, to get started:
97
+
98
+
1. Run `docker version` and `docker compose version` to see if you have Docker and Docker Compose properly installed. You should be able to see the version of Docker in the output.
99
+
100
+
For example:
101
+
102
+
```text
103
+
>>> docker version
104
+
Client:
105
+
[...]
106
+
Version: 23.0.5
107
+
[...]
108
+
109
+
Server: Docker Desktop 4.19.0 (106363)
110
+
Engine:
111
+
[...]
112
+
Version: 23.0.5
113
+
[...]
114
+
115
+
>>> docker compose version
116
+
Docker Compose version v2.17.3
117
+
```
118
+
119
+
If you don't see anything or get a command not found error, follow the prerequisites to setup Docker and Docker Compose.
120
+
121
+
2. Clone or download this repository and extract (see [Download](#download)).
122
+
3. Open a terminal of your choice and change its working directory to `DVWA`.
123
+
4. `docker compose up -d`.
124
+
125
+
DVWA is now available at `http://localhost:4280`.
126
+
127
+
**Notice that for running DVWA in containers, the web server is listening on port 4280 instead of the usual port of 80.**
128
+
For more information on this decision, see [I want to run DVWA on a different port](#i-want-to-run-dvwa-on-a-different-port).
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.
110
149
150
+
## Configurations
151
+
152
+
### Config File
153
+
154
+
DVWA ships 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 DVWA directory, this can be done as follows:
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:
159
+
160
+
[How to Make Windows Show File Extensions](https://www.howtogeek.com/205086/beginner-how-to-make-windows-show-file-extensions/)
161
+
111
162
### Database Setup
112
163
113
164
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.
@@ -182,7 +233,7 @@ Generated a pair of API keys from <https://www.google.com/recaptcha/admin/create
182
233
183
234
These then go in the following sections of `./config/config.inc.php`:
184
235
185
-
*`$_DVWA[ 'recaptcha_public_key' ]`
236
+
*`$_DVWA[ 'recaptcha_public_key' ]`
186
237
*`$_DVWA[ 'recaptcha_private_key' ]`
187
238
188
239
### Default Credentials
@@ -199,20 +250,67 @@ _Note: This will be different if you installed DVWA into a different directory._
199
250
200
251
- - -
201
252
202
-
## Docker Container
253
+
## Troubleshooting
203
254
204
-
_This section of the readme was added by @thegrims, for support on Docker issues, please contact them or @opsxcq who is the maintainer of the Docker image and repo. Any issue tickets will probably be pointed at this and closed._
255
+
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.
`docker run --rm -it -p 80:80 vulnerables/web-dvwa`
257
+
### Containers
208
258
209
-
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.
259
+
#### I want to access the logs
210
260
211
-
- - -
261
+
If you are using Docker Desktop, logs can be accessed from the graphical application.
262
+
Some minor details may change with newer versions, but the access method should be the same.
212
263
213
-
## Troubleshooting
264
+

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.
267
+
Logs can also be accessed from the terminal.
268
+
269
+
1. Open a terminal and change its working directory to DVWA
270
+
2. Show the merged logs
271
+
272
+
```shell
273
+
docker compose logs
274
+
```
275
+
276
+
In case you want to export the logs to a file, e.g. `dvwa.log`
277
+
278
+
```shell
279
+
docker compose logs >dvwa.log
280
+
```
281
+
282
+
#### I want to run DVWA on a different port
283
+
284
+
We don't use port 80 by default for a few reasons:
285
+
286
+
- Some users might already be running something on port 80.
287
+
- Some users might be using a rootless container engine (like Podman), and 80 is a privileged port (< 1024). Additional configuration (e.g. setting `net.ipv4.ip_unprivileged_port_start`) is required, but you will have to research on your own.
288
+
289
+
You can expose DVWA on a different port by changing the port binding in the `compose.yml` file.
290
+
For example, you can change
291
+
292
+
```yml
293
+
ports:
294
+
- 4280:80
295
+
```
296
+
297
+
to
298
+
299
+
```yml
300
+
ports:
301
+
- 8806:80
302
+
```
303
+
304
+
DVWA is now accessible at `http://localhost:8806`.
305
+
306
+
#### DVWA auto starts when Docker runs
307
+
308
+
The included [`compose.yml`](./compose.yml) file automatically runs DVWA and its database when Docker starts.
309
+
310
+
To disable this, you can delete or comment out the `restart: unless-stopped` lines in the [`compose.yml`](./compose.yml) file.
311
+
312
+
If you want to disable this behavior temporarily, you can run `docker compose stop`, or use Docker Desktop, find `dvwa` and click Stop.
313
+
Additionally, you can delete the containers, or run `docker compose down`.
0 commit comments