반응형
https://webhacking.kr/challenge/js-6/
[문제]
[풀이]
id를 입력하여 제출할 수 있는 페이지이다.
guest로 로그인 하면
userid가 생성된다.
YjJmNWZmNDc0MzY2NzFiNmU1MzNkOGRjMzYxNDg0NWQ3Yjc3NGVmZmU0YTM0OWM2ZGQ4MmFkNGY0ZjIxZDM0Y2UxNjcxNzk3YzUyZTE1Zjc2MzM4MGI0NWU4NDFlYzMyMDNjN2MwYWNlMzk1ZDgwMTgyZGIwN2FlMmMzMGYwMzRlMzU4ZWZhNDg5ZjU4MDYyZjEwZGQ3MzE2YjY1NjQ5ZQ%3D%3D
쿠키값은 base64로 인코딩 되어있다. (%3D는 =와 같다)
b2f5ff47436671b6e533d8dc3614845d7b774effe4a349c6dd82ad4f4f21d34ce1671797c52e15f763380b45e841ec3203c7c0ace395d80182db07ae2c30f034e358efa489f58062f10dd7316b65649e
base64로 해독하면 위 쿠키값이 나온다.
md5같은데.. 너무 길다.
혹시 몰라서 32자씩 끊어서 해독해보았다.
g u e s t 다섯개의 값이 나왔다.
userid의 쿠키값은 입력한 id를 한 문자씩 md5로 인코딩하여 나열한 값을 base64로 인코딩하여 저장한다는 것을 알았다.
우리는 a d m i n 을 md5로 각 문자씩 인코딩, 나열 후 base64로 인코딩하여 userid에 저장하고 새로고침하면 문제가 풀린다.
md5(a) = 0cc175b9c0f1b6a831c399e269772661
md5(d) = 8277e0910d750195b448797616e091ad
md5(m) = 6f8f57715090da2632453988d9a1501b
md5(i) = 865c0c0b4ab0e063e5caa3387c1a8741
md5(n) = 7b8b965ad4bca0e41ab51de7b31363a1
base64(0cc175b9c0f1b6a831c399e2697726618277e0910d750195b448797616e091ad6f8f57715090da2632453988d9a1501b865c0c0b4ab0e063e5caa3387c1a87417b8b965ad4bca0e41ab51de7b31363a1) = MGNjMTc1YjljMGYxYjZhODMxYzM5OWUyNjk3NzI2NjE4Mjc3ZTA5MTBkNzUwMTk1YjQ0ODc5NzYxNmUwOTFhZDZmOGY1NzcxNTA5MGRhMjYzMjQ1Mzk4OGQ5YTE1MDFiODY1YzBjMGI0YWIwZTA2M2U1Y2FhMzM4N2MxYTg3NDE3YjhiOTY1YWQ0YmNhMGU0MWFiNTFkZTdiMzEzNjNhMQ==
반응형