net4people / bbs

Forum for discussing Internet censorship circumvention
3.19k stars 75 forks source link

Wireguard codebase modification #289

Open ptlearnertp opened 9 months ago

ptlearnertp commented 9 months ago

hello everyone i am working on wireguard to apply some modification on it i want that right before wireguard does it's things like encrypting data and other stuff, i modify the data , for simple example, i XOR data, so, in the server when it gets data from client, at first it does it's own things like decrypting and other stuff then it reverses the XOR and then it sends clear data to destination and when it wants to send response to client, at first it does XOR data and then treats the XORed data as raw data and does it's things and sends it into client i know that i have to modify client too but let's go step by step and first modify the server some say that wireguard doesn't have specific version for server and client and it's all peers which can act as server and client both the point is not that, my point is only applying the modification that i want

for the record, i'm working on https://github.com/WireGuard/wireguard-linux this version which i can set it up in my linux machine i just wanna know where is the point that it passes to the encryption things also, i don't know that if i, for example do XOR data before encryption process, should i do any modification in result of XOR like resizing it or not

wkrp commented 9 months ago

There's an existing thread about WireGuard obfuscation: #223.

If you're taking the approach of modifying the Linux kernel module, look particularly at this prior project: WireGuard with obfuscation support https://lists.zx2c4.com/pipermail/wireguard/2021-September/007142.html https://github.com/el3xyz/wireguard-linux-compat

88

markpash commented 9 months ago

Indeed there's an existing thread. But I would consider using eBPF for this XORing. It's much easier than building your own custom kernel.