maple3142 / cf-warp

MIT License
449 stars 64 forks source link

HTTPError: Forbidden — Unable to create Warp account #13

Closed ghost closed 4 years ago

ghost commented 4 years ago

Every time I run "cf-warp" command I get "UnhandledPromiseRejectionWarning: HTTPError: Forbidden" error after "Initializing Warp credentials..." message pops up. I tried connecting to different Wi-Fi networks and using various VPNs, but I still get this error.

Could this possibly mean that Cloudflare finally banned cf-warp? I'm using cf-warp with Node 13.13.0 (Yarn 1.22.4) on macOS Catalina.

ahbanavi commented 4 years ago

i'm having the same problem here.

➜  ~ cf-warp   
Initializing Warp credentials...

(node:7419) UnhandledPromiseRejectionWarning: HTTPError: Forbidden
    at responseErrorThrower (/usr/lib/node_modules/cf-warp/node_modules/xfetch-js/xfetch.js:37:22)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async module.exports (/usr/lib/node_modules/cf-warp/lib/register.js:11:15)
    at async init (/usr/lib/node_modules/cf-warp/cli.js:36:15)
(node:7419) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:7419) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
slickag commented 4 years ago

Been getting the same error for a few days now (even tried it on a VPS that had never run cf-warp just in case they were blocking my PC/IP specifically).

It might have something to do with their announcement that their Windows/MacOS apps are currently in beta so maybe they finally blocked this script.

maple3142 commented 4 years ago

I think we need someone to reverse engineer CloudFlare's api again.

litori commented 4 years ago

This script works: https://github.com/iSumitBanik/Cloudflare-WARP-Plus-Script

ghost commented 4 years ago

This script works: https://github.com/iSumitBanik/Cloudflare-WARP-Plus-Script

Unfortunately, this script only gives you free Warp+ data.

eligao commented 4 years ago

Did some package capturing using HttpCanary on my phone (some credentials altered):

curl --location --request POST 'https://api.cloudflareclient.com/v0a977/reg' \
--header 'Content-Type: application/json; charset=UTF-8' \
--header 'Host: api.cloudflareclient.com' \
--header 'Connection: Keep-Alive' \
--header 'Accept-Encoding: gzip' \
--header 'User-Agent: okhttp/3.12.1' \
--header 'Content-Type: application/json' \
--data-raw '{"key":"U5cC4PeewwlEcaU2wYJyUwCucK3ZssP61zSt28VgWwM=","install_id":"f7acBAU4RbmRuVrFG_UB9K","fcm_token":"f7acBAU4RbmRuVrFG_UB9K:APA91bFZIMB6pSZlcfM6z6INBwb_Nz0Aa9uIuOj8v7d8smBPjv0VT7vm1wmLDdl1usws5MXEqIKZm1k3KIL4PMdG7axStEmN3ycJb_ZIluMw1d_wxlpmIFmzvkcK0xfQvtu293lN-IYl","tos":"2020-05-05T16:45:29.126+03:00","model":"OnePlus a5000","type":"Android","locale":"en_US"}' \
--verbose \
--compressed

Notice the API version changed (to v0a977) This request gets 403 (Error 1020) when requested from curl, postman or nodejs on my laptop, but replaying this request on HttpCanary gets a 401:

{
  "result": null,
  "success": false,
  "errors": [
    {
      "code": 1001,
      "message": "Invalid public key"
    }
  ],
  "messages": []
}

which is expected because the key can be used only once.

Basically I think the API didn't change. This might have something to do with some new WAF rules.

eligao commented 4 years ago

The python warpy tool still works (https://github.com/warp-plus/warpy) Cloudflare could be checking request TLS Client Hello, Here we might just try specifying ciphersuites and tls versions just like warpy did: https://github.com/warp-plus/warpy/commit/57ba0e62ec3c900959393815a56cc2f399eeb954