### Install and run soar-server for Soar profiles Source: https://github.com/anonvector/slipnet/blob/main/README.md Install the soar-server binary, generate a private key, and start the server for a delegated zone. Defaults restrict streams to public addresses on ports 80 and 443; for Soar + SSH, add -allow-private -allow-ports 22,80,443 (with your SSH port). Note that -allow-private exposes private addresses to anyone holding the server's public key. ```sh go install github.com/getlantern/soar/cmd/soar-server@latest (umask 077; soar-server keygen | awk '$1 == "private" { print $2 }' > key) soar-server pubkey key # paste this public key into the SlipNet profile soar-server -zone t.example.com -key-file key -listen :53 ``` -------------------------------- ### Verify OpenSSL setup Source: https://github.com/anonvector/slipnet/blob/main/README.md Checks that the OpenSSL setup is correct. ```bash ./gradlew verifyOpenSsl ``` -------------------------------- ### Set up OpenSSL for Android Source: https://github.com/anonvector/slipnet/blob/main/README.md Downloads or builds OpenSSL for Android. Installs to ~/android-openssl/android-ssl/. ```bash ./gradlew setupOpenSsl ``` -------------------------------- ### Server example in C Source: https://github.com/anonvector/slipnet/blob/main/app/src/main/cpp/hev-socks5-tunnel-src/src/core/README.md Sets up a SOCKS5 server listening on port 1080 using HevSocks5Core. Requires HevTaskSystem. The server accepts connections and runs each in a new task. ```c #include #include #include #include #include #include #include static void server_entry (void *data) { HevSocks5Server *server = data; hev_socks5_server_run (server); hev_object_unref (HEV_OBJECT (server)); } static void listener_entry (void *data) { struct addrinfo hints = { 0 }; struct addrinfo *result; int fd; hints.ai_family = AF_INET6; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_PASSIVE; hev_task_dns_getaddrinfo (NULL, "1080", &hints, &result); fd = hev_task_io_socket_socket (AF_INET6, SOCK_STREAM, 0); bind (fd, result->ai_addr, result->ai_addrlen); freeaddrinfo (result); listen (fd, 5); hev_task_add_fd (hev_task_self (), fd, POLLIN); for (;;) { HevSocks5Server *server; HevTask *task; int nfd; nfd = hev_task_io_socket_accept (fd, NULL, NULL, NULL, NULL); task = hev_task_new (-1); server = hev_socks5_server_new (nfd); hev_task_run (task, server_entry, server); } close (fd); } int main (int argc, char *argv[]) { HevTask *task; hev_task_system_init (); task = hev_task_new (-1); hev_task_run (task, listener_entry, NULL); hev_task_system_run (); hev_task_system_fini (); return 0; } ``` -------------------------------- ### Install Rust via rustup Source: https://github.com/anonvector/slipnet/blob/main/README.md Prerequisite for building the Android app. Installs the Rust toolchain using the official rustup script. ```bash curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ``` -------------------------------- ### CLI usage examples Source: https://github.com/anonvector/slipnet/blob/main/README.md Shows various CLI invocations: basic, custom DNS, custom port, query size limits, padding, and version. ```bash # Basic usage — auto-detects server if DNS delegation isn't set up ./slipnet 'slipnet://BASE64...' ``` ```bash # Specify a custom DNS resolver ./slipnet --dns 1.1.1.1 'slipnet://BASE64...' ``` ```bash # Use a custom local proxy port ./slipnet --port 9050 'slipnet://BASE64...' ``` ```bash # Limit DNS query size (smaller = stealthier, slower) # Presets: 100 (large), 80 (medium), 60 (small), 50 (minimum) ./slipnet --max-query-size 80 'slipnet://BASE64...' ``` ```bash # Randomize query size with padding (e.g. 50–70 byte queries) ./slipnet --max-query-size 50 --query-padding 20 'slipnet://BASE64...' ``` ```bash # Show version ./slipnet --version ``` -------------------------------- ### Launch Chrome with SOCKS5 proxy Source: https://github.com/anonvector/slipnet/blob/main/README.md Starts Chrome using the local SOCKS5 proxy. ```bash google-chrome --proxy-server="socks5://127.0.0.1:1080" ``` -------------------------------- ### Start a Wintun session with WintunStartSession Source: https://github.com/anonvector/slipnet/blob/main/app/src/main/cpp/hev-socks5-tunnel-src/third-part/wintun/README.md Starts a session on an existing adapter with a ring capacity of 0x400000 bytes. This session is required for sending and receiving packets. ```C WINTUN_SESSION_HANDLE Session = WintunStartSession(Adapter2, 0x400000); ``` -------------------------------- ### WintunStartSession() Source: https://github.com/anonvector/slipnet/blob/main/app/src/main/cpp/hev-socks5-tunnel-src/third-part/wintun/README.md Starts a Wintun session. Returns a session handle that must be released with WintunEndSession. ```APIDOC ## WintunStartSession() ### Description Starts Wintun session. ### Signature `WINTUN_SESSION_HANDLE WintunStartSession (WINTUN_ADAPTER_HANDLE Adapter, DWORD Capacity)` ### Parameters - **Adapter** (WINTUN_ADAPTER_HANDLE) - Required - Adapter handle obtained with WintunOpenAdapter or WintunCreateAdapter - **Capacity** (DWORD) - Required - Rings capacity. Must be between WINTUN_MIN_RING_CAPACITY and WINTUN_MAX_RING_CAPACITY (incl.) Must be a power of two. ### Returns Wintun session handle. Must be released with WintunEndSession. If the function fails, the return value is NULL. To get extended error information, call GetLastError. ``` -------------------------------- ### Client example in C Source: https://github.com/anonvector/slipnet/blob/main/app/src/main/cpp/hev-socks5-tunnel-src/src/core/README.md Shows TCP and UDP client usage. TCP connects to www.google.com:443 via a SOCKS5 proxy at 127.0.0.1:1080. UDP uses UDP-in-TCP mode. Requires HevTaskSystem. ```c #include #include #include #include #include static void tcp_client_entry (void *data) { HevSocks5ClientTCP *tcp; tcp = hev_socks5_client_tcp_new_name ("www.google.com", 443); hev_socks5_client_connect (HEV_SOCKS5_CLIENT (tcp), "127.0.0.1", 1080); hev_socks5_client_handshake (HEV_SOCKS5_CLIENT (tcp)); /* * splice data to/from a socket fd: * hev_socks5_tcp_splice (HEV_SOCKS5_TCP (tcp), fd); */ hev_object_unref (HEV_OBJECT (tcp)); } static void udp_client_entry (void *data) { HevSocks5ClientUDP *udp; udp = hev_socks5_client_udp_new (HEV_SOCKS5_TYPE_UDP_IN_TCP); hev_socks5_client_connect (HEV_SOCKS5_CLIENT (udp), "127.0.0.1", 1080); hev_socks5_client_handshake (HEV_SOCKS5_CLIENT (udp)); /* * HevSocks5UDPMsg msgv[num]; * * send udp packets: * hev_socks5_udp_sendmmsg (HEV_SOCKS5_UDP (udp), msgv, num); * * recv udp packets: * hev_socks5_udp_recvmmsg (HEV_SOCKS5_UDP (udp), msgv, num, 0); */ hev_object_unref (HEV_OBJECT (udp)); } int main (int argc, char *argv[]) { HevTask *task; hev_task_system_init (); task = hev_task_new (-1); hev_task_run (task, tcp_client_entry, NULL); task = hev_task_new (-1); hev_task_run (task, udp_client_entry, NULL); hev_task_system_run (); hev_task_system_fini (); return 0; } ``` -------------------------------- ### hev_socks5_tunnel_main_from_str Source: https://github.com/anonvector/slipnet/blob/main/app/src/main/cpp/hev-socks5-tunnel-src/README.md Starts and runs the SOCKS5 tunnel from a string configuration, blocking until quit is called or an error occurs. ```APIDOC ## hev_socks5_tunnel_main_from_str ### Description Start and run the socks5 tunnel, this function will blocks until the hev_socks5_tunnel_quit is called or an error occurs. ### Function Signature ```c int hev_socks5_tunnel_main_from_str (const unsigned char *config_str, unsigned int config_len, int tun_fd); ``` ### Parameters - **config_str** (const unsigned char*) - Required - String config - **config_len** (unsigned int) - Required - The byte length of string config - **tun_fd** (int) - Required - Tunnel file descriptor ### Return Value - Returns zero on successful, otherwise returns -1. ### Since 2.6.7 ``` -------------------------------- ### WintunGetReadWaitEvent() Source: https://github.com/anonvector/slipnet/blob/main/app/src/main/cpp/hev-socks5-tunnel-src/third-part/wintun/README.md Gets Wintun session's read-wait event handle. ```APIDOC ## WintunGetReadWaitEvent() ### Description Gets Wintun session's read-wait event handle. ### Signature `HANDLE WintunGetReadWaitEvent (WINTUN_SESSION_HANDLE Session)` ### Parameters - **Session** (WINTUN_SESSION_HANDLE) - Required - Wintun session handle obtained with WintunStartSession ### Returns Pointer to receive event handle to wait for available data when reading. Should WintunReceivePackets return ERROR_NO_MORE_ITEMS (after spinning on it for a while under heavy load), wait for this event to become signaled before retrying WintunReceivePackets. Do not call CloseHandle on this event - it is managed by the session. ``` -------------------------------- ### OpenWrt 24.10+: Install and restart hev-socks5-tunnel Source: https://github.com/anonvector/slipnet/blob/main/app/src/main/cpp/hev-socks5-tunnel-src/README.md Installs the hev-socks5-tunnel package via opkg, then restarts the service after editing /etc/config/hev-socks5-tunnel. ```sh # Install package opkg install hev-socks5-tunnel # Edit /etc/config/hev-socks5-tunnel # Restart service /etc/init.d/hev-socks5-tunnel restart ``` -------------------------------- ### hev_socks5_tunnel_main_from_file Source: https://github.com/anonvector/slipnet/blob/main/app/src/main/cpp/hev-socks5-tunnel-src/README.md Starts and runs the SOCKS5 tunnel from a config file, blocking until quit is called or an error occurs. ```APIDOC ## hev_socks5_tunnel_main_from_file ### Description Start and run the socks5 tunnel, this function will blocks until the hev_socks5_tunnel_quit is called or an error occurs. ### Function Signature ```c int hev_socks5_tunnel_main_from_file (const char *config_path, int tun_fd); ``` ### Parameters - **config_path** (const char*) - Required - Config file path - **tun_fd** (int) - Required - Tunnel file descriptor ### Return Value - Returns zero on successful, otherwise returns -1. ### Since 2.6.7 ``` -------------------------------- ### Create Wintun adapters with WintunCreateAdapter Source: https://github.com/anonvector/slipnet/blob/main/app/src/main/cpp/hev-socks5-tunnel-src/third-part/wintun/README.md Creates three Wintun adapters with different names and fixed GUIDs. The adapter type is "Wintun" and names are e.g. "OfficeNet", "HomeNet", "Data Center". ```C WINTUN_ADAPTER_HANDLE Adapter1 = WintunCreateAdapter(L"OfficeNet", L"Wintun", &SomeFixedGUID1); WINTUN_ADAPTER_HANDLE Adapter2 = WintunCreateAdapter(L"HomeNet", L"Wintun", &SomeFixedGUID2); WINTUN_ADAPTER_HANDLE Adapter3 = WintunCreateAdapter(L"Data Center", L"Wintun", &SomeFixedGUID3); ``` -------------------------------- ### hev_socks5_tunnel_main Source: https://github.com/anonvector/slipnet/blob/main/app/src/main/cpp/hev-socks5-tunnel-src/README.md Starts and runs the SOCKS5 tunnel, blocking until quit is called or an error occurs. Alias of hev_socks5_tunnel_main_from_file. ```APIDOC ## hev_socks5_tunnel_main ### Description Start and run the socks5 tunnel, this function will blocks until the hev_socks5_tunnel_quit is called or an error occurs. Alias of hev_socks5_tunnel_main_from_file. ### Function Signature ```c int hev_socks5_tunnel_main (const char *config_path, int tun_fd); ``` ### Parameters - **config_path** (const char*) - Required - Config file path - **tun_fd** (int) - Required - Tunnel file descriptor ### Return Value - Returns zero on successful, otherwise returns -1. ### Since 2.4.6 ``` -------------------------------- ### hev-socks5-tunnel YAML configuration file Source: https://github.com/anonvector/slipnet/blob/main/app/src/main/cpp/hev-socks5-tunnel-src/README.md Complete YAML configuration example for hev-socks5-tunnel. It defines the tunnel interface (name, MTU, multi-queue, IPv4/IPv6 addresses), Socks5 server settings (port, address, UDP relay mode), and optional commented-out sections for mapdns and misc settings. All commented options are disabled by default; uncomment to enable them. ```yaml tunnel: # Interface name name: tun0 # Interface MTU mtu: 8500 # Multi-queue multi-queue: false # IPv4 address ipv4: 198.18.0.1 # IPv6 address ipv6: 'fc00::1' # Post up script # post-up-script: up.sh # Pre down script # pre-down-script: down.sh socks5: # Socks5 server port port: 1080 # Socks5 server address (ipv4/ipv6) address: 127.0.0.1 # Socks5 UDP relay mode (tcp|udp) udp: 'udp' # Override the UDP address provided by the Socks5 server (ipv4/ipv6) # udp-address: '' # Socks5 handshake using pipeline mode # pipeline: false # Socks5 server username # username: 'username' # Socks5 server password # password: 'password' # Socket mark # mark: 0 #mapdns: # Mapped DNS address # address: 198.18.0.2 # Mapped DNS port # port: 53 # Mapped IP network base # network: 100.64.0.0 # Mapped IP network mask # netmask: 255.192.0.0 # Mapped DNS cache size # cache-size: 10000 #misc: # task stack size (bytes) # task-stack-size: 86016 # tcp buffer size (bytes) # tcp-buffer-size: 65536 # udp socket recv buffer (SO_RCVBUF) size (bytes) # udp-recv-buffer-size: 524288 # number of udp buffers in splice, 1500 bytes per buffer. # udp-copy-buffer-nums: 10 # maximum session count (0: unlimited) # max-session-count: 0 # connect timeout (ms) # connect-timeout: 10000 # TCP read-write timeout (ms) # tcp-read-write-timeout: 300000 # UDP read-write timeout (ms) # udp-read-write-timeout: 60000 # stdout, stderr or file-path # log-file: stderr # debug, info, warn or error # log-level: warn # If present, run as a daemon with this pid file # pid-file: /run/hev-socks5-tunnel.pid # If present, set rlimit nofile; else use default value # limit-nofile: 65535 ``` -------------------------------- ### Linux: Run hev-socks5-tunnel with routing rules Source: https://github.com/anonvector/slipnet/blob/main/app/src/main/cpp/hev-socks5-tunnel-src/README.md Starts the tunnel with socks5.mark set to 438, disables reverse path filtering, and configures routing rules to bypass the upstream socks5 server and route other traffic through tun0. ```bash # Set socks5.mark = 438 bin/hev-socks5-tunnel conf/main.yml # Disable reverse path filter sudo sysctl -w net.ipv4.conf.all.rp_filter=0 sudo sysctl -w net.ipv4.conf.tun0.rp_filter=0 # Bypass upstream socks5 server sudo ip rule add fwmark 438 lookup main pref 10 sudo ip -6 rule add fwmark 438 lookup main pref 10 # Route others sudo ip route add default dev tun0 table 20 sudo ip rule add lookup 20 pref 20 sudo ip -6 route add default dev tun0 table 20 sudo ip -6 rule add lookup 20 pref 20 ``` -------------------------------- ### Docker Compose: Run hev-socks5-tunnel with client Source: https://github.com/anonvector/slipnet/blob/main/app/src/main/cpp/hev-socks5-tunnel-src/README.md Defines a Docker Compose setup with a client service for network testing and a tun service running the hev-socks5-tunnel image, including required capabilities, device, and environment variables for configuration. ```yaml version: "3.9" services: client: image: alpine:latest # just for network testing tty: true # you can test network in terminal depends_on: tun: condition: service_healthy network_mode: "service:tun" tun: image: ghcr.io/heiher/hev-socks5-tunnel:latest # `latest` for the latest published version; `nightly` for the latest source build; `vX.Y.Z` for the specific version cap_add: - NET_ADMIN # needed devices: - /dev/net/tun:/dev/net/tun # needed environment: TUN: tun0 # optional, tun interface name, default `tun0` MTU: 8500 # optional, MTU is MTU, default `8500` IPV4: 198.18.0.1 # optional, tun interface ip, default `198.18.0.1` TABLE: 20 # optional, ip route table id, default `20` MARK: 438 # optional, ip route rule mark, dec or hex format, default `438` SOCKS5_ADDR: a.b.c.d # socks5 proxy server address SOCKS5_PORT: 1080 # socks5 proxy server port SOCKS5_USERNAME: user # optional, socks5 proxy username, only set when need to auth SOCKS5_PASSWORD: pass # optional, socks5 proxy password, only set when need to auth SOCKS5_UDP_MODE: udp # optional, UDP relay mode, default `udp`, other option `tcp` SOCKS5_UDP_ADDR: a.b.c.d # optional, override the UDP address provided by the Socks5 server CONFIG_ROUTES: 1 # optional, set 0 to ignore TABLE, IPV4_INCLUDED_ROUTES and IPV4_EXCLUDED_ROUTES, with MARK defaults to 0 IPV4_INCLUDED_ROUTES: 0.0.0.0/0 # optional, demo means proxy all traffic. for multiple network segments, join with `,` or `\n` IPV4_EXCLUDED_ROUTES: a.b.c.d # optional, demo means exclude traffic from the proxy itself. for multiple network segments, join with `,` or `\n` LOG_LEVEL: warn # optional, default `warn`, other option `debug`/`info`/`error` dns: - 8.8.8.8 ``` -------------------------------- ### DNS Scan: File of Resolver IPs Source: https://github.com/anonvector/slipnet/blob/main/README.md Scans resolvers from a file for DNS tunnel compatibility. Each resolver gets a score from 0–6. ```bash ./slipnet scan --domain t.example.com --ips resolvers.txt ``` -------------------------------- ### Building CLI from Source Source: https://github.com/anonvector/slipnet/blob/main/README.md Clones the repository, initializes submodules, and builds the CLI binary. ```bash git clone https://github.com/anonvector/SlipNet.git cd SlipNet git submodule update --init --recursive cd cli CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o slipnet . ``` -------------------------------- ### Build on Unix Source: https://github.com/anonvector/slipnet/blob/main/app/src/main/cpp/hev-socks5-tunnel-src/third-part/yaml/README.md Clone the repository and run make to build the library on Unix systems. ```bash git clone https://gitlab.com/hev/yaml cd yaml make ``` -------------------------------- ### UDP gateway init, accept, and recv handlers Source: https://github.com/anonvector/slipnet/blob/main/app/src/main/cpp/hev-socks5-tunnel-src/third-part/lwip/README.md Initializes a netif and enables UDP pretending via NETIF_FLAG_PRETEND_UDP. Binds UDP to the netif, then binds to receive packets to other hosts. The accept handler sets up a new UDP PCB for sending and receiving, and the recv handler sends with the real source address using udp_sendfrom. ```c static void gateway_init(void) { // Init netif netif_set_up (&netif); netif_set_link_up (&netif); netif_set_default (&netif); // Allow to pretend UDP on this netif netif_set_flags (&netif, NETIF_FLAG_PRETEND_UDP); udp = udp_new_ip_type (IPADDR_TYPE_ANY); // Bind TCP to netif first udp_bind_netif (udp, &netif); // Bind to receive packets to other hosts udp_bind (udp, NULL, 0); udp_recv (udp, udp_accept_handler, NULL); } static void udp_accept_handler (void *arg, struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *addr, u16_t port) { // Similar to TCP accept, receive packets on new UDP PCB. // @pcb: An new UDP PCB for sending and receiving. // @p: Unused // @addr: Unused // @port: Unused udp_recv (pcb, udp_recv_handler, NULL); } static void udp_recv_handler (void *arg, struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *addr, u16_t port) { // Receive UDP packets // @pcb->local_ip: The real destination address // @pcb->local_port: The real destination port // @pcb->remote_ip: The real source address // @pcb->remote_port: The real source port // @addr: Unused // @port: Unused // Send with source address udp_sendfrom (pcb, p, real_src_ip, real_src_port); pbuf_free (p); } ``` -------------------------------- ### Build on Unix Source: https://github.com/anonvector/slipnet/blob/main/app/src/main/cpp/hev-socks5-tunnel-src/third-part/lwip/README.md Clones the repository and builds with make on Unix systems. ```bash git clone https://gitlab.com/hev/lwip cd lwip make ``` -------------------------------- ### Build on Android Source: https://github.com/anonvector/slipnet/blob/main/app/src/main/cpp/hev-socks5-tunnel-src/third-part/lwip/README.md Creates a directory, clones the repository into a jni subdirectory, and builds with ndk-build. ```bash mkdir lwip cd lwip git clone https://gitlab.com/hev/lwip jni ndk-build ``` -------------------------------- ### Enable test signing for unsigned driver loading Source: https://github.com/anonvector/slipnet/blob/main/app/src/main/cpp/hev-socks5-tunnel-src/third-part/wintun/README.md Run this command as administrator before loading unsigned drivers. Requires a reboot to take effect. ```plaintext bcdedit /set testsigning on ``` -------------------------------- ### Build on Windows Source: https://github.com/anonvector/slipnet/blob/main/app/src/main/cpp/hev-socks5-tunnel-src/third-part/lwip/README.md Clones the repository and builds with make, specifying the cross-compilation prefix for MinGW. ```bash git clone https://gitlab.com/hev/lwip cd lwip make CROSS_PREFIX=x86_64-w64-mingw32- ``` -------------------------------- ### TCP gateway init and accept handler Source: https://github.com/anonvector/slipnet/blob/main/app/src/main/cpp/hev-socks5-tunnel-src/third-part/lwip/README.md Initializes a netif and enables TCP pretending via NETIF_FLAG_PRETEND_TCP. Binds TCP to the netif, then binds to accept incoming connections to other hosts. The accept handler receives the real destination and source addresses and ports in the pcb fields. ```c static void gateway_init(void) { // Init netif netif_set_up (&netif); netif_set_link_up (&netif); netif_set_default (&netif); // Allow to pretend TCP on this netif netif_set_flags (&netif, NETIF_FLAG_PRETEND_TCP); tcp = tcp_new_ip_type (IPADDR_TYPE_ANY); // Bind TCP to netif first tcp_bind_netif (tcp, &netif); // Bind to accept incoming connections to other hosts tcp_bind (tcp, NULL, 0); tcp_listen (tcp); tcp_accept (tcp, tcp_accept_handler); } static err_t tcp_accept_handler (void *arg, struct tcp_pcb *pcb, err_t err) { // Accept new TCP connection // @pcb->local_ip: The real destination address // @pcb->local_port: The real destination port // @pcb->remote_ip: The real source address // @pcb->remote_port: The real source port } ``` -------------------------------- ### Build on Unix Source: https://github.com/anonvector/slipnet/blob/main/app/src/main/cpp/hev-socks5-tunnel-src/third-part/hev-task-system/README.md Commands to clone and build the project on Unix systems. Includes optional flags for linking with librt, disabling stack overflow detection, setting stack backend to heap, disabling sliced memory allocator, disabling I/O splice, and building demos and tests. ```bash git clone https://gitlab.com/hev/hev-task-system cd hev-task-system make # Link with librt (only for glibc versions before 2.17) make LDFLAGS=-lrt # Disable stack overflow detection make ENABLE_STACK_OVERFLOW_DETECTION=0 # Set stack backend to heap (Recommended for 32-bit) make CONFIG_STACK_BACKEND=STACK_HEAP # Disable sliced memory allocator make ENABLE_MEMALLOC_SLICE=0 # Disable I/O splice by splice syscall (for old Linux kernel) make ENABLE_IO_SPLICE_SYSCALL=0 # Demos make apps # Tests make tests ``` -------------------------------- ### Build the Android project Source: https://github.com/anonvector/slipnet/blob/main/README.md Builds the debug APK using Gradle. ```bash ./gradlew assembleDebug ``` -------------------------------- ### Build on Unix Source: https://github.com/anonvector/slipnet/blob/main/app/src/main/cpp/hev-socks5-tunnel-src/README.md Clone the repository recursively and build with make. ```bash git clone --recursive https://github.com/heiher/hev-socks5-tunnel cd hev-socks5-tunnel make ``` -------------------------------- ### Build on Android with ndk-build Source: https://github.com/anonvector/slipnet/blob/main/app/src/main/cpp/hev-socks5-tunnel-src/third-part/yaml/README.md Create a directory, clone the repository into a jni subdirectory, and run ndk-build to build for Android. ```bash mkdir yaml cd yaml git clone https://gitlab.com/hev/yaml jni ndk-build ``` -------------------------------- ### Interactive Mode Menu Source: https://github.com/anonvector/slipnet/blob/main/README.md Running ./slipnet with no arguments launches an interactive menu with all modes accessible via numbered options. ```text 1) Connect (DNSTT / NoizDNS / VayDNS / Slipstream) 2) DNS Scanner 3) DNS Scanner + E2E Test 4) Quick Scan (single IP) 5) Prism (server-verified scan) 6) E2E Test Only 7) Help 0) Exit ``` -------------------------------- ### DNS Scan + E2E: Manual Domain + Pubkey Source: https://github.com/anonvector/slipnet/blob/main/README.md Runs DNS scanning and E2E tests with manual domain and pubkey. ```bash ./slipnet scan --domain t.example.com --ips resolvers.txt --e2e --pubkey HEXKEY ``` -------------------------------- ### Initialize submodules Source: https://github.com/anonvector/slipnet/blob/main/README.md Initializes and updates all git submodules recursively. ```bash git submodule update --init --recursive ``` -------------------------------- ### Build on Windows (MSYS2) Source: https://github.com/anonvector/slipnet/blob/main/app/src/main/cpp/hev-socks5-tunnel-src/README.md Set MSYS environment variable and build with make. ```bash export MSYS=winsymlinks:native git clone --recursive https://github.com/heiher/hev-socks5-tunnel cd hev-socks5-tunnel make ``` -------------------------------- ### Build static and shared libraries Source: https://github.com/anonvector/slipnet/blob/main/app/src/main/cpp/hev-socks5-tunnel-src/README.md Clone the repository and build static or shared library with make. ```bash git clone --recursive https://github.com/heiher/hev-socks5-tunnel cd hev-socks5-tunnel # Static library make static # Shared library make shared ``` -------------------------------- ### Prism: Manual Domain + Pubkey with Custom Probe Settings Source: https://github.com/anonvector/slipnet/blob/main/README.md Sends HMAC-authenticated probes with custom rounds and threshold settings. ```bash ./slipnet scan --domain t.example.com --pubkey HEXKEY --ips resolvers.txt --verify --rounds 5 --threshold 2 ``` -------------------------------- ### WintunCreateAdapter() Source: https://github.com/anonvector/slipnet/blob/main/app/src/main/cpp/hev-socks5-tunnel-src/third-part/wintun/README.md Creates a new Wintun adapter. Returns an adapter handle that must be released with WintunCloseAdapter. ```APIDOC ## WintunCreateAdapter() ### Description Creates a new Wintun adapter. ### Method Function ### Endpoint WintunCreateAdapter ### Parameters - *Name* (const WCHAR*) - Required - The requested name of the adapter. Zero-terminated string of up to MAX_ADAPTER_NAME-1 characters. - *TunnelType* (const WCHAR*) - Required - Name of the adapter tunnel type. Zero-terminated string of up to MAX_ADAPTER_NAME-1 characters. - *RequestedGUID* (const GUID*) - Optional - The GUID of the created network adapter, which then influences NLA generation deterministically. If NULL, the GUID is chosen by the system at random. ### Response #### Success Response - Returns adapter handle (WINTUN_ADAPTER_HANDLE) - Must be released with WintunCloseAdapter. - On failure, returns NULL. To get extended error information, call GetLastError. ``` -------------------------------- ### DNS Scan + E2E: With VayDNS Mode Source: https://github.com/anonvector/slipnet/blob/main/README.md Runs DNS scanning and E2E tests using VayDNS mode. ```bash ./slipnet scan --domain t.example.com --ips resolvers.txt --e2e --pubkey HEXKEY --vaydns ``` -------------------------------- ### Build on iOS and MacOS Source: https://github.com/anonvector/slipnet/blob/main/app/src/main/cpp/hev-socks5-tunnel-src/third-part/hev-task-system/README.md Commands to clone and run the build script that generates HevTaskSystem.xcframework. ```bash git clone https://gitlab.com/hev/hev-task-system cd hev-task-system # will generate HevTaskSystem.xcframework ./build-apple.sh ``` -------------------------------- ### Build on Android Source: https://github.com/anonvector/slipnet/blob/main/app/src/main/cpp/hev-socks5-tunnel-src/third-part/hev-task-system/README.md Commands to clone the repository into a jni directory and build with ndk-build. ```bash mkdir hev-task-system cd hev-task-system git clone https://gitlab.com/hev/hev-task-system jni ndk-build ``` -------------------------------- ### Prism: Using slipnet:// Config Source: https://github.com/anonvector/slipnet/blob/main/README.md Sends HMAC-authenticated probes to verify the tunnel server is genuine. Requires SlipGate running on the server. ```bash ./slipnet scan --config 'slipnet://BASE64...' --ips resolvers.txt --verify ``` -------------------------------- ### Clone the SlipNet repository Source: https://github.com/anonvector/slipnet/blob/main/README.md Clones the repository and changes into the project directory. ```bash git clone https://github.com/anonvector/SlipNet.git cd SlipNet ``` -------------------------------- ### Cross-compile for Windows Source: https://github.com/anonvector/slipnet/blob/main/README.md Cross-compiles the CLI for Windows amd64. ```bash CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o slipnet-windows-amd64.exe . ``` -------------------------------- ### Build on Windows (MSYS2) Source: https://github.com/anonvector/slipnet/blob/main/app/src/main/cpp/hev-socks5-tunnel-src/third-part/hev-task-system/README.md Commands to set MSYS environment variable and build on Windows using MSYS2. ```bash export MSYS=winsymlinks:native git clone https://gitlab.com/hev/hev-task-system cd hev-task-system make ``` -------------------------------- ### DNS Scan + E2E: With NoizDNS Mode Source: https://github.com/anonvector/slipnet/blob/main/README.md Runs DNS scanning and E2E tests using NoizDNS mode. ```bash ./slipnet scan --domain t.example.com --ips resolvers.txt --e2e --pubkey HEXKEY --noizdns ``` -------------------------------- ### WintunOpenAdapter() Source: https://github.com/anonvector/slipnet/blob/main/app/src/main/cpp/hev-socks5-tunnel-src/third-part/wintun/README.md Opens an existing Wintun adapter. Returns an adapter handle that must be released with WintunCloseAdapter. ```APIDOC ## WintunOpenAdapter() ### Description Opens an existing Wintun adapter. ### Method Function ### Endpoint WintunOpenAdapter ### Parameters - *Name* (const WCHAR*) - Required - The requested name of the adapter. Zero-terminated string of up to MAX_ADAPTER_NAME-1 characters. ### Response #### Success Response - Returns adapter handle (WINTUN_ADAPTER_HANDLE) - Must be released with WintunCloseAdapter. - On failure, returns NULL. To get extended error information, call GetLastError. ``` -------------------------------- ### DNS Scan + E2E: Using slipnet:// Config Source: https://github.com/anonvector/slipnet/blob/main/README.md Runs DNS scanning and automatically feeds resolvers meeting the score threshold into E2E tunnel tests. Auto-extracts domain, pubkey, and mode from the config. ```bash ./slipnet scan --config 'slipnet://BASE64...' --ips resolvers.txt ``` -------------------------------- ### Cross-compile for Linux Source: https://github.com/anonvector/slipnet/blob/main/README.md Cross-compiles the CLI for Linux amd64. ```bash CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o slipnet-linux-amd64 . ``` -------------------------------- ### Add Android targets with rustup Source: https://github.com/anonvector/slipnet/blob/main/README.md Adds the required Android compilation targets for the native library. ```bash rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android ``` -------------------------------- ### E2E Test Only: Manual Domain + Pubkey Source: https://github.com/anonvector/slipnet/blob/main/README.md Runs E2E tunnel tests directly with manual domain and pubkey. ```bash ./slipnet scan --domain t.example.com --pubkey HEXKEY --ips resolvers.txt --e2e-only ``` -------------------------------- ### Build on Android Source: https://github.com/anonvector/slipnet/blob/main/app/src/main/cpp/hev-socks5-tunnel-src/README.md Clone the repository into a jni directory and build with ndk-build. ```bash mkdir hev-socks5-tunnel cd hev-socks5-tunnel git clone --recursive https://github.com/heiher/hev-socks5-tunnel jni ndk-build ``` -------------------------------- ### Build on iOS and macOS Source: https://github.com/anonvector/slipnet/blob/main/app/src/main/cpp/hev-socks5-tunnel-src/README.md Clone the repository and run build-apple.sh to generate HevSocks5Tunnel.xcframework. ```bash git clone --recursive https://github.com/heiher/hev-socks5-tunnel cd hev-socks5-tunnel # will generate HevSocks5Tunnel.xcframework ./build-apple.sh ``` -------------------------------- ### E2E Test Only: Using slipnet:// Config Source: https://github.com/anonvector/slipnet/blob/main/README.md Skips DNS scan and runs E2E tunnel tests directly on provided resolvers. ```bash ./slipnet scan --config 'slipnet://BASE64...' --ips resolvers.txt --e2e-only ``` -------------------------------- ### Test SOCKS5 proxy with curl Source: https://github.com/anonvector/slipnet/blob/main/README.md Verifies the local SOCKS5 proxy using curl, with and without authentication. ```bash # Test with curl curl --socks5-hostname 127.0.0.1:1080 https://ifconfig.me ``` ```bash # If the server requires SOCKS5 authentication (username:password) curl --socks5-hostname user:pass@127.0.0.1:1080 https://ifconfig.me ``` -------------------------------- ### WintunSetLogger() Source: https://github.com/anonvector/slipnet/blob/main/app/src/main/cpp/hev-socks5-tunnel-src/third-part/wintun/README.md Sets logger callback function. ```APIDOC ## WintunSetLogger() ### Description Sets logger callback function. ### Method Function ### Endpoint WintunSetLogger ### Parameters - *NewLogger* (WINTUN_LOGGER_CALLBACK) - Required - Pointer to callback function to use as a new global logger. NewLogger may be called from various threads concurrently. Should the logging require serialization, you must handle serialization in NewLogger. Set to NULL to disable. ### Response No return value. ``` -------------------------------- ### WintunGetAdapterLuid() Source: https://github.com/anonvector/slipnet/blob/main/app/src/main/cpp/hev-socks5-tunnel-src/third-part/wintun/README.md Returns the LUID of the adapter. ```APIDOC ## WintunGetAdapterLuid() ### Description Returns the LUID of the adapter. ### Method Function ### Endpoint WintunGetAdapterLuid ### Parameters - *Adapter* (WINTUN_ADAPTER_HANDLE) - Required - Adapter handle obtained with WintunOpenAdapter or WintunCreateAdapter. - *Luid* (NET_LUID*) - Required - Pointer to LUID to receive adapter LUID. ### Response No return value. ``` -------------------------------- ### WintunGetRunningDriverVersion() Source: https://github.com/anonvector/slipnet/blob/main/app/src/main/cpp/hev-socks5-tunnel-src/third-part/wintun/README.md Determines the version of the Wintun driver currently loaded. ```APIDOC ## WintunGetRunningDriverVersion() ### Description Determines the version of the Wintun driver currently loaded. ### Method Function ### Endpoint WintunGetRunningDriverVersion ### Parameters None. ### Response #### Success Response - Returns the version number if the function succeeds. - Returns zero if the function fails. To get extended error information, call GetLastError. Possible errors include: ERROR_FILE_NOT_FOUND - Wintun not loaded. ``` -------------------------------- ### DNS Scan: Built-in Resolver List Source: https://github.com/anonvector/slipnet/blob/main/README.md Uses the built-in resolver list for scanning. ```bash ./slipnet scan --domain t.example.com ``` -------------------------------- ### Cross-compile for macOS Intel Source: https://github.com/anonvector/slipnet/blob/main/README.md Cross-compiles the CLI for macOS Intel (darwin amd64). ```bash CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o slipnet-darwin-amd64 . ``` -------------------------------- ### E2E Test Only: Custom Concurrency and Timeout Source: https://github.com/anonvector/slipnet/blob/main/README.md Runs E2E tunnel tests with custom concurrency and timeout settings. ```bash ./slipnet scan --config 'slipnet://BASE64...' --ips resolvers.txt --e2e-only --e2e-concurrency 20 --e2e-timeout 20000 ``` -------------------------------- ### WintunEndSession() Source: https://github.com/anonvector/slipnet/blob/main/app/src/main/cpp/hev-socks5-tunnel-src/third-part/wintun/README.md Ends a Wintun session. ```APIDOC ## WintunEndSession() ### Description Ends Wintun session. ### Signature `void WintunEndSession (WINTUN_SESSION_HANDLE Session)` ### Parameters - **Session** (WINTUN_SESSION_HANDLE) - Required - Wintun session handle obtained with WintunStartSession ``` -------------------------------- ### SSH over TLS (stunnel-style) - CLI usage Source: https://github.com/anonvector/slipnet/blob/main/README.md Wraps SSH connection in TLS with custom SNI hostname for bypassing DPI that blocks SSH. Auto-detected when config has sshTlsEnabled=true and sshTlsSni set. ```bash # Config has sshTlsEnabled=true, sshTlsSni=cdn.example.com # CLI auto-detects and wraps SSH in TLS ./slipnet 'slipnet://BASE64...' ``` -------------------------------- ### DNS Tunnels (DNSTT, NoizDNS, VayDNS) - CLI usage Source: https://github.com/anonvector/slipnet/blob/main/README.md Commands for DNS tunneling with automatic tunnel type detection. Includes options to override DNS resolver, connect directly, set uTLS fingerprint, and limit query size. ```bash # DNSTT — reliable DNS tunneling (default) ./slipnet 'slipnet://BASE64...' # NoizDNS — DPI-resistant DNS tunneling ./slipnet 'slipnet://BASE64...' # VayDNS — optimized wire format with configurable record types and QNAME ./slipnet 'slipnet://BASE64...' # Override DNS resolver (useful when ISP blocks certain resolvers) ./slipnet --dns 1.1.1.1 'slipnet://BASE64...' # Connect directly to server (bypass recursive resolvers) ./slipnet --direct 'slipnet://BASE64...' # Override uTLS fingerprint for DoH/DoT transports ./slipnet --utls Chrome_120 'slipnet://BASE64...' # Limit query size for restrictive networks ./slipnet --max-query-size 80 'slipnet://BASE64...' ``` -------------------------------- ### DNS + SSH Tunnels (DNSTT+SSH, NoizDNS+SSH, VayDNS+SSH) - CLI usage Source: https://github.com/anonvector/slipnet/blob/main/README.md Commands for SSH chained through DNS tunnels for extra encryption and zero DNS leaks. Includes option to override port and DNS resolver. ```bash # DNS tunnel carries raw SSH — all settings from config ./slipnet 'slipnet://BASE64...' # Override port and DNS resolver ./slipnet --port 9050 --dns 8.8.8.8 'slipnet://BASE64...' ``` -------------------------------- ### Receive packets with WintunReceivePacket and WintunReleaseReceivePacket Source: https://github.com/anonvector/slipnet/blob/main/app/src/main/cpp/hev-socks5-tunnel-src/third-part/wintun/README.md Continuously receives packets, processes them, and releases them. If no more items are available, waits on the read-wait event; on other errors logs and breaks. ```C for (;;) { DWORD IncomingPacketSize; BYTE *IncomingPacket = WintunReceivePacket(Session, &IncomingPacketSize); if (IncomingPacket) { DoSomethingWithPacket(IncomingPacket, IncomingPacketSize); WintunReleaseReceivePacket(Session, IncomingPacket); } else if (GetLastError() == ERROR_NO_MORE_ITEMS) WaitForSingleObject(WintunGetReadWaitEvent(Session), INFINITE); else { Log(L"Packet read failed"); break; } } ``` -------------------------------- ### Docker Compose: Set multiple route segments Source: https://github.com/anonvector/slipnet/blob/main/app/src/main/cpp/hev-socks5-tunnel-src/README.md Shows how to configure IPV4_INCLUDED_ROUTES and IPV4_EXCLUDED_ROUTES with multiple network segments in the environment section of a Docker Compose service. ```yaml environment: IPV4_INCLUDED_ROUTES: 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 IPV4_EXCLUDED_ROUTES: |- a.b.c.d/24 a.b.c.f/24 ``` -------------------------------- ### Send packets with WintunAllocateSendPacket and WintunSendPacket Source: https://github.com/anonvector/slipnet/blob/main/app/src/main/cpp/hev-socks5-tunnel-src/third-part/wintun/README.md Allocates a packet buffer, copies data into it, and sends it. If allocation fails with ERROR_BUFFER_OVERFLOW, the packet is silently dropped; otherwise a log message is written. ```C BYTE *OutgoingPacket = WintunAllocateSendPacket(Session, PacketDataSize); if (OutgoingPacket) { memcpy(OutgoingPacket, PacketData, PacketDataSize); WintunSendPacket(Session, OutgoingPacket); } else if (GetLastError() != ERROR_BUFFER_OVERFLOW) // Silently drop packets if the ring is full Log(L"Packet write failed"); ``` -------------------------------- ### SSH over HTTP CONNECT Proxy - CLI usage Source: https://github.com/anonvector/slipnet/blob/main/README.md Routes SSH through an HTTP CONNECT proxy with support for custom Host headers for CDN-based facades. Config includes sshHttpProxyHost, sshHttpProxyPort, and optional custom Host header. ```bash # Config has sshHttpProxyHost, sshHttpProxyPort, optional custom Host header ./slipnet 'slipnet://BASE64...' ``` -------------------------------- ### Standalone SSH Tunnel - CLI usage Source: https://github.com/anonvector/slipnet/blob/main/README.md Connects directly via SSH and runs a SOCKS5 proxy through the SSH session. Uses native Go SSH, no external ssh or sshpass binaries needed. Includes option for custom local port. ```bash # Plain SSH — credentials and host from config ./slipnet 'slipnet://BASE64...' # Custom local port ./slipnet --port 9050 'slipnet://BASE64...' ``` -------------------------------- ### DNS Scan: Single IP Source: https://github.com/anonvector/slipnet/blob/main/README.md Scans a single resolver IP for DNS tunnel compatibility. ```bash ./slipnet scan --domain t.example.com --ip 8.8.8.8 ``` -------------------------------- ### WintunCloseAdapter() Source: https://github.com/anonvector/slipnet/blob/main/app/src/main/cpp/hev-socks5-tunnel-src/third-part/wintun/README.md Releases Wintun adapter resources and, if the adapter was created with WintunCreateAdapter, removes the adapter. ```APIDOC ## WintunCloseAdapter() ### Description Releases Wintun adapter resources and, if adapter was created with WintunCreateAdapter, removes adapter. ### Method Function ### Endpoint WintunCloseAdapter ### Parameters - *Adapter* (WINTUN_ADAPTER_HANDLE) - Required - Adapter handle obtained with WintunCreateAdapter or WintunOpenAdapter. ### Response No return value. ``` -------------------------------- ### SOCKS5 request format Source: https://github.com/anonvector/slipnet/blob/main/app/src/main/cpp/hev-socks5-tunnel-src/src/core/README.md ASCII diagram of the SOCKS5 request header format. CMD value X'05' indicates UDP-in-TCP mode. ```text +----+-----+-------+------+----------+----------+ |VER | CMD | RSV | ATYP | DST.ADDR | DST.PORT | +----+-----+-------+------+----------+----------+ | 1 | 1 | X'00' | 1 | Variable | 2 | +----+-----+-------+------+----------+----------+ ```