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
{{ message }}
This repository was archived by the owner on Oct 15, 2024. It is now read-only.
nDVWA is a compact Dockerized solution for deploying DVWA with nginx.
3
+
nDVWA is a compact Dockerized solution for deploying DVWA with Nginx.
4
4
5
5
Everything is kept in a single container: nginx is pulled as a base image, and DVWA is downloaded directly from it's official git repository.
6
6
7
7
Additionally, this application offers a few extra SSH configurations between the Docker container and it's host machine.
8
8
9
9
The SSH connection with port knocking protection is established using internal Docker network (which is evident by `docker0` interface and `172.17.0.1` default host address usage in the codebase). You can opt-out of these configurations via a prompt when starting up the container.
10
10
11
-
This app was a part of an academic study and had a DoD (Definition-of-Done). The details are presented below.
11
+
This app consist of several key steps. The details are presented below.
12
12
13
13
## Contents
14
14
15
15
-[nDVWA](#ndvwa)
16
16
-[Contents](#contents)
17
-
-[**Disclaimer**](#disclaimer)
18
-
-[DoD](#dod)
19
-
-[Installing Nginx with Docker](#installing-nginx-with-docker)
20
-
-[Deploying DVWA on Nginx](#deploying-dvwa-on-nginx)
21
-
-[(optional) Establishing Reverse Tunneling to SSH](#optional-establishing-reverse-tunneling-to-ssh)
22
-
-[(optional) Protecting SSH from Nmap Scanning](#optional-protecting-ssh-from-nmap-scanning)
17
+
-[**Important**](#important)
18
+
-[Key Steps](#key-steps)
23
19
-[How To Use](#how-to-use)
24
20
-[1. Build (or download) the Docker image](#1-build-or-download-the-docker-image)
25
21
-[2. Create a Docker container](#2-create-a-docker-container)
26
-
-[3. Check deployed DVWA via web-browser](#3-check-deployed-dvwa-via-web-browser)
22
+
-[3. Check the deployed DVWA instance via web-browser](#3-check-the-deployed-dvwa-instance-via-web-browser)
27
23
-[4. Follow the prompts in Docker container](#4-follow-the-prompts-in-docker-container)
28
24
29
-
## **Disclaimer**
25
+
## **Important**
30
26
31
-
If you wish to execute **all** of the steps (including SSH configurations), please take into consideration that it might permanently alternate iptables rules on your machine.
27
+
> [!IMPORTANT]
28
+
> **\- DISCLAIMER \-**
29
+
>
30
+
>If you wish to execute **all** of the steps (including SSH configurations), please take into consideration that it might permanently alternate iptables rules on your machine.
31
+
>
32
+
>Once the SSH configurations are complete, the app flushes `DOCKER` and `INPUT` chains in iptables.
33
+
>
34
+
>Unless you know what you are doing or able to fix your iptables in case of any issue, it is recommended to run this app in a virtual machine (or any other environment that is not someone's primary workspace).
32
35
33
-
Once the SSH configurations are completed, the app flushes `DOCKER` and `INPUT` chains in iptables.
36
+
> [!NOTE]
37
+
> And just in case, run a `sudo iptables -L > ~/default_iptables.txt` before launching the app. That way you'll have a reference to restore your iptables rules if required.
34
38
35
-
Unless you know what you are doing or able to fix your iptables in case of any issue, it is recommended to run this app in a virtual machine.
39
+
## Key Steps
36
40
37
-
Tip: And just in case, run a `sudo iptables -L > ~/default_iptables.txt` before launching the app. That way you'll have a reference to restore your iptables rules if required.
41
+
The whole function of the app can be broken down into the following steps:
38
42
39
-
## DoD
40
-
41
-
### Installing Nginx with Docker
42
-
43
-
1. install Docker on your system;
44
-
2. pull the Nginx Docker image;
45
-
3. create a Docker container using the Nginx image;
46
-
4. configure the necessary ports for Nginx to operate.
47
-
48
-
### Deploying DVWA on Nginx
49
-
50
-
1. download the Damn Vulnerable Web Application (DVWA) package;
51
-
2. configure Nginx to serve the DVWA files;
52
-
3. verify the successful deployment of DVWA by accessing it through a web browser.
53
-
54
-
### (optional) Establishing Reverse Tunneling to SSH
55
-
56
-
1. configure the SSH server to allow reverse tunneling;
57
-
2. set up the reverse tunnel by initiating an SSH connection from the Docker container to the SSH server;
58
-
3. verify the reverse tunnel connection by accessing the SSH server from the Docker container.
59
-
60
-
### (optional) Protecting SSH from Nmap Scanning
61
-
62
-
1. install Nmap for scanning purposes;
63
-
2. implement port knocking or port scanning detection mechanisms to prevent unauthorized access attempts;
64
-
3. test the implemented measures using Nmap to ensure SSH protection against scanning.
43
+
1. installing Nginx with Docker;
44
+
2. deploying DVWA on Nginx;
45
+
3. establishing reverse tunneling to SSH (optional);
46
+
4. protecting SSH from Nmap scanning with port knocking protection (optional).
65
47
66
48
## How To Use
67
49
@@ -73,7 +55,7 @@ In the root of the directory, run:
73
55
docker build . -t ndvwa
74
56
```
75
57
76
-
Alternatively, you can download a pre-built image from repository's registry:
58
+
Alternatively, you can download a pre-built image from the repository's registry:
77
59
78
60
```sh
79
61
docker pull ghcr.io/seppzer0/ndvwa
@@ -87,7 +69,7 @@ To create a container, run:
87
69
docker run --rm -it -p 80:80 ndvwa
88
70
```
89
71
90
-
### 3. Check deployed DVWA via web-browser
72
+
### 3. Check the deployed DVWA instance via web-browser
91
73
92
74
Using a web-browser, enter `0.0.0.0:80` URL.<br>
93
75
When asked for credentials for the first time, use `dvwa` for both login and password.<br>
@@ -97,9 +79,10 @@ Then, using UI, create a new database. When asked for credentials again, use `ad
97
79
98
80
Once the container is launched, you will be prompted whether to proceed with SSH configurations or just directly jump into Bash shell.
99
81
100
-
Keep in mind that in order to establish an SSH connection between a container and a host machine, you need to setup an SSH server on the host machine first.<br>
82
+
Keep in mind that in order to establish an SSH connection between a container and a host machine, you need to setup an SSH server on the host machine first.
0 commit comments