SuNiNaTaS의 6번문제 풀이입니다.
[WEB]

게시판이 하나 있다.

힌트에는 suninatas가 쓴 글을 읽으라고 되어있다.

suninatas의 글을 클릭하면 패스워드를 입력하라고 하는데, 밑에 쿼리문이 보인다.
SQL 인젝션을 해야한다는 의미인 것 같다.
select szPwd from T_Web13 where nIdx = '3' and szPwd = '"&pwd&"'
만약 우리가 패스워드로 123을 입력하면
select szPwd from T_Web13 where nIdx = '3' and szPwd = '123'
이 될 것이다.
그럼 이 구문을 참으로 만들어 주어야 한다.
select szPwd from T_Web13 where nIdx = '3' and szPwd = '1' or 1=1 --'
1' or 1=1 -- 이렇게 하면 참이 되는데... 해킹하지 말라는 문구가 뜬다. 이것저것 해보니 =을 필터링 하고 있었다.
그래서 1=1 대신 2>1로 바꿔서 입력해주어야 한다.
1' or 2>1 --

auth_key를 얻었고 이 글을 읽을 수 있다고 한다.

..? 접근권한이 없다고 한다. 게다가 authkey 인증도 틀렸다고 나온다.
뭔가 더 해야하는 것 같다.

이것 저것 뒤져보던 중에... auth%5key라는 쿠키값을 하나 찾았다.
이 쿠키값으로 suninatastopofworld!를 입력하고 다시 시도해보았으나 실패...
2번째 게시글에 있는 링크를 통해 위 값을 md5로 인코딩하고 이 해쉬값을 다시 쿠키에 넣어서 시도해 보았다.

성공...그러나 key를 찾으라고 한다...
소스...소스를 보자

키 힌트가 있다.


클리어