sql - SQL注入枚举列
问题描述
以下查询用于从数据库中获取所有表
1 = select top 1 name
from sys.tables
where object_id = (select top 1 object_id
from (select top 5 object_id
from sys.tables
order by object_id
)sq
order by object_id DESC
)
如何使用 sys.columns 的类似方法枚举数据库中所有易受攻击的列
谢谢
解决方案
为什么不简单地使用row_number()
:
select t.name
from (select t.*, row_number() over (order by object_id) as seq
from sys.tables t
) t
where seq = 5;
推荐阅读
- jquery-easyui - 如何翻译 EasyUI 日期框
- c++ - 无法从文件中读取
- python - 我想使用 jython 运行 dask.dataframe
- logback - logback - [root] 没有适用的操作
- apache-camel - 骆驼蓝图更新cfg文件属性值
- java - Java:如何将 IP 地址转换为二进制和十六进制
- function - 使用差分进化为预算问题找到正确的优化适应度函数
- javascript - 在javascript中将字符串从句子拆分为换行符
- codeigniter - Codeigniter 致命错误:调用非对象上的成员函数 getMessage()
- regex - 在 sed 命令和 ssh 命令中添加单引号