본문 바로가기
Wargame/webhacking.kr

webhacking.kr 53번

by morae23 2019. 1. 29.

53번 문제를 보면 아래와 같이 hello world라는 문자열을 볼 수 있다.

 

 



 

 

힌트로 주어진 index.phps 는 아래와 같다.

 

 



 

 

clear하기 위해서는 answer에 $hidden_table을 전달해야 한다.

 

이 때, mysql_fetch_array()의 결과를 echo()를 통해 출력하는 것을 볼 수 있다.

 

 



 

 

먼저 ?val=1을 해보면 위와 같이 test가 출력된다.

select test1 from $hidden_table where test2=1

의 결과이다.

 

여기서 test1의 값이 아닌 테이블의 이름이 출력되도록 하면 클리어할 수 있다.

 

따라서 mysql에서 제공하는 procedure analyse()를 이용한다.

 

 



출처: https://dev.mysql.com/doc/refman/5.6/en/procedure-analyse.html

 

 

아래와 같이 ?val=1 procedure analyse()를 입력하면

해당 컬럼에 대한 정보를 볼 수 있다.

 

 



 

 

위의 결과를 보면 DB이름은 webhacking이고,

table 이름은 Chal12NGe_53_TabLE_zz 인 것을 알 수 있다.

 

 

Answer에 Chal12NGe_53_TabLE_zz를 입력하면 clear할 수 있다.

 

 



 

 



 

 



'Wargame > webhacking.kr' 카테고리의 다른 글

webhacking.kr 41번  (0) 2019.01.29
webhacking.kr 51번  (0) 2019.01.29
webhacking.kr 60번  (0) 2019.01.29
webhacking.kr 43번  (0) 2019.01.29
webhacking.kr 47번  (0) 2019.01.29

댓글