GFW-knocker / gfw_resist_tls_proxy

knock up GFW sni detection in tls client hello
GNU General Public License v3.0
1.65k stars 232 forks source link

Youtube: `googlevideo.com` domain not covered. #64

Open byehack opened 1 year ago

byehack commented 1 year ago

Currently can't play videos in youtube. requests to googlevideo.com return 421 response code:

image

mohsenrahmani145 commented 1 year ago

منم همین مشکل رو دارم یوتیوب بدون فیلتر شکن باز میشه ولی ویدیویی پلی نمیشه

hawshemi commented 1 year ago

Yes. It has a bug.

err
mewchore commented 1 year ago

دامنه رو به قسمتای reverse tls و reverse http تو قسمت outbound اضافه کنی باز هم نمیاره :/ مشکل بیشتر از اون یه تیکه س

byehack commented 1 year ago

You can test ping googlevideo.com and that works. but http request returns 421 code:

The HTTP 421 Misdirected Request client error response code indicates that the request was directed to a server that is not able to produce a response. This might be possible if a connection is reused or if an alternative service is selected.

Response header:

alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
content-length: 0
content-type: text/html
date: Fri, 28 Apr 2023 09:25:03 GMT
server: Bandaid Misdirected Traffic Server
x-frame-options: SAMEORIGIN
x-xss-protection: 0
amg9898 commented 1 year ago

برای من هم مشکل اینه من فقط تامبیل لود میشه اما ویدیو پلی نمیشه

GFW-knocker commented 1 year ago

بچه ها تست نکنید مشکل اینه که یوتیوب یکی دو تا ایپی نداره و هر ویدئویی روی یه سرور جداست باید یه ایپی پیدا کنم که cdn گوگل ویدئو باشه

none57 commented 1 year ago

بچه ها تست نکنید مشکل اینه که یوتیوب یکی دو تا ایپی نداره و هر ویدئویی روی یه سرور جداست باید یه ایپی پیدا کنم که cdn گوگل ویدئو باشه

به نظرم وقتتو هدر نده برای 1 ایپی برو بیس کدر رو تغیر بده که بشه پروکسی سرور و تمام درخواست هارو روی هر ایپی که هست فرگمنت کنه اینجوری خیلی بیشتر از 1 سایت و ای پی رو میتونی باز کنی برای تست هم بهتر هست

من خودم وقت کنم چند روز دیگه مینویسم ولی بهتره روی این کار کنی

توجه هم کن که حتما از یه doh یا ترافیک dns رو ببر روی فیلترشکن برای تست کد چون بیشتر dns سرور ها تو ایران داره رصد و های جک میشه و تغییر میکنه و به نتیجه مطلوب نمیریسی

none57 commented 1 year ago

بچه ها تست نکنید مشکل اینه که یوتیوب یکی دو تا ایپی نداره و هر ویدئویی روی یه سرور جداست باید یه ایپی پیدا کنم که cdn گوگل ویدئو باشه

.i.ytimg.com .googlevideo.com .youtube-ui.google.com .ggpht.com

یو تیوب از تمام اینا استفاده میکننه ببین شاید بدرد خورد

Wasoud commented 1 year ago

https://github.com/touhidurrr/iplist-youtube/blob/main/ipv4_list.txt

free-the-internet commented 1 year ago

بچه ها تست نکنید مشکل اینه که یوتیوب یکی دو تا ایپی نداره و هر ویدئویی روی یه سرور جداست باید یه ایپی پیدا کنم که cdn گوگل ویدئو باشه

At first place, it seems quic protocol is broken using this method (note that I'm not 100% sure); that is quic packets can't go out using the TCP socket you open (which is normal!). We must see how packets are managed and wrapped in another protocol. Try to draw a packet protocol transformation chart. Then, maybe distinguishing the protocols at your python script and directing the quick packets with a UDP socket can help. I'm not really sure about what I am saying :smile_cat:

Update: At least you can disable quic in Firefox like this: about:config and then network.http.http3.enable = false I checked, even with quic off, there is a problem. BUT, this will simplify things a lot for you to continue investigating the problem.

byehack commented 1 year ago

TL;DR Google has restriction prevents different locations to connect un-associated server IP to get playable videos from youtube service


As response code 421 says, the destination IP we are connected is wrong. it's a restriction from google.

Thats true we can use google services with different IPs. but some services like YouTube needs to verify that you connect to it's service only from IP specified for you.

You can verify this by connect to multiple country and try to resolve youtube.com DNS.

As you can see, each location shows different IP for youtube.com.

Lets test pyprox script when VPN is On: select a country with your VPN (USA) Then run script and set system proxy in v2ray client.

As you can see, youtube videos won't play even through VPN. But why? the Google_IP set in script isn't associated with our location (google restriction).

How to make it works through VPN + script run?

  1. get associated ip address for your current location of VPN using nslookup youtube.com
  2. set it in script to Google_IP
  3. re-run the script.
  4. now it plays 🎉

But for locations like Iran we have still issue for resolving dns:

>nslookup youtube.com
Server:  UnKnown
Address:  192.168.2.1

Non-authoritative answer:
DNS request timed out.
    timeout was 2 seconds.
Name:    youtube.com
Address:  10.10.34.35

As you can see here the10.10.34.35 is not valid.

So now what should we do?

I tested encrypted DNS using a valid CloudFlare DoH subdomain but still got same IP as above.

it seems the last chance is fighting google to find valid IP we can use it for pyprox tls handshake bypass. As mentioned here we should test all Google ips, to check wich one is working for Iran. I recommend playwright to make an automated script for this purpose.

free-the-internet commented 1 year ago

But why? the Google_IP set in script isn't associated with our location (google restriction).

I can't confirm this. I've set as you said, it does not work.

byehack commented 1 year ago

I can't confirm this. I've set as you said, it does not work.

I can confirm again that it works for me. What is your DNS? Where is your location through VPN? What did you get when enter nslookup youtube.com through VPN?

amg9898 commented 1 year ago

من داشتم پروژه های مشابه رو چک میکردم اینو دیدم جالب بود البته برای ایران کامل بومی سازی نشده goodbyedpi رو نت رایتل یبار همه رو باز کردهمه رو یوتیوب و .... بعدش فقط سایت های مث پورن هاپ رو باز کرد دیگه یوتیوب باز نمیشد تازه ای پی هم تغییر نکرد اگه بشه همینو انجام داد یه چیز عالی در میاد goodbyedpi- یه پروزه گیت هاب هست

GFW-knocker commented 1 year ago

به نظرم وقتتو هدر نده برای 1 ایپی برو بیس کدر رو تغیر بده که بشه پروکسی سرور و تمام درخواست هارو روی هر ایپی که هست فرگمنت کنه اینجوری خیلی بیشتر از 1 سایت و ای پی رو میتونی باز کنی برای تست هم بهتر هست

یوتیوب خودش گیر میده فکر میکنه اسکرپریم دقیقا همین کارو دارم میکنم که مشکل از پایه حل شه

GFW-knocker commented 1 year ago

TL;DR Google has restriction prevents different locations to connect un-associated server IP to get playable videos from

i think google detect us as scapper and prevent playing videos and block comments. im writing a general fragmented proxy server for all sites not for youtube only so i hope it solve the issue

GFW-knocker commented 1 year ago

بچه ها رو یوتیوب کار نکنید کارای واجب تر هست پروژها های خوب گیت هاب رو تست کنید رو نت های مختلف برا ایرانسل مخصوصا چیزی پیدا کردید به نام خودتون promote میشه توسط isegaro و IRCF

https://hiddify.github.io/filter.html Good By DPI Green Tunnel DPI Tunnel Android

AlirezaM19999 commented 5 months ago

سلام چطوری کار میکنه