|
@@ -1,68 +0,0 @@
|
1
|
|
-# WireGuard VPN Setup Scripts
|
2
|
|
-
|
3
|
|
-These scripts automate the installation and configuration of a WireGuard-based VPN setup for a network vulnerability scanner project. They include:
|
4
|
|
-
|
5
|
|
-- A **client setup script** to establish a reverse tunnel from a remote site
|
6
|
|
-- A **server setup script** for the central scanner to receive connections
|
7
|
|
-
|
8
|
|
----
|
9
|
|
-
|
10
|
|
-## 📡 VPN Client Setup (`setup-wireguard-client.sh`)
|
11
|
|
-
|
12
|
|
-This script installs WireGuard on a remote machine, generates keys, and sets up a reverse tunnel to the scanner server using the WireGuard protocol.
|
13
|
|
-
|
14
|
|
-### 🔧 Configuration
|
15
|
|
-
|
16
|
|
-Before running, edit the following values inside the script:
|
17
|
|
-
|
18
|
|
-- `WG_ADDRESS`: IP address of the client in the VPN (e.g., `10.0.0.2/24`)
|
19
|
|
-- `WG_SERVER_PUBLIC_KEY`: Public key of the server
|
20
|
|
-- `WG_SERVER_ENDPOINT`: IP and port of the server (e.g., `192.0.2.1:51820`)
|
21
|
|
-- `WG_ALLOWED_IPS`: Use `0.0.0.0/0` to tunnel all traffic through the VPN
|
22
|
|
-- `WG_IFACE`: Network interface used for NAT (e.g., `enp0s3`)
|
23
|
|
-
|
24
|
|
-### ▶️ Usage
|
25
|
|
-
|
26
|
|
-```bash
|
27
|
|
-chmod +x setup-wireguard-client.sh
|
28
|
|
-sudo ./setup-wireguard-client.sh
|
29
|
|
-```
|
30
|
|
-
|
31
|
|
----
|
32
|
|
-
|
33
|
|
-## 🛡 VPN Server Setup (`setup-wireguard-server-no-postup.sh`)
|
34
|
|
-
|
35
|
|
-This script installs WireGuard on the central scanning server, generates a keypair, and configures it to accept connections from clients.
|
36
|
|
-
|
37
|
|
-### 🔧 Configuration
|
38
|
|
-
|
39
|
|
-Before running, edit the script:
|
40
|
|
-
|
41
|
|
-- `WG_ADDRESS`: Server IP in the VPN (e.g., `10.0.0.1/32`)
|
42
|
|
-- `WG_LISTEN_PORT`: Port to listen on (e.g., `123`)
|
43
|
|
-- `WG_PEER_PUBLIC_KEY`: Public key of the client
|
44
|
|
-- `WG_ALLOWED_IPS`: Must include the client's tunnel IP (e.g., `10.0.0.2/32`) and any **internal subnets** the server needs to access through the client (e.g., `192.168.0.0/24`)
|
45
|
|
-
|
46
|
|
-### ▶️ Usage
|
47
|
|
-
|
48
|
|
-```bash
|
49
|
|
-chmod +x setup-wireguard-server-no-postup.sh
|
50
|
|
-sudo ./setup-wireguard-server-no-postup.sh
|
51
|
|
-```
|
52
|
|
-
|
53
|
|
----
|
54
|
|
-
|
55
|
|
-## Notes
|
56
|
|
-
|
57
|
|
-- Ensure the client's real internal subnets are listed in `AllowedIPs` on the server.
|
58
|
|
-- You can connect multiple clients by repeating the `[Peer]` block in the server’s config.
|
59
|
|
-- Keys are stored under `/etc/wireguard/`. Do not expose them publicly.
|
60
|
|
-- You need to exchange public keys from scanner to client and vice versa to put in the conf file
|
61
|
|
-
|
62
|
|
-### 🛠 Useful Commands
|
63
|
|
-
|
64
|
|
-```bash
|
65
|
|
-wg show # Show the status of WireGuard connection
|
66
|
|
-sudo wg-quick down wg0 # Bring down the VPN
|
67
|
|
-sudo wg-quick up wg0 # Bring up the VPN
|
68
|
|
-```
|