Блог пользователя wabowabo

Автор wabowabo, история, 4 года назад, По-английски

Hello All!

When I try to access codeforces.com, I get a 403 error.

This is the response for codeforces.com/

<html><body>Redirecting... Please, wait.<script type="text/javascript" src="/aes.min.js" ></script><script>function toNumbers(d){var e=[];d.replace(/(..)/g,function(d){e.push(parseInt(d,16))});return e}function toHex(){for(var d=[],d=1==arguments.length&&arguments[0].constructor==Array?arguments[0]:arguments,e="",f=0;f<d.length;f++)e+=(16>d[f]?"0":"")+d[f].toString(16);return e.toLowerCase()}var a=toNumbers("e9ee4b03c1d0822987185d27bca23378"),b=toNumbers("188fafdbe0f87ef0fc2810d5b3e34705"),c=toNumbers("f7480ad2e21e5dca78cdb18dade0a3a1");document.cookie="RCPC="+toHex(slowAES.decrypt(c,2,a,b))+"; expires=Thu, 31-Dec-37 23:55:55 GMT; path=/";document.location.href="https://codeforces.net/?f0a28=1";</script></body></html>

This is the curl representation of the request for the above response (for the redirect):

curl 'https://codeforces.net/?f0a28=1' -H 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Connection: keep-alive' -H 'Referer: https://codeforces.net/' -H 'Cookie: RCPC=c2c90c250d2e9dc04517bdc72fe23d' -H 'Upgrade-Insecure-Requests: 1' -H 'TE: Trailers'

I verified that the RCPC request matches the AES parameters in the response by testing the AES parameters on a different system.

I tried changing browsers and resetting cache for codeforces.com to no avail.

After changing IP addresses, I could access codeforces.com successfully, so I suspect my IP address has been blocked.

I would appreciate any help, MikeMirzayanov or anyone.

Thanks!

UPD: A very kind codeforces user by the name of prophet_ has solved the issue by stating that I have to change my RCPC token! His solution is described here: https://codeforces.net/blog/entry/80070.

  • Проголосовать: нравится
  • +31
  • Проголосовать: не нравится

»
4 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by wabowabo (previous revision, new revision, compare).

»
4 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by wabowabo (previous revision, new revision, compare).

»
4 года назад, # |
Rev. 2   Проголосовать: нравится +1 Проголосовать: не нравится

The same, I'm using a proxy server in RU now.

I'm in China, I get 403 if I don't use a proxy server, don't know what happened.

Hope Mike can fix it soon.

  • »
    »
    4 года назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    I found the solution which worked for the author of this blog. The aes javascript is bugged and likely removed the last two digits of your token. If you send me your response from codeforces.com without redirects and I can send you the corrected token.

    If you're on linux or max for example, you can send me the response to the command "curl codeforces.com"

    • »
      »
      »
      4 года назад, # ^ |
        Проголосовать: нравится +1 Проголосовать: не нравится

      I got it.

      It is a cookie error, after clearing the cookie and login again, I can now enter codeforces normally, THANK YOU VERY MUCH!!!

»
4 года назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

I noticed that your RCPC token "c2c90c250d2e9dc04517bdc72fe23d" is only 30 characters where all of the tokens I have succeeded with have 32 characters. I did some investigation and found that around 8% of the aes parameters (c=toNumbers("f7480ad2e21e5dca78cdb18dade0a3a1")) in the response result in 30 character token.

I'm not yet sure why this the case, but I suspect this might be the issue.

»
4 года назад, # |
Rev. 2   Проголосовать: нравится +1 Проголосовать: не нравится

I FIGURED IT OUT!!!

I reverse engineered the AES encryption and found the mistake. It deleted the last two characters of your RCPC token.

It should be "c2c90c250d2e9dc04517bdc72fe23d0d".

Change your RCPC cookie to that and it should work for you!

»
4 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by wabowabo (previous revision, new revision, compare).

»
4 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by wabowabo (previous revision, new revision, compare).