xtekky / gpt4free

The official gpt4free repository | various collection of powerful language models
https://g4f.ai
GNU General Public License v3.0
59.79k stars 13.19k forks source link

ChatGPT: Cloudflare Turnstile replaces Arkose Labs #2105

Closed gamelist1990 closed 1 week ago

gamelist1990 commented 1 month ago

ChatGPT Authentication Changes

Description: ChatGPT's authentication mechanism has been updated, making it significantly harder to bypass security measures using previously known techniques.

Specific Changes:

Impact:

These changes have made it extremely difficult, if not impossible, to bypass authentication using HAR file analysis and basic PoW generation techniques.

Additional Information:

Attempts to obtain access tokens and solve PoW challenges using previously working methods now result in either a 403 Forbidden response or connection timeouts.

Reproduction Steps:

  1. Open ChatGPT in a web browser.
  2. Monitor network requests to identify the chat-requirements endpoint.
  3. Attempt to extract Turnstile token and solve the PoW challenge using the extracted seed and difficulty values.

As a result, it failed.

gamelist1990 commented 1 month ago

I need to think of a new solution, but the only way I can think of is to directly clear and extract it using a headless browser that has been patched, such as Playwright Stealth. Are there any other solutions?

gamelist1990 commented 1 month ago

PS C:\Users\PC\Music\api-1> & c:/Users/PC/Music/api-1/.venv/Scripts/python.exe c:/Users/issei/Music/api-1/a.py
Read .har file: c:\Users\PC\Music\api-1\har\chatgpt.com.har Read .har file: c:\Users\PC\Music\api-1\har\gemini.google.com.har Cookies added: 18 from .google.com Read .har file: c:\Users\PC\Music\api-1\har\huggingface.co.har Cookies added: 2 from huggingface.co Read cookie file: c:\Users\PC\Music\api-1\har\gemini.json Cookies added: 2 from .gemini.google.com Cookies added: 18 from .google.com Read cookie file: c:\Users\PC\Music\api-1\har\rika.json Cookies added: 1 from chat.reka.ai Failed to check g4f version: Version not found Using OpenaiChat provider and auto model DEBUG:har_file:getArkoseAndAccessToken() が呼び出されました DEBUG:har_file:accessToken が None です。 readHAR() を呼び出します DEBUG:har_file:readHAR() が呼び出されました DEBUG:har_file:処理する .har ファイル: ./har\chatgpt.com.har DEBUG:har_file:HTML から accessToken を取得しました: eyJhbGcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx DEBUG:har_file:get_headers() が呼び出されました Arkose: False Proofofwork: gAAAAABWzI1M... こんにちは!今日はどんなお手伝いが必要ですか? PS C:\Users\PC\Music\api-1>

gamelist1990 commented 1 month ago

Well, I combined the existing Arkose logic with my new logic, but it's only temporary.

gamelist1990 commented 1 month ago

                    "accept": "text/event-stream",
                    "Openai-Sentinel-Chat-Requirements-Token": chat_token,
                    **cls._headers
                }
               # turnstileTokenがNoneでない場合のみヘッダーに追加
                if turnstile_token is not None:  
                   headers["Openai-Sentinel-turnstile-Token"] = turnstile_token
                if  proofofwork is not None:
                   headers["Openai-Sentinel-Proof-Token"] = proofofwork

                logger.debug("会話リクエストを送信します: %s", data)
                async with session.post(
                    f"{cls.url}/backend-anon/conversation"
                    if cls._api_key is None else
                    f"{cls.url}/backend-api/conversation",
                    json=data,
                    headers=headers ```
gamelist1990 commented 1 month ago

https://github.com/xtekky/gpt4free/issues/2087 https://github.com/xtekky/gpt4free/issues/2092

xtekky commented 1 month ago

I will have a look. If its too hard, we will likely have to remove openai from gpt4free

BlackStar1453 commented 1 month ago

This problem seems to have been fixed already, but it isn't functioning well in my code.l am still trying to figure it out.

github-actions[bot] commented 1 month ago

Bumping this issue because it has been open for 7 days with no activity. Closing automatically in 7 days unless it becomes active again.

gamelist1990 commented 1 month ago

up

vi-vlasov commented 1 month ago

@BlackStar1453 Have you made any progress in bypassing openai protection?

vi-vlasov commented 1 month ago

I saw a solution in go for this problem, but I don't know enough go to repeat it in python

github-actions[bot] commented 3 weeks ago

Bumping this issue because it has been open for 7 days with no activity. Closing automatically in 7 days unless it becomes active again.

iG8R commented 3 weeks ago

up

github-actions[bot] commented 2 weeks ago

Bumping this issue because it has been open for 7 days with no activity. Closing automatically in 7 days unless it becomes active again.

github-actions[bot] commented 1 week ago

Closing due to inactivity.