GithubHelp home page GithubHelp logo

mrsobakin / dpimyass Goto Github PK

View Code? Open in Web Editor NEW
12.0 1.0 1.0 46 KB

๐Ÿ–•๐Ÿ•ต Simple and fast udp obfuscating proxy, designed to bypass DPI

License: GNU General Public License v3.0

Rust 90.06% Dockerfile 4.19% Shell 5.75%
dpi dpi-bypassing obfuscation proxy rust udp-proxy

dpimyass's Introduction

๐Ÿ–•๐Ÿ•ต DPIMyAss

DPIMyAss is a simple UDP proxy designed for bypassing DPI with close-to-zero overhead.

Funny image showing network architecture

Why? ๐Ÿค”

I made this proxy to restore the wireguard functionality in places where it was blocked. DPIMyAss is way simpler than the other solutions like, say, shadowsocks, and it does not require messing with the ip interfaces to get it running. All you have to do to set it up with wireguard is run this proxy on both your server and client, and change the endpoint to local proxy address in your wireguard config (Also you might have to do this).

DPIMyAss also does not create any additional overhead on the network. The forwarded packets stay the exact same size they were, and no new packets are created.

Features ๐Ÿš€

  • UDP Obfuscation: DPIMyAss mangles packets, making the underlying protocol unrecognizable to the DPI.
  • Simplicity: DPIMyAss is extremely simple and small. It's not trying to be what it isn't - there are no custom protocols or complex encryption here.
  • Speed: DPIMyAss uses simple XOR encryption, which results in almost zero processing overhead.

Getting Started ๐Ÿ› ๏ธ

These instructions will help you set up and run DPIMyAss on your local machine and server.

Build it yourself ๐Ÿ”จ

  1. Clone this repo and cd into it
  2. Build the project:
cargo build --release
  1. Run DPIMyAss:
./target/build/dpimyass [config.toml]

Docker ๐Ÿ‹

  1. Clone this repo and cd into it
  2. Edit the config file ./config/config.toml
  3. Run docker-compose up -d, and let docker do all the magic!

Arch Linux ๐Ÿ˜ˆ

Also, if use Arch linux, you can just run makepkg -si in the project root. It will automatically install DPIMyAss systemd service for you.

Configuration โš™๏ธ

DPIMyAss uses a TOML configuration file to specify its settings. Below is an example configuration:

[[servers]]
name = "Example bridge"
key = [239, 42, 13, 69]

[servers.relay]
address = "0.0.0.0:1337"
buffer = 65536
timeout = 60

[servers.upstream]
address = "example.com:1337"
buffer = 65536
timeout = 60

[[servers]]
name = "Another bridge"
key = [4, 5, 11]
first = 64  # Obfuscate only the first 64 bytes

[servers.relay]
address = "0.0.0.0:1338"
buffer = 65536
timeout = 120

[servers.upstream]
address = "endpoint2.exmaple.com:443"
buffer = 65536
timeout = 120

Troubleshooting ๐Ÿช›

You might encounter a problem when trying to use VPN over DPIMyAss hosted on the same machine. To fix this, you have to add an entry to a routing table with the endpoint IP bypassing your VPN. Here are a few examples of how to do this:

Wireguard-specific solution

If your upstream address falls inside the ips listed in wireguard's AllowedIPs, the packets DPIMyAss sends will be routed over VPN too, and thus they will be stuck in a network loop.

The simplest way to fix this is to exclude your upstream endpoint ip address from the wireguard's AllowedIPs. This can be done with any wireguard allowed ips calculator, for example with this one.

Windows

  1. Disable your VPN.
  2. Open PowerShell/CMD as an Administrator.
  3. Run the following command:
route PRINT

Now take a look at the IPv4 Route Table:

IPv4 Route Table

===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0       10.161.8.1       10.161.8.2     35
       10.161.8.0    255.255.252.0         On-link        10.161.8.2    291
       10.161.8.2  255.255.255.255         On-link        10.161.8.2    291
    10.161.11.255  255.255.255.255         On-link        10.161.8.2    291
        127.0.0.0        255.0.0.0         On-link         127.0.0.1    331

        127.0.0.1  255.255.255.255         On-link         127.0.0.1    331
  127.255.255.255  255.255.255.255         On-link         127.0.0.1    331
       172.25.0.0    255.255.240.0         On-link        172.25.0.1   5256
       172.25.0.1  255.255.255.255         On-link        172.25.0.1   5256
    172.25.15.255  255.255.255.255         On-link        172.25.0.1   5256
        224.0.0.0        240.0.0.0         On-link         127.0.0.1    331
        224.0.0.0        240.0.0.0         On-link        172.25.0.1   5256
        224.0.0.0        240.0.0.0         On-link        10.161.8.2    291

  255.255.255.255  255.255.255.255         On-link         127.0.0.1    331
  255.255.255.255  255.255.255.255         On-link        172.25.0.1   5256
  255.255.255.255  255.255.255.255         On-link        10.161.8.2    291
===========================================================================

Notice the line with Network Destination 0.0.0.0, and remember the Gateway IP (10.161.8.1 in this case).

  1. Execute the following command:
route ADD <endpoint_ip> MASK 255.255.255.255 <gateway_ip>

where <endpoint_ip> is the IP of your VPN, and <gateway_ip> is the IP from step 3.

  1. If everything has worked, you will see OK! in your terminal window. You can close it now and try connecting again.

Linux

For this example, we will use Debian 12, although the commands listed below should work on most modern distributions. For older distros, I advise you to consult your distro's manual.

  1. Disable your VPN.
  2. Open up your favorite terminal emulator and run ip route:
ip route

Example output of that command:

default via 172.25.0.1 dev eth0 proto kernel
172.25.0.0/20 dev eth0 proto kernel scope link src 172.25.4.60

Remember the default gateway (172.25.0.1 in this case).

  1. Run the following command:
sudo ip route add <endpoint_ip> via <gateway_ip>

If the command above has worked, you won't see anything in your terminal.

  1. Verify that the route has been created, by running:
ip route

Route you have just created should be listed

default via 172.25.0.1 dev eth0 proto kernel
1.1.1.1 via 172.25.0.1 dev eth0                                  <-- This is the one!
172.25.0.0/20 dev eth0 proto kernel scope link src 172.25.4.60

Done! Now you can try to connect again.

dpimyass's People

Contributors

mrsobakin avatar wzrayyy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

joesuperstar

dpimyass's Issues

Setup Example Needed for Tunneling Between Servers with DPIMyAss

First off, thanks for this fantastic tool. I'm trying to establish a reliable UDP tunnel between two of my servers located in different geographic regions (Russia and Finland), which are part of my Tailscale network. The traffic from the server in Russia is subjected to DPI, causing a noticeable degradation in speed. I want to use DPIMyAss to bypass these restrictions by tunneling the traffic.

I'm a bit stuck on setting this up correctly and would really appreciate if someone could provide a detailed example, including:

  • Configuration File for Server 1 (Russia): What settings would be optimal considering the DPI?
  • IPTables Rules for Server 1: Necessary rules to route traffic through the proxy.
  • Configuration File for Server 2 (Finland): Recommended configuration to receive and forward traffic effectively.
  • IPTables Rules for Server 2: Ensuring the traffic from Server 1 is accepted and routed correctly.

Thank you in advance for your time and help!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.