Skip to content

Latest commit

 

History

History
231 lines (163 loc) · 4.63 KB

File metadata and controls

231 lines (163 loc) · 4.63 KB

Setup Guide

Installation

Pre-built Binaries

Download the latest release from the Releases page.

Build from Source

Requirements: Go 1.22 or later.

git clone https://github.com/bypasscore/sni-cloak.git
cd sni-cloak
make build

The binary will be in bin/sni-cloak.

Cross-compile

# Linux
make build-linux

# Windows
make build-windows

# All platforms
make build-all

Quick Start

SOCKS5 Mode (Recommended)

The simplest way to use sni-cloak. It runs a local SOCKS5 proxy that intercepts TLS connections.

# Start with YouTube profile
./sni-cloak --profile youtube

# Start with custom settings
./sni-cloak --mode socks5 --listen 127.0.0.1:1080 --fragment random --desync split

Then configure your browser to use the SOCKS5 proxy at 127.0.0.1:1080.

Browser Configuration

Firefox:

  1. Go to Settings > Network Settings
  2. Select "Manual proxy configuration"
  3. SOCKS Host: 127.0.0.1, Port: 1080
  4. Select "SOCKS v5"
  5. Check "Proxy DNS when using SOCKS v5"

Chrome/Chromium:

chrome --proxy-server="socks5://127.0.0.1:1080"

System-wide (Linux):

export ALL_PROXY=socks5://127.0.0.1:1080

Transparent Mode (Linux)

Transparent mode intercepts all HTTPS traffic without requiring browser configuration.

# Start in transparent mode (requires root)
sudo ./sni-cloak --mode transparent --listen 0.0.0.0:8443 --profile youtube

# The tool will set up iptables rules automatically.
# To set up rules manually:
sudo iptables -t nat -A OUTPUT -p tcp --dport 443 -j REDIRECT --to-port 8443
sudo iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-port 8443

Transparent Mode (Windows)

On Windows, transparent mode uses WinDivert to intercept packets at the kernel level.

  1. Download WinDivert and place WinDivert.dll and WinDivert64.sys in the same directory as sni-cloak.exe.
  2. Run as Administrator:
.\sni-cloak.exe --mode transparent --profile youtube

Configuration

Configuration File

Create a YAML configuration file:

mode: socks5

listen:
  address: "127.0.0.1"
  port: 1080
  socks5: true
  max_connections: 1024

evasion:
  fragment:
    enabled: true
    strategy: "random"
    count: 3
    delay_ms: 50

  desync:
    enabled: true
    method: "split"
    delay_ms: 100

  padding:
    enabled: true
    strategy: "to_size"
    target_size: 517

  sni:
    enabled: true
    trick: "mixed_case"

dns:
  use_doh: true
  doh_url: "https://1.1.1.1/dns-query"

logging:
  level: "info"

Run with:

./sni-cloak --config config.yaml

Profiles

sni-cloak includes built-in profiles optimized for specific services:

# List available profiles
./sni-cloak --list-profiles

# Use a profile
./sni-cloak --profile youtube
./sni-cloak --profile discord
./sni-cloak --profile aggressive

You can also create custom profiles as YAML files in config/profiles/.

CLI Overrides

CLI flags override configuration file settings:

./sni-cloak --config config.yaml --fragment multi --desync fake --block-quic

Troubleshooting

YouTube not loading

  1. Make sure QUIC is blocked: --block-quic
  2. Try the aggressive profile: --profile aggressive
  3. Enable debug logging: --log-level debug
  4. Try different desync methods: --desync fake or --desync disorder

Connection timeouts

  1. Increase the fragment delay: configure delay_ms to 100-200
  2. Try fewer fragments: set count to 2
  3. Check if your ISP uses TCP reassembly (may need desync instead of fragment)

Discord voice not working

  1. Discord voice uses UDP/QUIC. Make sure to block QUIC so it falls back to TCP.
  2. Use the discord profile which is optimized for this.

Checking if it works

# Start with debug logging
./sni-cloak --profile youtube --log-level debug

# In another terminal, test with curl
curl -x socks5://127.0.0.1:1080 https://www.youtube.com -v

Running as a Service

Linux (systemd)

Create /etc/systemd/system/sni-cloak.service:

[Unit]
Description=sni-cloak DPI bypass
After=network.target

[Service]
Type=simple
ExecStart=/usr/local/bin/sni-cloak --config /etc/sni-cloak/config.yaml
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target
sudo systemctl enable sni-cloak
sudo systemctl start sni-cloak

Windows (Task Scheduler)

  1. Open Task Scheduler
  2. Create Basic Task
  3. Trigger: "When the computer starts"
  4. Action: Start a Program
  5. Program: path to sni-cloak.exe
  6. Arguments: --config C:\sni-cloak\config.yaml
  7. Check "Run with highest privileges"