Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

naiveproxy is actively getting detected and filtered by the iran's DPI #404

Closed
Nyxil opened this issue Nov 25, 2022 · 24 comments
Closed

naiveproxy is actively getting detected and filtered by the iran's DPI #404

Nyxil opened this issue Nov 25, 2022 · 24 comments

Comments

@Nyxil
Copy link

Nyxil commented Nov 25, 2022

I can confirm as many others in iran that the naiveproxy is actively getting detected and filtered in iran by the DPI,
Seems like the client hello is actively getting detected in few seconds and dropped (not reaching the server), so the SSL handshake error occurs and the QoS applies to the server ip,
Then the naive client will make to many connections and all fail with TLS handshake error, but sometime one can pass throw the wall and establish a very poor and slow connection on desktop, the same slow connection also doesn't even get established on android (maybe by the TLS ciphers difference caused by the hardware )
Do know the possible vulnerabilities causing it to get detected?
Don't hesitate to ask me for evidence like pcaps and so on...

@Nyxil Nyxil changed the title naiveproxy is actively getting detected and filtered by the iraninan DPI naiveproxy is actively getting detected and filtered by the iran's DPI Nov 25, 2022
@2378
Copy link

2378 commented Nov 25, 2022

I prefer to believe you were talking a fake report , because naive work well in china. it's really hard to tell iran's GFW better than china GFW,it must be some other reason caused.
BTW,why you just regist this ID last month.

@alirezaac
Copy link

alirezaac commented Nov 25, 2022

Well let me take you to this, DNS is acting weird and today they tried to block all DOH dns, all i want from naive is to handle DNS requests and bump the chromium version faster a little. and so as you can see its device wise and it's so hard to target devices and even with vulnerabilities so maybe it's on the dns but read that talk in bbs.

@alirezaac
Copy link

and about a protocol wide blockage, if they can me and some other of my friends should be blocked, but we are using it more than a month, but android situation is like you your ip is working, domain not blocked even sni is not blocked, but on your phone can't access the webpage of your naive proxy. which is weird and random. and if it's tls problem why we are solving it on windows with DOH and android is hard to fix dns to test if its on dns or tls.

@cross-hello
Copy link

@alirezaac try to switch tls fingerprints on Android
net4people/bbs#129 (comment)

@Nyxil
Copy link
Author

Nyxil commented Nov 25, 2022

Let me make it more clear ! technically the issue is completely unrelated to DNS, DOH and so on,
And it's completely impossible for any DPI in high scale to filter TLS traffic based on DNS and so on !

Now I will describe the flow of issue and possible causes.

  1. A fresh setup of naive will work for a while without any problem with zero error.
  2. After few seconds the SSL handshake errors occur and connections begin to fail.
  3. The firefox web browser is still able to visit the fallback website behind naive without any issue
  4. The chrome browser randomly gets the same SSL error while visiting the fallback web page, the naive client on desktop is able to establish a very poor and slow connection after to many SSL errors and failed handshakes, and the naive's android client is completely unbale to establish any connection (the client hello is dropped).
  5. According to wireshark captured packets the TLS client hello of naive and chrome browser is dropped and tcp retransmission occurs.
  6. I did then use another vpn tunnel on top of naive tunnel to make sure there is nothing wrong with naive client/server and my setup, and there was zero error.
  7. Its obvious that it's caused by maybe JA3 fingerprinting or maybe payload length and something which makes difference in naive handshaking in compression to chrome

Seems like maybe 1% of TLS client hello packets are passing throw the wall in desktop environment, maybe because of some random factors in packet.

You can repeat the same test as i described and validate it.
I think we should take a deeper look at captured packets and find the differences of packets in compression to chrome's.

@klzgrad I hope you can figure out the issue by the description.

@arandomgstring
Copy link

arandomgstring commented Nov 25, 2022

@2378
This is not a fake report, see this net4people/bbs#153 for more details.

@Nyxil
I have reported this issue way before anyone actually noticed it, check the link above, and I am pretty sure @klzgrad is well aware of it, you can see their post on my topic; but don't worry too much. In the next version of Chrome which has not become stable yet, the choice of TLS fingerprint would be a lot more random that what we are used to, therefore, if chromium stack of naiveproxy get upgraded to that version, I presume we can get it to work again. Well, unless they decide to use whitelist a few fingerprints, which by doing so many healthy services will stop working. Simply download the beta version of Chrome and visit your website, it will most likely work (if it already does on Firefox).

@Nyxil
Copy link
Author

Nyxil commented Nov 26, 2022

@arandomgstring
I did read whole the comments in your mentioned issue, but there is something wrong in their tests !
As i told before there is no problem in visiting web pages via chrome browser before running naive on the specified domain/ip.
I did serve static web pages with nginx/caddy and can confirm that there is no problem in visiting the pages using chrome,browser (no TLS handshake error happens),
The chrome browser handshake errors just appear after running naive on domain/ip,
So this is obvious that naive's transmitted packets are causing the domain/ip to get black listed, and also the chrome will face the TLS handshake error after all,
About the CDN's mentioned in that issue the whole story is different cause the filtering is done to ASN's of that companies like what happened to expressvpn's.

@cross-hello
Copy link

cross-hello commented Nov 26, 2022 via email

@2378
Copy link

2378 commented Nov 26, 2022

@arandomgstring OK, net4people/bbs#153 that's interesting issue ,it has really happened, after read most comments i have to say it's more like a scary title. there weren't any strong evidence to confirm naive has been filtered by iran's DPI, excepte chrome "hello“ is unconditionally blocked.
I am not familiar with the Iran net environment, but if this happened in china, i would first troubleshoot the list of chinamade software(app) on customer's computer, sometimes they "break" the traffic proxy more efficiently than china GFW.:sob:

@cross-hello
Copy link

cross-hello commented Nov 26, 2022 via email

@Nyxil
Copy link
Author

Nyxil commented Nov 26, 2022

@cross-hello
This is all i say, perhaps there is a vulnerability in naive.
If there was any problem with chrome web-browser on its own, all web pages on the internet with specific version of chrome will fail to load, but this is not happening!

@arandomgstring
Copy link

arandomgstring commented Nov 26, 2022

@Nyxil

The firefox web browser is still able to visit the fallback website behind naive without any issue
The chrome browser randomly gets the same SSL error while visiting the fallback web page

I did serve static web pages with nginx/caddy and can confirm that there is no problem in visiting the pages using chrome,browser (no TLS handshake error happens)

Honestly, I don't understand your test. Does Chrome Browser randomly gets SSL error, and Firefox doesn't "when proxy is activated"? It makes no sense. Reinstall your Chrome browser then. But if you get SSL error on Chrome without proxy and on Firefox it's not the case, then it is exactly what I described in that topic.

If there was any problem with chrome web-browser on its own, all web pages on the internet with specific version of chrome will fail to load, but this is not happening!

Incorrect. Chrome sends different types of Client Hellos to different websites, thus if a particular client hello get blocked, you can still open many websites with no problem. If you look at my posts in that topic, you will see that I captured two different client hellos for a single domain/ip on Chrome. I am not sure how Chrome "picks" a client hello for a website, but from my experience the website with Let's encrypt SSL often tend to get blocked on Chrome more often than other websites. So maybe Chrome picks a client hello based on the provider of SSL?

You can simply check my claim on WireShark, btw. Open different websites, you will see different JA3 in their client hellos. Even for a single domain you might get different client hellos. Just set "tls.handshake.type == 1" in wireshark's filter.

At any rate, you can do a simple check. Capture naive proxy client hello, and check its list of Cipher Suites, the order matters a lot. Now go ahead and open your website on the domain that naive proxy is running on Chrome. Capture its client hello and check its list of Cipher Suites. Are they same, you see the same order?

@saminxx
Copy link

saminxx commented Nov 26, 2022

Please Look at this
SagerNet/SagerNet#566
I think it is same problem

@klzgrad
Copy link
Owner

klzgrad commented Nov 26, 2022

Please discuss in net4people/bbs#153.

This place is for reporting bugs not general tech support. If it's unconditional blocking of chrome fingerprint there is also nothing I can do here. If naiveproxy doesn't work, try alternatives.

@klzgrad klzgrad closed this as completed Nov 26, 2022
@Nyxil
Copy link
Author

Nyxil commented Nov 26, 2022

Please discuss in net4people/bbs#153.

This place is for reporting bugs not general tech support. If it's unconditional blocking of chrome fingerprint there is also nothing I can do here. If naiveproxy doesn't work, try alternatives.

This is the naive's bug and the condition is that naive client is always getting too many SSL handshake errors before each connection on desktop and does not establish any TLS connection on android,
There is no issue with chrome browser in iran and those people are just generating fake news everywhere, cause the blocked chrome fingerprint is just done to CDN's not whole the internet !
Chrome is the most used browser in iran and whole websites are loading with no issue, also our services and private stuff !!!

Guess how the whole websites and our services are working very well with chrome and whenever we run the naive on healthy domain/ip cause the chrome browser to fail in handshake,

How the whole internet is accessable in chrome and just naive is failing and there is no bug in naive

Its totally a funny story

@Nyxil
Copy link
Author

Nyxil commented Nov 26, 2022

Due to evidence, I am pretty sure that there is a critical bug in naive and you dont wanna even think about the possibilities !

According to the history of censorship in iran,
The did it before to shadowsocks, the system was flagging the server ips on which shadowsocks was running and applied high packet drop rate on server ips and caused shadowsocks connections in iran to get connected but become very slow and useless but not getting completely blocked,

Due to history and what happened to shadowsocks in past, and their technical power, its perhaps possible to detect and mark the naive servers and apply the QoS !

This is what they are doing to all other vpn protocols
They dont completely block the ip/port but they apply QoS and randomly backhole and apply high packet drop rate which cause vpns to get connected but become useless !

@arandomgstring
Copy link

arandomgstring commented Nov 26, 2022

@Nyxil
Can you post a picture from Client Hello generated from Chrome for your normal website + Client Hello generated by Naive proxy? Of course you should hide your server's domain and IP & Your device's MAC address. Limit your test on Windows.

@Nyxil
Copy link
Author

Nyxil commented Nov 26, 2022

@arandomgstring
I did check and compare the chrome's client hello with naive's one and it was equal in past, i should again install the chrome version equal to naive's one and check it again.
But maybe there is something wrong with payload size or a difference in behavior caused by the implementation, cause the naive has two layers of encryption and wrapping a bad proxy protocol (https)

@Nyxil
Copy link
Author

Nyxil commented Nov 26, 2022

The vless + tcp + tls also does not work
But the vless + tcp + ws + tls does work
The transport protocol of both is same but the difference in proxy protocol cause issue,
Maybe they are sampling and analyzing payload size and guess abnormalities, this kind of dpi is hard to implement but possible !

@arandomgstring
Copy link

@Nyxil
This is exactly why I am saying you should check them and post them here, so that we find if it's really a bug, or a design flaw. We can see payload size in WireShark as well, alongside with JA3, etc. According to what you suggested, problems happen after client hello. So the most natural assumption is that the the client hellos are not the same, no?

The vless + tcp + tls also does not work
But the vless + tcp + ws + tls does work

It looks like your server is behind a CDN. Naive proxy doesn't support it. If it isn't, then your problem is worth of discussing. Post it on BBS.

@Nyxil
Copy link
Author

Nyxil commented Nov 26, 2022

@arandomgstring
No, I dont recommend or use CDN's.
I did inject the latest captured chrome fingerprint into xray via uTLS and did not face any issue yet,
But naive is built upon the whole net stack and getting detected xD
Why dont you capture the packets using wireshark and test it yourself?
I did describe the whole process of reproducing the problem,
I will check it out in my free time.

@Nyxil
Copy link
Author

Nyxil commented Nov 26, 2022

I did read your story about chrome but as i told before try to install the chrome version used by naive and run a web server and put network load on the server and check if the chrome browser fingerprint is getting blocked,
Your test was wrong, if you run a web server and proxy on same ip/domain at same time and try to access it from the both clients, its impossible to figure out which one causing the problem !

What if people try to implement proxies on firefox net stack, so there will be no browser engine on planet to use in iran other than netscape 😂

@arandomgstring
Copy link

arandomgstring commented Nov 26, 2022

@Nyxil

I did inject the latest captured chrome fingerprint into xray via uTLS and did not face any issue yet,
But naive is built upon the whole net stack and getting detected xD

Xray uses the most common fingerprint of Chrome, whereas Chrome itself (and naive proxy) might generate different client hellos based on the website you are visiting. Not only I checked this, but also I posted my packets on that link + their fingerprints, while I see no packet from your side; just claims. Besides, WS over TLS is literally indistinguishable from simple tcp - TLS packets, because packets are encrypted via TLS, and ISP cannot detect WS usage at all. What you are saying makes no sense. If you don't believe me, just post your issue on BBS, so that we see if other people are experiencing same issue or not.

Your test was wrong, if you run a web server and proxy on same ip/domain at same time and try to access it from the both clients, its impossible to figure out which one causing the problem !

Are you perhaps unfamiliar with reverse proxy option of Nginx? With this feature, you can run a Webserver and proxy server on the same domain, IP. One simply define a "path" on domain, and make the proxy server listen to connections on that particular path. Therefore it is indeed possible to open a domain on Chrome and capture its packets (without proxy of course) and then you can also check packets generated by proxy server from that domain and compare the results. This is what I did in that topic. If a particular and not very common fingerprint gets blocked for certain IP ranges, nobody will notice it. This is why you can use your Chrome browser normally.

I have nothing else to add, this issue is closed by the owner already. Perhaps we should respect them.

@Nyxil
Copy link
Author

Nyxil commented Nov 26, 2022

@arandomgstring
You are completely wrong about chrome's fingerprint
Cause chrome is generating different fingerprints for different protocols, ALPN's and so on.
The naive is also generating different fingerprints.
You should pin and compare the generated fingerprints of both apps depending on some parameters my dear iranian friend,
There is no single fingerprint which covers every type of request in chrome's net stack 🙃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants