Skip to content

MHMoosaei/gfw_resist_tls_proxy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 

Repository files navigation

gfw_resist_tls_proxy

آپدیت

رو ایرانسل پکت با موفقیت رد میشه ولی شدید کنده تحت بررسیه
این محصول نهایی نیست یه اسکریپت پایتونه جهت اثبات ادعا
بزارید به نقطه پایدار برسیم بعد برا کلاینت v2ray پیاده میشه
الان متخصص حرفه ای شبکه و برنامه نویس c لازم داریم جهت تبادل اطلاعات

internet for everyone or no one

سلام گرم به همه دوستانی که برای حق اولیه و ابتدایی شهروندی ، برای دسترسی به اینترنت ، تلاش میکنند
سلام به هیدیفای،باشسیز،سگارو،آی آر سی اف،پروژه امید،ثنایی،هگزا،وحید،صفا،اردشیر،ایمان،امین،حسین، یوتیوبرها و همه عزیزان دوست داشتنی

روش این پیج یک زخم عمیق بر پیکر GFW می گذارد که تا سالها سوزش آن در ماتحت فیلترچیان دنیا باقی خواهد ماند

خلاصه کار به فارسی:
روترهای gfw تلاش میکنند اما نمیتوانند همه packet های fragment را سرهم کنند زمانی که delay بین پکت ها باشد
چرا؟ چون کل ترافیک کشور ازشون عبور میکنه و براشون سخته و cache محدود دارند و باید سریع باشند
از طرفی gfw نمیتونه پکت های فرگمنت رو reject کنه چون اولا fragmet جزو اصول شبکه هست
ثانیا در خیلی از نت های ضعیف packet ها تکه میشوند
در صورت reject کردن نت بسیاری از گوشی های قدیمی و خطوط ضعیف مختل میشه
همچنین در مسیر روترهای پرسرعت fragmentation اتفاق می افته
و اینو gfw میدونه بنابراین سعی میکنه اسمبل کنه و اگر نتونه عبور میده
سرورها ولی موظف به سرهم کردن fragment ها هستند چون در پروتکل ip قید شده و سرشون به اندازه gfw شلوغ نیست
سرورهای کلودفلر به خوبی این کارو میکنن
باور کنید یا نکنید کار gfw ساختست
الان عمده ترافیک TLS هست و تنها با تحلیل SNI میتونه ترافیک TLS رو تفکیک کنه
و ما کار رو براش هزینه بر و پردازش بر میکنیم
یا باید کل cloudflare رو با همه سایت هاش ببنده و عملا نت جهانی رو قطع کنه
یا باید فرگمنت رو drop کنه که در هر صورت سیستم های خودشون هم دچار اختلال میشه
این سیستم تست شده و کار میکنه
و شما با domain فیلتر شده و با ip کثیف cloudflare میتوانید از gfw عبور کنید
با اندکی تنظیمات ، سرعت handshake اول هم بالا خواهد رفت
اینترنت برای همه یا برای هیچکس

goodbye SNI filtering & goodbye GFW mf'er



main Idea:

in TLS protocol (even latest v1.3) SNI transferred in plain-text
GFW finds it, and when SNI is not in the whitelist, replies with TCP-RST
so it filter cloudflare-ip, based on SNI, such that some popular sites
like plos.org is open, and all other sites closed, through that ip
so we need to hide SNI from GFW
we fragment TLS "client Hello" packet into chunks in a simple manner
we show that it passes the firewall
more importantly, we show that GFW can't fix it because its nearly impossible
to cache TBs of data in high-speed router, so they MUST give up or break the whole network



about SNI, ESNI & ECH (skip if you want)

leaking domain name (SNI) is the famous old bug of TLS protocol which is not fixed yet as of 2023
some attempt started a few years ago trying to encrypt SNI called ESNI, which is deprecated today
Cloudflare stopped supporting ESNI in the summer of 2022
another way is Encrypted Client Hello (ECH), which is in draft version and not well-documented
I made many efforts to use ECH, but its too complex and still is in development
also its based on DNS-over-HTTPS which is already filtered by GFW

about GFW SNI filtering on Cloudflare IPs (skip if you want)

Cloudflare IPs are high traffic, and 30% of the web is behind them
so GFW can't simply block them by traffic volume
and all traffic is encrypted except client hello, which leaks server name (SNI)


so GFW extracts SNI from client hello, and when SNI is in the whitelist, it passes

Alt text

if SNI is in the blacklist, GFW sends TCP-RST to terminate TCP socket

Alt text

about packet fragment (skip if you want)

we hide SNI by fragmenting client hello packet into several chunks.
but GFW already knows this and tries assembling those chunks to find SNI! LOL
but we add a time delay between fragments. LOL
since Cloudflare IPs have too much traffic, GFW can't wait too long. LOL
GFW high-speed cache is limited, so it can't cache TBs of data looking for a tiny TCP fragment. LOL
so it forgets those fragments after a second. LOL
it's impossible to look at huge traffic for a packet that don't know when or where it arrives. LOL
so it's forced to Give up. LOL

How to run

  1. assume that you have v2ray config {websocket+tls+Cloudflare}
  2. setup pyprox listen_port and cloudflare_dirty_ip

  3. setup your v2ray client to forward to 127.0.0.1:listen_port

  4. on your local machine, run
    python pyprox_tcp.py
  5. monitor traffic by Wireshark or Microsoft Network Monitor
  6. adjust fragment_size & fragment_sleep
    typical Client Hello packet is ~300 byte
    we split 300 into {77+77+77+69} and send each by delay of 0.3 second
    fragment_size=77 byte , fragment_sleep=0.3 sec -> moderate packet size with moderate delay -> work good
    another setup might be:
    fragment_size=77 byte , fragment_sleep=0.2 sec -> moderate packet size with moderate delay -> work nice
    fragment_size=17 byte , fragment_sleep=0.03 sec -> too small chunk with less delay -> work good
    too big chunk -> assembled by GFW -> TCP-RST recieved
    too small delay -> assembled by GFW -> TCP-RST recieved
  7. just surf the web using your filtered SNI and a dirty Cloudflare IP !

We are working on it to adjust parameters better

it might be slow at initiating TLS handshake
but we make it better by setting up persistent TLS
stay tuned!

TO DO NEXT

  1. implement into v2ray clients or xray-core -> Client Hello Fragmentation option
  2. setup persistent TLS (thus one handshake is enough for everything)
  3. sending TCP packet in reverse time order
  4. your ideas are welcome

About

knock up GFW sni detection in tls client hello

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%