Mishiranu / Dashchan

Imageboards client for Android
GNU General Public License v3.0
397 stars 49 forks source link

Cloudflare challenges #325

Open ananimas-ligivon opened 2 years ago

ananimas-ligivon commented 2 years ago

@Mishiranu I am willing to pay 2 XMR to get this thing solved, can pay ahead of time.

2ch.life (hk) is now protected under CloudFlare's anti-ddos feature, which requires the client to resolve a challenge, which breaks Dashchan posting on an url like https://2ch.life/ukr/ A typical response would include a 403 error with

HTTP/2 403
server: cloudflare
cf-ray: 706156860d4c9c06-FRA
...

With html code that includes javascript that then is supposed to solve the challenge. Once the challenge is solved, the cookies are later needed for subsequent calls.

Suggested solution: when a challenge is detected, open up a browser with html contents, and when it redirects to the original url (after captcha/js challenge is solved), steal those cookies and close the browser.

ghost commented 2 years ago

Try using this APK. I had to make a change for another site that uses CloudFlare, but I suspect it's probably the same issue. Dashchan actually already supports CloudFlare, but it seems the way it detects it is outdated (checks for page title, but there is now a different title that CF uses). https://github.com/Xyl-AU/Dashchan-Extensions/releases/download/soyjakparty-1.1/Dashchan.apk

You can see the changes I made and build it from source here: https://github.com/Xyl-AU/Dashchan

EDIT: It appears this doesn't work when hCaptcha is required. Trying to fix this. But usually solveable just by cancelling the captcha dialog and refreshing.