Giter VIP home page Giter VIP logo

klzgrad / naiveproxy Goto Github PK

View Code? Open in Web Editor NEW
6.3K 119.0 870.0 293.8 MB

Make a fortune quietly

License: BSD 3-Clause "New" or "Revised" License

Shell 0.38% C++ 81.55% Python 14.20% Objective-C++ 1.06% C 1.21% Java 0.08% Objective-C 0.31% Assembly 0.02% JavaScript 0.03% Pawn 0.01% HTML 0.04% Makefile 0.01% sed 0.01% Jinja 0.02% Rust 0.10% TypeScript 0.01% POV-Ray SDL 0.10% Starlark 0.51% Handlebars 0.01% nesC 0.35%

naiveproxy's Introduction

NaïveProxy build workflow

NaïveProxy uses Chromium's network stack to camouflage traffic with strong censorship resistence and low detectablility. Reusing Chrome's stack also ensures best practices in performance and security.

The following traffic attacks are mitigated by using Chromium's network stack:

  • Website fingerprinting / traffic classification: mitigated by traffic multiplexing in HTTP/2.
  • TLS parameter fingerprinting: defeated by reusing Chrome's network stack.
  • Active probing: defeated by application fronting, i.e. hiding proxy servers behind a commonly used frontend server with application-layer routing.
  • Length-based traffic analysis: mitigated by length padding.

Architecture

[Browser → Naïve client] ⟶ Censor ⟶ [Frontend → Naïve server] ⟶ Internet

NaïveProxy uses Chromium's network stack to parrot traffic between regular Chrome browsers and standard frontend servers.

The frontend server can be any well-known reverse proxy that is able to route HTTP/2 traffic based on HTTP authorization headers, preventing active probing of proxy existence. Known ones include Caddy with its forwardproxy plugin and HAProxy.

The Naïve server here works as a forward proxy and a packet length padding layer. Caddy forwardproxy is also a forward proxy but it lacks a padding layer. A fork adds the NaïveProxy padding layer to forwardproxy, combining both in one.

Download NaïveProxy

Download here. Supported platforms include: Windows, Android (with NekoBox), Linux, Mac OS, and OpenWrt (support status).

Users should always use the latest version to keep signatures identical to Chrome.

Build from source: Please see .github/workflows/build.yml.

Server setup

The following describes the naïve fork of Caddy forwardproxy setup.

Download here or build from source:

go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest
~/go/bin/xcaddy build --with github.com/caddyserver/forwardproxy=github.com/klzgrad/forwardproxy@naive

Example Caddyfile (replace user and pass accordingly):

{
  order forward_proxy before file_server
}
:443, example.com {
  tls [email protected]
  forward_proxy {
    basic_auth user pass
    hide_ip
    hide_via
    probe_resistance
  }
  file_server {
    root /var/www/html
  }
}

:443 must appear first for this Caddyfile to work. See Caddyfile docs for customizing TLS certificates. For more advanced usage consider using JSON for Caddy 2's config.

Run with the Caddyfile:

sudo setcap cap_net_bind_service=+ep ./caddy
./caddy start

See also Systemd unit example and HAProxy setup.

Client setup

Run ./naive with the following config.json to get a SOCKS5 proxy at local port 1080.

{
  "listen": "socks://127.0.0.1:1080",
  "proxy": "https://user:[email protected]"
}

Or quic://user:[email protected], if it works better. See also parameter usage and performance tuning.

Third-party integration

Notes for downstream

Do not use the master branch to track updates, as it rebases from a new root commit for every new Chrome release. Use stable releases and the associated tags to track new versions, where short release notes are also provided.

Padding protocol, an informal specification

The design of this padding protocol opts for low overhead and easier implementation, in the belief that proliferation of expendable, improvised circumvention protocol designs is a better logistical impediment to censorship research than sophisicated designs.

Proxy payload padding

NaïveProxy proxies bidirectional streams through HTTP/2 (or HTTP/3) CONNECT tunnels. The bidirectional streams operate in a sequence of reads and writes of data. The first kFirstPaddings (8) reads and writes in a bidirectional stream after the stream is established are padded in this format:

struct PaddedData {
  uint8_t original_data_size_high;  // original_data_size / 256
  uint8_t original_data_size_low;  // original_data_size % 256
  uint8_t padding_size;
  uint8_t original_data[original_data_size];
  uint8_t zeros[padding_size];
};

padding_size is a random integer uniformally distributed in [0, kMaxPaddingSize] (kMaxPaddingSize: 255). original_data_size cannot be greater than 65535, or it has to be split into several reads or writes.

kFirstPaddings is chosen to be 8 to flatten the packet length distribution spikes formed from common initial handshakes:

  • Common client initial sequence: 1. TLS ClientHello; 2. TLS ChangeCipherSpec, Finished; 3. H2 Magic, SETTINGS, WINDOW_UPDATE; 4. H2 HEADERS GET; 5. H2 SETTINGS ACK.
  • Common server initial sequence: 1. TLS ServerHello, ChangeCipherSpec, ...; 2. TLS Certificate, ...; 3. H2 SETTINGS; 4. H2 WINDOW_UPDATE; 5. H2 SETTINGS ACK; 6. H2 HEADERS 200 OK.

Further reads and writes after kFirstPaddings are unpadded to avoid performance overhead. Also later packet lengths are usually considered less informative.

H2 RST_STREAM frame padding

In experiments, NaïveProxy tends to send too many RST_STREAM frames per session, an uncommon behavior from regular browsers. To solve this, an END_STREAM DATA frame padded with total length distributed in [48, 72] is prepended to the RST_STREAM frame so it looks like a HEADERS frame. The server often replies to this with a WINDOW_UPDATE because padding is accounted in flow control. Whether this results in a new uncommon behavior is still unclear.

H2 HEADERS frame padding

The CONNECT request and response frames are too short and too uncommon. To make its length similar to realistic HEADERS frames, a padding header is filled with a sequence of symbols that are not Huffman coded and are pseudo-random enough to avoid being indexed. The length of the padding sequence is randomly distributed in [16, 32] (request) or [30, 62] (response).

Opt-in of padding protocol

NaïveProxy clients should interoperate with any regular HTTP/2 proxies unaware of this padding protocol. NaïveProxy servers (i.e. any proxy server capable of the this padding protocol) should interoperate with any regular HTTP/2 clients (e.g. regular browsers) unaware of this padding protocol.

NaïveProxy servers and clients determines whether the counterpart is capable of this padding protocol by the presence of the padding header in the CONNECT request and response respectively. The padding procotol is enabled only if the padding header exists.

The first CONNECT request to a server cannot use "Fast Open" to send payload before response, because the server's padding capability has not been determined from the first response and it's unknown whether to send padded or unpadded payload for Fast Open.

Changes from Chromium upstream

  • Minimize source code and build size (1% of the original)
  • Disable exceptions and RTTI, except on Mac and Android.
  • Support OpenWrt builds
  • (Android, Linux) Use the builtin verifier instead of the system verifier (drop dependency of NSS on Linux) and read the system trust store from (following Go's behavior in crypto/x509/root_unix.go and crypto/x509/root_linux.go):
    • The file in environment variable SSL_CERT_FILE
    • The first available file of
      • /etc/ssl/certs/ca-certificates.crt (Debian/Ubuntu/Gentoo etc.)
      • /etc/pki/tls/certs/ca-bundle.crt (Fedora/RHEL 6)
      • /etc/ssl/ca-bundle.pem (OpenSUSE)
      • /etc/pki/tls/cacert.pem (OpenELEC)
      • /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem (CentOS/RHEL 7)
      • /etc/ssl/cert.pem (Alpine Linux)
    • Files in the directory of environment variable SSL_CERT_DIR
    • Files in the first available directory of
  • Handle AIA response in PKCS#7 format
  • Allow higher socket limits for proxies
  • Force tunneling for all sockets
  • Support HTTP/2 and HTTP/3 CONNECT tunnel Fast Open using the fastopen header
  • Pad RST_STREAM frames

Known weaknesses

  • HTTP CONNECT Fast Open creates back to back h2 packets consistently, which should not appear so often. This could be fixed with a little bit of corking but it would require surgical change deep in Chromium h2 stack, not very easy to do.
  • TLS over TLS requires more handshake round trips than needed by common h2 requests, that is, no h2 requests need these many back and forth handshakes. There is no simple way to avoid this besides doing MITM proxying, breaking E2E encryption.
  • TLS over TLS overhead causes visible packet length enlargement and lack of small packets. Removing this overhead also requires MITM proxying.
  • TLS over TLS overhead also causes packets to consistently exceed MTU limits, which should not happen for an originating user agent. Fixing this requires re-segmentation and it is not easy to do.
  • Packet length obfuscation partly relies on h2 multiplexing, which does not work if there is only one connection, a scenario not uncommon. It is not clear how to create covering co-connections organically (i.e. not hard coded).
  • Multiplexing requires use of a few long-lived tunnel connections. It is not clearly how long is appropriate for parroting and how to convincingly rotate the connections if there is an age limit or how to detect and recover stuck tunnel connections convincingly.

naiveproxy's People

Contributors

klzgrad avatar

Stargazers

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

Watchers

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

naiveproxy's Issues

服务器上,build失败

hi.

[root@host src]# ./build.sh
Done. Made 13176 targets from 1938 files in 19710ms
./build.sh: line 75: ninja: command not found
[root@host src]# which ninja
/usr/bin/which: no ninja in (/root/.cargo/bin:/usr/local/php/bin:/usr/local/nginx/sbin:/usr/local/mysql/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/local/python-3.6.4/bin:/usr/bin/v2ray:/root/bin)
[root@host src]# which ninja-build
/usr/bin/ninja-build
[root@host src]# yum install -y ninja
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile

  • base: mirrors.sonic.net
  • elrepo-kernel: repos.lax-noc.com
  • epel: mirrors.sonic.net
  • extras: mirror.keystealth.org
  • updates: sjc.edge.kernel.org
    No package ninja available.
    Error: Nothing to do
    [root@host src]#

没有ninja这个包,如何安装ninja?

local http proxy doesn't work

Hi dev, thanks for this great app, it seems promising and real performance focus, that's good. I did a quick play with it, but in the local config, I changed socks to http, curl test failed. Any suggestion?

~ % curl -x 127.0.0.1:1080 example.com
curl: (52) Empty reply from server
 ~ % curl -x 127.0.0.1:1080 https://example.com
curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to example.com:443
[0620/220004.704968:INFO:naive_proxy_bin.cc(131)] Proxying via https://myproxy.com:2015
[0620/220004.705350:INFO:naive_proxy_bin.cc(467)] Listening on 127.0.0.1:1080
[0620/220016.430001:INFO:naive_proxy.cc(162)] Connection 1 closed: ERR_INVALID_ARGUMENT
[0620/220031.058048:INFO:naive_connection.cc(197)] Connection 2 to example.com:443
[0620/220031.079902:ERROR:ssl_client_socket_impl.cc(946)] handshake failed; returned -1, SSL error code 1, net_error -100
[0620/220031.080009:INFO:naive_proxy.cc(162)] Connection 2 closed: ERR_PROXY_CONNECTION_FAILED

ssl3_get_record:wrong version number

version: 80.0.3987.87-3

# curl -v https://www.google.com
* Rebuilt URL to: https://www.google.com/
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 1090 (#0)
* allocate connect buffer!
* Establish HTTP proxy tunnel to www.google.com:443
> CONNECT www.google.com:443 HTTP/1.1
> Host: www.google.com:443
> User-Agent: curl/7.58.0
> Proxy-Connection: Keep-Alive
>
< HTTP/1.1 200 OK
< Padding: ..................................................
<
* Proxy replied 200 to CONNECT request
* CONNECT phase completed!
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* CONNECT phase completed!
* CONNECT phase completed!
* error:1408F10B:SSL routines:ssl3_get_record:wrong version number
* stopped the pause stream!
* Closing connection 0
curl: (35) error:1408F10B:SSL routines:ssl3_get_record:wrong version number

服务器 和客户端都能正常接受到请求

[0312/025035.777349:INFO:naive_connection.cc(237)] Connection 2 to www.google.com:443
[0312/025036.642522:INFO:naive_proxy.cc(164)] Connection 2 closed: OK

Adding Openwrt arm 32 release binaries?

Thanks for this lovely project.

From the release page, OpenWrt arm64 is supported, but OpenWrt arm32 is not.

image

Many routers are still using 32-bit processors, even for high-end models such as Netgear 7800

There was an issue for this: #53

Armv7 is still a 32-bit processor.

Armv7 is too broad a concept.

That's right, but a generic arm 32-bit build should work for many arm processors out there.

v2ray support those and it even has an armv7 build (slightly smaller and more performant than the generic one) beside the generic 32-bit build.

I guess they don't build it for a specific CPU but for an instruction set.

Sorry to just ask for help but not trying myself, it's just a bit hard for me to set it up from scratch.

chrome浏览器特征加域名中有敏感词是否可能会被针对

刚刚碰到个奇特的情况,将之前的tls over https代理升级了naiveproxy padding模式的代理。

其他域名都正常。但是某个域名里面有 1984的字符串,结果马上被封锁了,80和443端口都连不上。过了几分钟后解封,测试了几遍都是这样。

之前是用meow的https代理支持访问,反而一直正常。

mac客户端找不到config文件

Error reading config.json: (1003) File doesn't exist.
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

谢谢🙏

[Request] Support for Gl.iNet OpenWRT devices

The Gl.iNet portable routers are pretty popular in use for travel.
I am using the GL-AR750S router and it is running LuCI openwrt-18.06
The output of uname -a is:
Linux GL-AR750S 4.9.120 #0 Thu Aug 16 07:51:15 2018 mips GNU/Linux

Could there please be client support on this platform?
Thanks!

ERROR: No net_fetcher for performing AIA chasing. on linux platform

version: 81.0.4044.92-1
OS: debian 10

[0513/172202.481452:ERROR:cert_verify_proc_builtin.cc(493)] No net_fetcher for performing AIA chasing.
linux's client can not work since a few days ago, The same version previously worked fine.
Both os and program are not upgraded.
program on windows have no problem like this.

About the multiplexing feature in NaïveProxy

Hi,

I have read most part of this project documentation, and I try to learn the design of this project. But I am still not clear about the multiplexing part of the NaïveProxy.

From my understanding (may incorrect), the NaïveProxy opens a TLS connection for each hostname and multiplex the same hostname request in one connection. But it won't multiplex different hostname requests in a TLS connection. Am' I understand it correctly?

If yes, does the current NaïveProxy multiplexing have any difference from V2Ray's WS+TLS or Trojan?
If I use V2Ray with socks5 for Chrome, the Chrome would also multiplex the same hostname request in one TLS connection (The Chrome open a TCP tunnel to the remote server, and use HTTP/2 in it).

Could you shed me some light about this? Thanks.

caddy 2.0

Could you provide caddy 2.0 config file and systemd scripts?

应该如何为本地监听添加验证的

本地监听端口(HTTP or socks)添加简单的帐密验证,方便手机使用,比如外网访问家宽部署的端口

还一个是 当有请求进来的时候报错,运行环境是在openwrt arm8的路由上
NSS_VersionCheck("3.26") failed. NSS >= 3.26 is required. Please upgrade to the latest NSS, and if you still get this error, contact your distribution maintainer.

Strip the binary?

I see the binary on the releases is not stripped. Should it add strip command on .travis.yml? It will save about 2MB space.

Can't run on OpenWRT x86_64

The openwrt was downloaded from here.
http://firmware.koolshare.cn/LEDE_X64_fw867/

root@Openwrt:~# opkg install libnss libatomic1
Package libnss (3.51-1) installed in root is up to date.
Package libatomic1 (8.4.0-2) installed in root is up to date.

root@Openwrt:~# ./naive -h
Error relocating /usr/lib/libnspr4.so: secure_getenv: symbol not found

root@Openwrt:~# ldd naive
/lib/ld-musl-x86_64.so.1 (0x7fb77bfb0000)
libnss3.so => /usr/lib/libnss3.so (0x7fb77ba30000)
libnssutil3.so => /usr/lib/libnssutil3.so (0x7fb77ba02000)
libnspr4.so => /usr/lib/libnspr4.so (0x7fb77b9ca000)
libc.so => /lib/ld-musl-x86_64.so.1 (0x7fb77bfb0000)
libplc4.so => /usr/lib/libplc4.so (0x7fb77b9c3000)
libplds4.so => /usr/lib/libplds4.so (0x7fb77b9be000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x7fb77b9aa000)
Error relocating /usr/lib/libnspr4.so: secure_getenv: symbol not found

Add support for Synology DSM?

Synology DSM is basically customized Debian that does not use dpkg as package manager. The problem is it has legacy version of libnss3 (and libnss3-nssdb). I can successfully run naiveproxy after copy&paste all the necessary libraries from Ubuntu repository (which means messing around with Synology's own versions of libraries). I think it's better to have statically linked libraries compiled into the program, just like what has been done for OpenWRT. Thanks!

UDP穿透不了Socks5

區網的電腦做TPROXY透明代理,TCP可以正常連出去。但UDP發出去都沒有回應。無法nslookup。

平台是OpenWrt X86-64,NaiveProxy架的Socks5,
用ipt2socks當作橋梁做純TPROXY透明代理。
發現TCP可以透明代理過去。UDP透明代理無回應。
交叉比對其他的Socks5搭配ipt2socks可以讓UDP穿透過去。

我目前用 https-dns-proxy 把DNS查詢流量轉成TCP直接送到NavieProxy的Socks5,使用尚不受影響。

謝謝

[Feature request] Standalone QUIC-to-SOCKS proxy

Hi @klzgrad.
First of all really thank you for your efforts.
Naïve is 2X faster compared to other complex authenticated, traffic encrypted alternatives.
If it's not much work to do can you please add support for standalone usage?
(client/server QUIC -UDP only transport)

Android Support

Thanks for building this tool. We've been testing in Iran. Works pretty well.

Any thoughts on developing an Android app?

Discuss: Certificate signed with self-signed CA.

See "Generate certificates" in https://www.chromium.org/quic/playing-with-quic and https://source.chromium.org/chromium/chromium/src/+/master:docs/linux/cert_management.md (though you don't actually need certutil for adding root CA; you can do that in the browser with GUI). #37 (comment)

I see it make possible to use a certificate signed with self-signed CA. To those who don't have a domain name, this will save them a lot of money. It can write an IP address in SSL certificate's "Common Name(CN)". Then run ./naive --listen=socks://127.0.0.1:1080 --proxy=https://aa.bb.cc.dd/.

The remain question is naive doesn't allow proxy URL contain an IP address:

constexpr char kDefaultHostName[] = "example";

// SNI should only contain DNS hostnames not IP addresses per RFC 6066.
if (url.HostIsIPAddress()) {
GURL::Replacements set_host;
set_host.SetHostStr(kDefaultHostName);
params->proxy_url =
GetProxyFromURL(url_no_auth.ReplaceComponents(set_host));
LOG(INFO) << "Using '" << kDefaultHostName << "' as the hostname for "
<< url.host();
params->host_resolver_rules =
std::string("MAP ") + kDefaultHostName + " " + url.host();
}

I don't see it is necessary to replace server_name to "example", because It shouldn't be sent server_name when you visit an IP address directly, like https://1.1.1.1/.

Another problem is missing server_name will change the ClientHello fingerprint, and make it become uncommon traffic(Hoping the Chromium will enable the DoH by default:-)):
https://tlsfingerprint.io/id/e94fcb2176c0b827
https://tlsfingerprint.io/compare/bbf04e5f1881f506/e94fcb2176c0b827

Edited: The way to workaround now is write both IP address and domain name(eg. example) in "subjectAltName(SAN)".

What do you think? @klzgrad

Feature Request

Naiveproxy is a great project to bypass gfw. It has been running smoothly for months on my VPS.
Thanks for ur work done.
Does the develop team has any plan to support cdn? Naiveproxy would be unbreakable if can work with cdn.

windows build error

error message:

ERROR at //third_party/protobuf/proto_library.gni:369:15: Only source, header, and object files belong in the sources of a static_library. //out/Release/pyproto/google_apis/gcm/protocol/mcs_pb2.py is not one of the valid types.
    sources = get_target_outputs(":$action_name")
              ^---------------------------------
See //google_apis/gcm/BUILD.gn:78:1: whence it was called.
proto_library("proto") {
^-----------------------
See //BUILD.gn:83:7: which caused the file to be included.
      "//google_apis/gcm:gcm_unit_tests",
      ^---------------------------------

the chromium version is 74.0.3729.108 and ninja version is 1.9.0, i use v74.0.3729.108-1 git branch. but when i run ./build.sh i got this error. how to solve this problem? thank you.

docker alpine 中无法运行 linux x86版本

尝试打包成docker image 可是在其中无法直接运行linux x86,已经安装nss libc6-compat包

Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by ./naive)
Error relocating ./naive: __register_atfork: symbol not found
Error relocating ./naive: __sbrk: symbol not found
Error relocating ./naive: __res_nclose: symbol not found
Error relocating ./naive: __res_ninit: symbol not found
Error relocating ./naive: strtoll_l: symbol not found
Error relocating ./naive: strtoull_l: symbol not found
Error relocating ./naive: __vsnprintf_chk: symbol not found
Error relocating ./naive: __isnan: symbol not found
Error relocating ./naive: backtrace: symbol not found
Error relocating ./naive: __strncat_chk: symbol not found
Segmentation fault (core dumped)

ldd naive

	/lib64/ld-linux-x86-64.so.2 (0x7f257c020000)
	libdl.so.2 => /lib64/ld-linux-x86-64.so.2 (0x7f257c020000)
	libpthread.so.0 => /lib64/ld-linux-x86-64.so.2 (0x7f257c020000)
	librt.so.1 => /lib64/ld-linux-x86-64.so.2 (0x7f257c020000)
	libnss3.so => /usr/lib/libnss3.so (0x7f257ba0f000)
	libnssutil3.so => /usr/lib/libnssutil3.so (0x7f257b9dc000)
	libnspr4.so => /usr/lib/libnspr4.so (0x7f257b99a000)
	libm.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7f257c020000)
	libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7f257c020000)
Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by naive)
	libplc4.so => /usr/lib/libplc4.so (0x7f257b993000)
	libplds4.so => /usr/lib/libplds4.so (0x7f257b98e000)
Error relocating naive: __register_atfork: symbol not found
Error relocating naive: __sbrk: symbol not found
Error relocating naive: __res_nclose: symbol not found
Error relocating naive: __res_ninit: symbol not found
Error relocating naive: strtoll_l: symbol not found
Error relocating naive: strtoull_l: symbol not found
Error relocating naive: __vsnprintf_chk: symbol not found
Error relocating naive: __isnan: symbol not found
Error relocating naive: backtrace: symbol not found
Error relocating naive: __strncat_chk: symbol not found

求助:caddy运行出错

抱歉,此帖非issues,应该是caddy方面的配置问题(本人小白一个),参考了网上的文章
之前能配置成功,最近重新配置时出错:“caddy.service: Failed at step USER spawning /usr/bin/caddy: No such process”,还有一行错误提示忘记了。
因为caddy.service原来的脚本不在了,新的脚本在此地址:wget https://raw.githubusercontent.com/caddyserver/dist/master/init/caddy.service,这个文件我也看不出哪有问题,所以也不知道是不是这个脚本导致的错误。

Add http proxy support

After testing, I find out that naive only support socks5 proxy, but don't support http proxy in local. Could you please add http proxy support in local? Thank you.

curl: (52) Empty reply from server

  1. naiveproxy version
    v73.0.3683.86-1

  2. caddy version
    official latest version with forwardproxy plugin

  3. caddy config

<domain.name> {
    tls {
        dns cloudflare
    }
    root /home/ubuntu/blog
    gzip
    forwardproxy {
        basicauth ping pong
        probe_resistance secret.localhost
        hide_ip
        hide_via
        upstream http://127.0.0.1:8080
    }
}
  1. naiveproxy server side
    ./naive --listen=http://127.0.0.1:8080

  2. naiveproxy local side
    ./naive --proxy=https://ping:pong@<domain.name>

  3. curl -v --proxy socks5h://127.0.0.1 google.com

* Rebuilt URL to: google.com/
*   Trying 127.0.0.1...
* TCP_NODELAY set
* SOCKS5 communication to google.com:80
* SOCKS5 request granted.
* Connected to 127.0.0.1 (127.0.0.1) port 1080 (#0)
> GET / HTTP/1.1
> Host: google.com
> User-Agent: curl/7.54.0
> Accept: */*
>
* Empty reply from server
* Connection #0 to host 127.0.0.1 left intact
curl: (52) Empty reply from server

Thanks for your reading.

Adding MIPS/MIPS64 release binaries?

EdgeRouter 4 runs on Linux kernel 4.9 with a MIPS64 CPU. It also supports standard Debian repository packages. I would assume it can run naiveproxy smoothly. Can I ask for a binary release for MIPS or MIPS64 architecture? Thanks.

caddy报错

no action found for directive 'forwardproxy' with server type 'http' (missing a plugin?)

navieproxy not working....

 curl -v --proxy http://127.0.0.1:8080 https://www.google.com
* Expire in 0 ms for 6 (transfer 0x55a8fe9cff50)
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Expire in 200 ms for 4 (transfer 0x55a8fe9cff50)
* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
* allocate connect buffer!
* Establish HTTP proxy tunnel to www.google.com:443
> CONNECT www.google.com:443 HTTP/1.1
> Host: www.google.com:443
> User-Agent: curl/7.64.0
> Proxy-Connection: Keep-Alive
> 
< HTTP/1.1 200 OK
< Padding: ..............................................
< 
* Proxy replied 200 to CONNECT request
* CONNECT phase completed!
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: none
  CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* CONNECT phase completed!
* CONNECT phase completed!
* error:1408F10B:SSL routines:ssl3_get_record:wrong version number
* Closing connection 0
curl: (35) error:1408F10B:SSL routines:ssl3_get_record:wrong version number

怎么配置未认证用户看到的页面?

我想让未认证的用户看到别的页面,比如登录我的私有云的页面,这样流量看起来才不可疑。Trojan可以直接设定remote_addr, remote_port,那naiveproxy能设置吗?

Does naiveproxy compatible with apache?

I read the wiki of naiveproxy and got that Caddy can work with naiveproxy. However, I have had apache2 server, does the naiveproxy compatible with apache2? Do you have any guide for this configuration?

Traffic analysis of HTTP/2 CONNECT tunnels

  • h2 tunnel and real h2 traffic histograms of SSL payload lengths

As of version 64.x.y.z.

Negative means traffic from the client; positive means traffic from the server.

An example of tunneled TLS data:

20: IP
20: TCP
10: TCP Timestamps
 5: TLS header
24: TLS GCM mode overhead (Nonce + MAC)
---- (Encrypted data below)
 9: HTTP/2 frame header
 5: TLS header
24: TLS GCM mode overhead (Nonce + MAC)
---- (Tunneled payload below)

The lengths being counted here are the length of "Encryped Data" in the above diagram, because these lengths are cleartext and are independent from TCP segmentation. Cleartext TLS handshakes are not counted in the lengths.

Payload length -2000:2000:

-2000-2000

The largest spikes from server side are: 1024, 1179 (Google servers), 1389 (Cloudflare?), 1427/1429 (TCP MSS?). These should be various self-imposed MTU/MSS related optimizations.

Large spikes from the client are mostly TLS handshakes being tunneled in h2 DATA frames:

handshake

-526: padded ClientHello with session resumption.
-267: some ECDH (pubkey len: 32) ClientKeyExchange + ChangeCipherSpec + 2x Encrypted Handshake Message.
? ~ -193: the bell curve covers unpadded ClientHellos with SNIs of various sizes. (-193 is the lower bound with an empty SNI.)
-225: ChangeCipherSpec + 2x Encrypted Handshake Message.
-135: some ECDH ClientKeyExchange (pubkey len: 65) + Encrypted Handshake Message.
-102: some ECDH ClientKeyExchange (pubkey len: 32) + Encrypted Handshake Message.

有多個naiveproxy節點,HAPROXY的設定

我最近把navieproxy搭配HAPROXY,照下面的接法。速度變得非常快。
但是HAPROXY只會檢查client端的socks是不是還活著,不知道naiveproxy_server還能不能連。所以有時候會莫名的卡住。

naiveproxy_server_1:443--|gfw|--naiveproxy_client_1:1081(SOCKS)─┐
naiveproxy_server_2:443--|gfw|--naiveproxy_client_2:1082(SOCKS)─┤
naiveproxy_server_3:443--|gfw|--naiveproxy_client_3:1083(SOCKS)─┼─ HAPROXY:1079(SOCKS)
naiveproxy_server_4:443--|gfw|--naiveproxy_client_4:1084(SOCKS)─┘

請問有沒有辦法實現像下面這種接法

naiveproxy_server_1:443--|gfw|─┐
naiveproxy_server_2:443--|gfw|─┤
naiveproxy_server_3:443--|gfw|─┼─ HAPROXY--naiveproxy_client:1080(SOCKS)
naiveproxy_server_4:443--|gfw|─┘

讓HAPROXY檢查naiveproxy_server是不是還活著?

Adaptation for GUI frontend

There seems to be quite a lot of code that could be removed and slimmed down. I am currently trying to write a Qt5 cross platform fronted for this project and it is taking a while to properly hook together things. In the future when this project evolves, the readability of the code base would be really important for further improvements. Can I suggest an effort to clean up the current code base before progressing to other things?

QUIC mode software quit: Segmentation fault (core dumped)

If I use QUIC mode, the software quit(the windows version quit too, without any message). HTTPS mode is OK. I run caddy like this: ./caddy -quic -conf=Caddyfile.

root@xxx:~$ naiveproxy/src/out/Release/naive --proxy=quic://user:[email protected] --listen=socks://127.0.0.1:1080 --padding=true
Segmentation fault (core dumped)

Can not get right clang version

when I run get-clang.sh

+ uname
+ ARCH=Linux
+ [ Linux = Linux ]
+ [  ]
+ eval
+ which python2
+ python2=/usr/bin/python2
+ /usr/bin/python2 tools/clang/scripts/update.py --print-revision
+ CLANG_REVISION=n332890-c2443155-1
+ CLANG_PATH=clang-n332890-c2443155-1.tgz
+ clang_url=https://commondatastorage.googleapis.com/chromium-browser-clang/Linux_x64/clang-n332890-c2443155-1.tgz
+ [ ! -d third_party/llvm-build/Release+Asserts/bin ]
+ mkdir -p third_party/llvm-build/Release+Asserts
+ curl https://commondatastorage.googleapis.com/chromium-browser-clang/Linux_x64/clang-n332890-c2443155-1.tgz
+ tar xzf - -C third_party/llvm-build/Release+Asserts
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (35) error:1408F10B:SSL routines:ssl3_get_record:wrong version number

How to listening multiple ports

I need listen one redir port to support tproxy,and another socks5 port for some client.
Is there any other way to achieve rather than start two instances?

Cann't run arm version on android

I download the arm version of naive. Copy it into the home folder of termux (terminal app of android). Get some errors as follows when I excute naive.

$ ./naive --h
bash: ./naive: Permission denied
$ chmod 755 naive
$ ./naive --h
bash: ./naive: No such file or directory
$ file naive
naive: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=3bca406d6b3aee188485dabb1427130677470768, not stripped
$ ldd naive
libdl.so.2
libpthread.so.0
librt.so.1
libnss3.so
libnssutil3.so
libnspr4.so
libm.so.6
libgcc_s.so.1
libc.so.6
ld-linux-armhf.so.3

"/bin/ash: naive: not found" on OpenWRT X86-64

I used OpenWrt 19.07.1_x86-64 at Qemu.
It can run caddy without error by their linux-x64 version.

When I started naiveproxy-linux-x64.
It showed "/bin/ash: naive: not found"

Should I build a OpenWrt Version? Is it difficult?
Please help. Thanks

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.