> For the complete documentation index, see [llms.txt](https://gitbook-88.gitbook.io/ctf-writeup/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook-88.gitbook.io/ctf-writeup/2019/2019-ji-ke-da-tiao-zhan/upload.md).

# Upload

一步步推测：当上传一个php文件时

通过修改文件类型 image/gif

因此可以推断，修改文件类型绕过了第一层WAF，第二层WAF应该是基于文件后缀名来判断的。

逐个尝试可以使用的后缀名，发现.phtml后缀名是可以使用的，出现了第三层WAF。

推断这个是检查文件头，加上GIF89a绕过。

最终发现是上传成功的了，接下来就是修改一下文件加入马了。

<figure><img src="https://1298837596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUlxElCQcjylbSFsJycU3%2Fuploads%2FNYBd1B6aytoqTJ6pciFC%2F1.png?alt=media&amp;token=5b920e7e-d1ea-44ed-99a3-04ff177816ea" alt=""><figcaption></figcaption></figure>

蚁剑一下就有了
