admin 으로 로그인 하라고 씌여있다. (the objective is to login as admin)
JWT 문제인 만큼 JWT값을 확인해 보도록 하자. (since it is a JWT problem, lets find JWT value)
먼저 guest로 로그인하면 어떤 값이든 줄것 같다. (login as guest would give us some values...)
쿠키값에 JWT 값이 들어있었다. (I could find JWT value inside the cookie)
한번 디코딩해 보자.(lets decode it)
우리는 payload 값만 admin으로 변조하면 성공이다.(we have to change the username value into admin)
여기서 문제가 해결되지 않는다.
시그니쳐 값이 맞지 않다는 것이다.(signature value is not right)
즉 암호화 부분의 값을 찾아주거나, 제거해주는 방법을 사용하면 된다. 내부적으로 암호화하는 로직이 없길 바래야겠다.(so we have to find the secret key of JWT or just leave it blank, lets hope that there is no encryption logic)
다음의 코드로 시그니쳐 값 부분을 none 으로 지정해주면 된다.( just give a none value to the signature using the code below)
import jwt
code = jwt.encode({"username": "admin"},"",algorithm='none')
print(code)
Clear!
'WriteUp > Root-me.org' 카테고리의 다른 글
Root me : Directory traversal (0) | 2020.12.28 |
---|---|
Rootme : Insecure Code Management (0) | 2020.12.28 |
Root-me[web_client] : Javascript - Webpack (0) | 2020.09.01 |
Command & Control - level 2 (0) | 2020.08.11 |
Root-me : [Web_Server]HTTP - Cookies (0) | 2020.08.04 |