一、什么是双写绕过
顾名思义,双写绕过就是双写文件后缀名来进行绕过,如:test.php 双写后为 test.pphphp。通常情况下双写绕过用于绕过源代码中的 str_ireplace()函数。
二、双写绕过原理
1、首先进行代码审计,源代码中有黑名单和str_ireplace()函数的联合使用,将黑名单中的敏感后缀名全部都进行了删除。

这就会使我们上传的 test.php 上传后变成 test. ,这就会使Apache无法解析,以至于不会执行文件中的php代码,如图:

但是,str_ireplace() 函数也有缺陷,那就是只会进行一次删除操作,我们这时就可以使用双写进行绕过。test.pphphp 被删除一次php后依然还剩 test.php,这样就可以成功执行php代码。
三、通关操作
1、首先上传test.php文件,利用 Burpsuite 进行抓包,将filename中的 test.php后缀双写。

2、发包,文件上传成功,新标签页中打开,代码成功执行。

---通关。