RanolP / crowdin-strife

The EX-CROWDIN Bot for Minecraft Translation Support
0 stars 0 forks source link

Crowdin 내부 API 뜯기 #1

Closed RanolP closed 2 years ago

RanolP commented 2 years ago

CSRF Token 갱신 로직만 알면 될 것 같은데

RanolP commented 2 years ago

Crowdin 가서

getCsrfToken.toString() 

치면 소스 코드 나옴

핵심 코드는

encodeURIComponent(Math.random().toString(36).substring(2, 12))
RanolP commented 2 years ago

MDN web docs에 따르면

Not Escaped:

    A-Z a-z 0-9 - _ . ! ~ * ' ( )

인데, Math.random()이 [0, 1) 범위라서 toString()하면 0.{alphanumeric}이 나온다. 그러므로 encodeURIComponent는 아무 기능이 없으며 10자리의 alphanumeric한 문자열이다.

RanolP commented 2 years ago

저거 더미 값이네 없어도 요청 감 왜 넣는 거야 ㅋㅋㅋㅋㅋㅋㅋ

RanolP commented 2 years ago

https://accounts.crowdin.com/auth/token?refresh=true에 요청을 날리면 set-cookie 헤더를 돌려준다

RanolP commented 2 years ago

다 뜯음 수고