WireGuard obfuscation on Windows client ideas

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Author Message
Megrez7
DD-WRT User


Joined: 25 Aug 2019
Posts: 92

PostPosted: Sun Jan 21, 2024 23:40    Post subject: WireGuard obfuscation on Windows client ideas Reply with quote
Obfuscation is very interesting feature within WireGuard, what would allow to use of WireGuard from some countries using Deep Packet Inspection.

Over last few days I have been trying to find a way how to run it on a client Windows machine.

The idea was to use Shadowsocks as a proxy: Windows Wg Client <-> Shadowsocks (on Windows) <-> DDWRT WG server. However there are some ambiguities.

1. DDWRT obfuscation documentation says it is using ChaCha6 in one place and ChaCha8 in the other one. While source code mentions ChaCha20.
2. Shadowsocks only has "chacha20-ietf-poly1305" option so this will not work as these are two different things - it is different from ChaCha20.
3. Additionally I am not sure if DDWRT and Shadowsocks use same key length.

Obfuscation is really interesting concept and has a great use case, with probably thousands (if not much more) of potential users.

However difficult to set up on Windows clients.

Please reflect on my ambiguities and share your ideas how to set it up.
Let's make it work for others.
Sponsor
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12923
Location: Netherlands

PostPosted: Mon Jan 22, 2024 9:36    Post subject: Reply with quote
Since 4 months it uses chacha6
https://github.com/infinet/xt_wgobfs/commit/1b2d8283664da277fd09eed9dc2012d9a2c03ef8

As far as I am aware it is available on OpenWRT and DDWRT

So just use two routers to make the connection

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
Megrez7
DD-WRT User


Joined: 25 Aug 2019
Posts: 92

PostPosted: Mon Jan 22, 2024 14:15    Post subject: Reply with quote
Thanks for clarification on ChaCha.

Two routers would work for stationary implementation at the office or home.

However this is not suitable for travelling.

There must be some solution for such an added value service.

Any more ideas?
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12923
Location: Netherlands

PostPosted: Mon Jan 22, 2024 15:47    Post subject: Reply with quote
Small travel router?

If you really need obfuscation/scramble on windows, then you might look into OpenVPN
For OpenVPN it is called scramble and is available for DDWRT, OpenWRT but also for Android, MacOS and Windows although I only used it for DDWRT and OpenWRT.
See: https://github.com/egc112/OpenWRT-egc-add-on/tree/main/openvpn-scramble

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
Megrez7
DD-WRT User


Joined: 25 Aug 2019
Posts: 92

PostPosted: Fri Jan 26, 2024 11:31    Post subject: Reply with quote
Thanks for the suggestion with travel router. That will work but I am looking for "self-contained" solution. Having read https://github.com/infinet/xt_wgobfs documentation I decided to go check the relay option.

Unfortunately it is not working, but that could be some Linux configuration issue, where I am not capable to fix it.

Sorry for the long description. I try to be precise and specific to get efficient support.

Hope this will lead to creating an instruction for others how to benefit from dd wrt obfuscation.


Herewith what I have done in detail.


1. I test the solution from home using "Client test network" which I have created with a spare DDWRT router TP-Link WDR4300 in Station Mode, wirelessly connected to smartphone for WAN access. The test client network is of course not connected in any way to my main home one. It works great, stable with good speed.

The "Remote network" (home) is set up on Netgear R6400v2. Both routers are running r55003.

See "OBFS sites setup" for network schema. I have partially hidden Remote Network public IP.


2. Activating a tunnel from Windows Client 192.168.1.86 directly (no relay) to Remote network works great at this moment - no obfuscation.

See screenshots "1 DDWRT tunnel router config" and "1 Client config".


3. Turning on obfuscation through Linux relay.

a. I turn on obfuscation on DDWRT in Remote Network and set the key (no screenshot).
b. Windows client 192.168.1.86 got some changes in WG config - see "2 Client config" - basically traffic destination is Linux Relay rather than real WG server.
c. Relay - I have installed Debian 12 as Hyper-V on Windows Client (with LAN IP address) as per the guide https://github.com/infinet/xt_wgobfs documentation.

All went smoothly, iptables added and set as default - tested with blocking some public IP and subsequent ping not working to that address.

Default policy is ACCEPT
Code:
root@debian:~# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Iptables OBFS extension successfully build and installed.

Debian has Internet access, can ping the host (which is Windows Client), host can ping Debian, Debian and Windows Client can ping Remote Network public IP (once enabled of course, as DDWRT blocks it by default).

d. I have added rules as per the guide
Code:
iptables -t nat -A PREROUTING -p udp -d RELAY_WAN_IP --dport 6789 -j DNAT --to-destination real_wg_server_ip:6789
iptables -t nat -A POSTROUTING -p udp -d real_wg_server_ip --dport 6789 -j MASQUERADE
iptables -t mangle -A FORWARD -p udp -d real_wg_server_ip --dport 6789 -j WGOBFS --key mysecretkey --obfs
iptables -t mangle -A FORWARD -p udp -s real_wg_server_ip --sport 6789 -j WGOBFS --key mysecretkey --unobfs

adjusted to my case:
Code:
iptables -t nat -A PREROUTING -p udp -d 192.168.1.92 --dport 51812 -j DNAT --to-destination 89.25.XXX.YYY:51812
iptables -t nat -A POSTROUTING -p udp -d 89.25.XXX.YYY --dport 51812 -j MASQUERADE
iptables -t mangle -A FORWARD -p udp -d 89.25.XXX.YYY --dport 51812 -j WGOBFS --key qwertyuiopasdfghjklzxcvbnm123456 --obfs
iptables -t mangle -A FORWARD -p udp -s 89.25.XXX.YYY --sport 51812 -j WGOBFS --key qwertyuiopasdfghjklzxcvbnm123456 --unobfs

Added succesfully, no error messages. Remote DDDWRT has the same key configured.

All these 4 iptabels rules are not saved permanently, so every Debian reboot I add them again.

e. Activating a tunnel from Windows Client 192.168.1.86 to Remote network through Debian realy does not work. WG Cleint shows some data sent, but no data received.


4. How to debug it?
I have no experience with Linux, I have spent the last few days on installation, configuration and learning but have reached my limits.
Here are a few ideas / questions / observations:

a. What is RELAY_WAN_IP in iptables rule? Is this Debian WAN 192.168.1.92 in my case?
b. Shall Debian relay use same 51812 port as destination real WG server?
c. Are ipttales well customised to my case?
d. I have tried to add the server rules on Remote DDWRT as described in the guide but that makes no change. I would expect this as GUI probably add these rules during obfuscation configuration for WG.

Bottom line - how can I diagnose it further to find which element is misconfigured?


Last edited by Megrez7 on Fri Jan 26, 2024 11:33; edited 2 times in total
Megrez7
DD-WRT User


Joined: 25 Aug 2019
Posts: 92

PostPosted: Fri Jan 26, 2024 11:31    Post subject: Reply with quote
The last attachment here due to the limit.
Megrez7
DD-WRT User


Joined: 25 Aug 2019
Posts: 92

PostPosted: Tue Feb 06, 2024 0:03    Post subject: Reply with quote
Anyone able and willing to help with this?
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum