change
This commit is contained in:
+14
-14
@@ -6,7 +6,7 @@ On Linux with root, enables raw packet injection for the seq_id trick.
|
||||
|
||||
Usage:
|
||||
snispf --config config.json
|
||||
snispf --listen 0.0.0.0:40443 --connect 188.114.98.0:443 --sni auth.vercel.com
|
||||
snispf --listen 0.0.0.0:40443 --connect 5.10.249.0:443 --sni vercel.com
|
||||
"""
|
||||
|
||||
import argparse
|
||||
@@ -90,10 +90,10 @@ def setup_logging(verbose: bool = False, quiet: bool = False):
|
||||
DEFAULT_CONFIG = {
|
||||
"LISTEN_HOST": "0.0.0.0",
|
||||
"LISTEN_PORT": 40443,
|
||||
"CONNECT_IP": "188.114.98.0",
|
||||
"CONNECT_IP": "5.10.249.0",
|
||||
"CONNECT_PORT": 443,
|
||||
"FAKE_SNI": "auth.vercel.com",
|
||||
"BYPASS_METHOD": "fragment",
|
||||
"FAKE_SNI": "vercel.com",
|
||||
"BYPASS_METHOD": "fake_sni",
|
||||
"FRAGMENT_STRATEGY": "sni_split",
|
||||
"FRAGMENT_DELAY": 0.1,
|
||||
"USE_TTL_TRICK": False,
|
||||
@@ -124,10 +124,10 @@ def generate_config(output_path: str):
|
||||
config = {
|
||||
"LISTEN_HOST": "0.0.0.0",
|
||||
"LISTEN_PORT": 40443,
|
||||
"CONNECT_IP": "188.114.98.0",
|
||||
"CONNECT_IP": "5.10.249.0",
|
||||
"CONNECT_PORT": 443,
|
||||
"FAKE_SNI": "auth.vercel.com",
|
||||
"BYPASS_METHOD": "fragment",
|
||||
"FAKE_SNI": "vercel.com",
|
||||
"BYPASS_METHOD": "fake_sni",
|
||||
"FRAGMENT_STRATEGY": "sni_split",
|
||||
"FRAGMENT_DELAY": 0.1,
|
||||
"USE_TTL_TRICK": False,
|
||||
@@ -152,7 +152,7 @@ def build_strategy(config: dict, raw_injector=None) -> BypassStrategy:
|
||||
for the seq_id trick; falls back to fragmentation without them)
|
||||
- "combined": Both fragmentation and fake SNI (recommended)
|
||||
"""
|
||||
method = config.get("BYPASS_METHOD", "fragment").lower()
|
||||
method = config.get("BYPASS_METHOD", "fake_sni").lower()
|
||||
|
||||
if method == "fragment":
|
||||
return FragmentBypass(
|
||||
@@ -192,8 +192,8 @@ def parse_args():
|
||||
epilog=(
|
||||
"Examples:\n"
|
||||
" %(prog)s --config config.json\n"
|
||||
" %(prog)s -l 0.0.0.0:40443 -c 188.114.98.0:443 -s auth.vercel.com\n"
|
||||
" %(prog)s -l :40443 -c 188.114.98.0:443 -s dl.google.com -m combined\n"
|
||||
" %(prog)s -l 0.0.0.0:40443 -c 5.10.249.0:443 -s vercel.com\n"
|
||||
" %(prog)s -l :40443 -c 5.10.249.0:443 -s dl.google.com -m combined\n"
|
||||
" %(prog)s --generate-config my_config.json\n"
|
||||
"\nBypass Methods:\n"
|
||||
" fragment - Fragment TLS ClientHello at SNI boundary (default)\n"
|
||||
@@ -228,12 +228,12 @@ def parse_args():
|
||||
parser.add_argument(
|
||||
"--connect", "-c",
|
||||
metavar="IP:PORT",
|
||||
help="Target server address (default: 188.114.98.0:443)",
|
||||
help="Target server address (default: 5.10.249.0:443)",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--sni", "-s",
|
||||
metavar="HOSTNAME",
|
||||
help="Fake SNI hostname (default: auth.vercel.com)",
|
||||
help="Fake SNI hostname (default: vercel.com)",
|
||||
)
|
||||
|
||||
# Bypass settings
|
||||
@@ -372,7 +372,7 @@ def main():
|
||||
config["LISTEN_PORT"] = port
|
||||
|
||||
if args.connect:
|
||||
host, port = parse_host_port(args.connect, "188.114.98.0", 443)
|
||||
host, port = parse_host_port(args.connect, "5.10.249.0", 443)
|
||||
config["CONNECT_IP"] = host
|
||||
config["CONNECT_PORT"] = port
|
||||
|
||||
@@ -410,7 +410,7 @@ def main():
|
||||
# Try to start raw injector (Linux + root only)
|
||||
raw_injector = None
|
||||
use_raw = not getattr(args, 'no_raw', False)
|
||||
method = config.get("BYPASS_METHOD", "fragment").lower()
|
||||
method = config.get("BYPASS_METHOD", "fake_sni").lower()
|
||||
|
||||
if use_raw and method in ("fake_sni", "combined") and interface_ip:
|
||||
if is_raw_available():
|
||||
|
||||
Reference in New Issue
Block a user