Saturday, August 3, 2024

Bypass DPI on Linux

UPDATE as of 08/06/24  Bypass DPI on Arch Hyprland

Deployed via https://github.com/mylinuxforwork/dotfiles

https://dbaxps.blogspot.com/2024/08/bypass-dpi-on-arch-hyprland.html

END UPDATE

Following below is an implementation of some DPI bypass methods.The program is a local SOCKS proxy server.

A SOCKS proxy is a tool that allows you to route your internet traffic through a remote server, providing you with anonymity and the ability to bypass restrictions. It acts as a mediator between your device and the websites or services you want to access. When you send a request to access a website, the request is first sent to the SOCKS proxy server.

The proxy server then forwards your request to the website on your behalf, using the SOCKS protocol. This protocol enables the proxy server to establish a TCP connection with the website and pass the data between the two. By using a SOCKS proxy, your real IP address is hidden, and your network traffic appears to be originating from the proxy server, enhancing your online privacy. Additionally, they support various authentication methods, ensuring secure communication between your device and the proxy server.

Download zip-arcihve from https://github.com/hufrea/byedpi


Usage example:
ciadpi --disorder 1 --auto=torst --tlsrec 1+s
ciadpi --fake -1 --ttl 8












boris@fedora:~/Downloads$ unzip byedpi-main.zip

Archive:  byedpi-main.zip

6325488e028604e2f967f750055c570eeac00dac

   creating: byedpi-main/

 extracting: byedpi-main/.gitignore  

  inflating: byedpi-main/Makefile    

  inflating: byedpi-main/conev.c     

  inflating: byedpi-main/conev.h     

  inflating: byedpi-main/desync.c    

  inflating: byedpi-main/desync.h    

   creating: byedpi-main/dist/

   creating: byedpi-main/dist/windows/

  inflating: byedpi-main/dist/windows/byedpi.bat  

  inflating: byedpi-main/dist/windows/service_delete.bat  

  inflating: byedpi-main/dist/windows/service_install.bat  

  inflating: byedpi-main/dist/windows/service_restart.bat  

  inflating: byedpi-main/error.h     

  inflating: byedpi-main/extend.c    

  inflating: byedpi-main/extend.h    

  inflating: byedpi-main/kavl.h      

  inflating: byedpi-main/main.c      

  inflating: byedpi-main/mpool.c     

  inflating: byedpi-main/mpool.h     

  inflating: byedpi-main/packets.c   

  inflating: byedpi-main/packets.h   

  inflating: byedpi-main/params.h    

  inflating: byedpi-main/proxy.c     

  inflating: byedpi-main/proxy.h     

  inflating: byedpi-main/readme.txt  

  inflating: byedpi-main/win_service.c  

  inflating: byedpi-main/win_service.h  

boris@fedora:~/Downloads$ cd *main

boris@fedora:~/Downloads/byedpi-main$ ll

total 180

-rw-r--r--. 1 boris boris  5202 Aug  1 20:45 conev.c

-rw-r--r--. 1 boris boris  2007 Aug  1 20:45 conev.h

-rw-r--r--. 1 boris boris 14645 Aug  1 20:45 desync.c

-rw-r--r--. 1 boris boris   361 Aug  1 20:45 desync.h

drwxr-xr-x. 1 boris boris    14 Aug  1 20:45 dist

-rw-r--r--. 1 boris boris  1731 Aug  1 20:45 error.h

-rw-r--r--. 1 boris boris 10814 Aug  1 20:45 extend.c

-rw-r--r--. 1 boris boris   532 Aug  1 20:45 extend.h

-rw-r--r--. 1 boris boris 13229 Aug  1 20:45 kavl.h

-rw-r--r--. 1 boris boris 22060 Aug  1 20:45 main.c

-rw-r--r--. 1 boris boris   342 Aug  1 20:45 Makefile

-rw-r--r--. 1 boris boris  1890 Aug  1 20:45 mpool.c

-rw-r--r--. 1 boris boris   476 Aug  1 20:45 mpool.h

-rw-r--r--. 1 boris boris 10294 Aug  1 20:45 packets.c

-rw-r--r--. 1 boris boris  1045 Aug  1 20:45 packets.h

-rw-r--r--. 1 boris boris  1800 Aug  1 20:45 params.h

-rw-r--r--. 1 boris boris 25119 Aug  1 20:45 proxy.c

-rw-r--r--. 1 boris boris  1909 Aug  1 20:45 proxy.h

-rw-r--r--. 1 boris boris 14167 Aug  1 20:45 readme.txt

-rw-r--r--. 1 boris boris  2439 Aug  1 20:45 win_service.c

-rw-r--r--. 1 boris boris    44 Aug  1 20:45 win_service.h

boris@fedora:~/Downloads/byedpi-main$ make -j4

cc -std=c99 -O2 -D_XOPEN_SOURCE=500  packets.c main.c conev.c proxy.c desync.c mpool.c extend.c -I . -o ciadpi

boris@fedora:~/Downloads/byedpi-main$ ll

total 248

-rwxr-xr-x. 1 boris boris 66752 Aug  3 15:56 ciadpi

-rw-r--r--. 1 boris boris  5202 Aug  1 20:45 conev.c

-rw-r--r--. 1 boris boris  2007 Aug  1 20:45 conev.h

-rw-r--r--. 1 boris boris 14645 Aug  1 20:45 desync.c

-rw-r--r--. 1 boris boris   361 Aug  1 20:45 desync.h

drwxr-xr-x. 1 boris boris    14 Aug  1 20:45 dist

-rw-r--r--. 1 boris boris  1731 Aug  1 20:45 error.h

-rw-r--r--. 1 boris boris 10814 Aug  1 20:45 extend.c

-rw-r--r--. 1 boris boris   532 Aug  1 20:45 extend.h

-rw-r--r--. 1 boris boris 13229 Aug  1 20:45 kavl.h

-rw-r--r--. 1 boris boris 22060 Aug  1 20:45 main.c

-rw-r--r--. 1 boris boris   342 Aug  1 20:45 Makefile

-rw-r--r--. 1 boris boris  1890 Aug  1 20:45 mpool.c

-rw-r--r--. 1 boris boris   476 Aug  1 20:45 mpool.h

-rw-r--r--. 1 boris boris 10294 Aug  1 20:45 packets.c

-rw-r--r--. 1 boris boris  1045 Aug  1 20:45 packets.h

-rw-r--r--. 1 boris boris  1800 Aug  1 20:45 params.h

-rw-r--r--. 1 boris boris 25119 Aug  1 20:45 proxy.c

-rw-r--r--. 1 boris boris  1909 Aug  1 20:45 proxy.h

-rw-r--r--. 1 boris boris 14167 Aug  1 20:45 readme.txt

-rw-r--r--. 1 boris boris  2439 Aug  1 20:45 win_service.c

-rw-r--r--. 1 boris boris    44 Aug  1 20:45 win_service.h

boris@fedora:~/Downloads/byedpi-main$ vi *.txt

boris@fedora:~/Downloads/byedpi-main$ ./ciadpi --disorder 1 --auto=torst --tlsrec 1+s &

[1] 24201

boris@fedora:~/Downloads/byedpi-main$ ps

    PID TTY          TIME CMD

  24094 pts/0    00:00:00 bash

  24201 pts/0    00:00:00 ciadpi

  24206 pts/0    00:00:00 ps

Firefox Proxy Config













Another attempt

boris@fedora40Plasma604:~/Downloads/byedpi-main/byedpi$ ./ciadpi --auto=torst --tlsrec 1+s  --split 7 --disorder 23 &
[1] 13349
boris@fedora40Plasma604:~/Downloads/byedpi-main/byedpi$ ps
    PID TTY          TIME CMD
   7850 pts/0    00:00:00 bash
  13349 pts/0    00:00:00 ciadpi
  13354 pts/0    00:00:00 ps
boris@fedora40Plasma604:~/Downloads/byedpi-main/byedpi$ sudo netstat -antp|grep 1080
[sudo] password for boris: 
tcp        0      0 0.0.0.0:1080            0.0.0.0:*               LISTEN      13349/./ciadpi 



Final step would be to create service ciadpi.serivce , enable it and restart the box to make sure

$ cat ciadpi.service

[Unit]

Description=Script Daemon For Test User Services

[Service]

Type=simple

#User=

#Group=

ExecStart=/home/boris/Downloads/byedpi-main/ciadpi  --disorder 1 --auto=torst --tlsrec 1+s 

Restart=on-failure

StandardOutput=file:%h/log_file

[Install]

WantedBy=default.target


Next step:


$ sudo cp ciadpi.service  /etc/systemd/user/

systemctl --user daemon-reload

systemctl --user start ciadpi.service

$ systemctl --user enable ciadpi.service


boris@fedora:~$ systemctl --user status ciadpi.service
● ciadpi.service - Script Daemon For ciadpi
     Loaded: loaded (/etc/xdg/systemd/user/ciadpi.service; enabled; preset: disabled)
    Drop-In: /usr/lib/systemd/user/service.d
             └─10-timeout-abort.conf
     Active: active (running) since Sat 2024-08-03 21:43:16 MSK; 42s ago
   Main PID: 2464 (ciadpi)
      Tasks: 1 (limit: 38309)
     Memory: 328.0K (peak: 1.5M)
        CPU: 7ms
CGroup: /user.slice/user-1000.slice/user@1000.service/app.slice/ciadpi.service
             └─10771 /home/boris/Downloads/byedpi-main/ciadpi --disorder 1 --auto=torst --tlsrec>

Aug 03 21:43:16 fedora systemd[2428]: Started ciadpi.service - Script Daemon For ciadpi.

boris@fedora:~/Downloads/byedpi-main$ netstat -antp|grep 1080
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 0.0.0.0:1080            0.0.0.0:*               LISTEN      2470/ciadpi         
tcp        0      0 127.0.0.1:1080          127.0.0.1:49694         ESTABLISHED 2470/ciadpi         
tcp        0      0 127.0.0.1:58020         127.0.0.1:1080          ESTABLISHED 7675/firefox        
tcp        0      0 127.0.0.1:1080          127.0.0.1:42404         ESTABLISHED 2470/ciadpi         
tcp        0      0 127.0.0.1:1080          127.0.0.1:52208         ESTABLISHED 2470/ciadpi         
tcp        0      0 127.0.0.1:58014         127.0.0.1:1080          ESTABLISHED 7675/firefox        
tcp        0      0 127.0.0.1:52208         127.0.0.1:1080          ESTABLISHED 7675/firefox        
tcp        0      0 127.0.0.1:1080          127.0.0.1:58020         ESTABLISHED 2470/ciadpi         
tcp        0      0 127.0.0.1:42404         127.0.0.1:1080          ESTABLISHED 7675/firefox        
tcp        0      0 127.0.0.1:49694         127.0.0.1:1080          ESTABLISHED 7675/firefox        
tcp        0      0 127.0.0.1:1080          127.0.0.1:58014 
ESTABLISHED 2470/ciadpi  

Proxy Switch on Google Chrome





















References

No comments:

Post a Comment