vvanglro / cf-clearance

Purpose To make a cloudflare v2 challenge pass successfully, Can be use cf_clearance bypassed by cloudflare, However, with the cf_clearance, make sure you use the same IP and UA as when you got it.
https://github.com/vvanglro/cf_clearance
353 stars 58 forks source link

how to use in Doker ? More doc pls #15

Closed PlexPt closed 1 year ago

PlexPt commented 1 year ago

curl http://localhost:8000/challenge -H "Content-Type:application/json" -X POST -d '{"proxy": {"server": "socks5://localhost:38080"}, "timeout":20, "url": "https://chat.openai.com/chat"}'

{"success":true,"msg":"cf challenge success","user_agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36","cookies":{"cf_clearance":"mwV29nkv5mXzyvyvZ.aqgn59rL.hn_NunwUjp9g9tn0-1670827806-0-160","Host-next-auth.csrf-token":"e64048d7560707f3fc484abbe15fdc72c4fa170fd53f3af8a769d06221fa5dac%7C0b483ae212fb5c8cf8794bef893c8a0626b3eb8b367ac16521dccf8c56d9d0ed","Secure-next-auth.callback-url":"https%3A%2F%2Fchat.openai.com","__cf_bm":"u3MNGV6m86Ib2GUndQcUA6MlAijvK6qc9ngGWROAhlo-1670827806-0-Abk+W9FPVBjwtOq+VlJKeOGq5S7Xz/lQ9rTyzY9p9zUxz2bpM8Guiza56AJYIydDI97ESDSt/1/NiPOxVVLpWUQ="}}

PlexPt commented 1 year ago

then?

vvanglro commented 1 year ago

use cf_clearance in cookies, must be same IP and UA.

headers = {"user-agent": ua}
cookies = {"cf_clearance": cf_clearance_value}
res = requests.get('https://nowsecure.nl', proxies=proxies, headers=headers, cookies=cookies)
if '<title>Please Wait... | Cloudflare</title>' not in res.text:
    print("cf challenge success")
PlexPt commented 1 year ago

Make the setting proxy part optional This is very strange, why do I have to set up an agent It can be used even if it is not set

PlexPt commented 1 year ago

"proxy": {"server": "socks5://localhost:38080"}

vvanglro commented 1 year ago

Try latest version.