当前位置:网站首页>BUUCTF做题Upload-Labs记录pass-01~pass-10
BUUCTF做题Upload-Labs记录pass-01~pass-10
2022-07-28 19:16:00 【Goodric】
BUUCTF做题Upload-Labs记录pass-01~pass-10
——
pass-01
前端验证后缀。
传1.png 抓包改1.php 即可。
蚁剑连:http://your-ip/upload/1.php
——
pass-02
验证content-type
抓包注意:Content-Type: image/jpeg
同样传1.png 抓包改1.php
——
pass-03
过滤情况:小写,删除文件名末尾点,首尾去空格
黑名单,不允许上传.asp,.aspx,.php,.jsp后缀文件!
php3 ,php4 ,pht ,phtml 之类能上传成功
上传的文件名被更改为时间戳
利用:/upload/202207250818552340.php3,可蚁剑连接
条件:
要在apache的httpd.conf中有如下配置代码:AddType application/x-httpd-php .php .phtml .phps .php5 .pht,如果不配置他是无法解析php5代码的,访问的时候就是一个空白页
——
pass-04
过滤情况:小写,删除文件名末尾点,首尾去空格,去除字符串::$DATA(上传到服务器的文件在Windows中会自动去掉::$DATA)
跟上一题比不能用php4 ,pht ,phtml 之类
这里通过htaccess文件,可以帮我们实现:网页301重定向、自定义404错误页面、改变文件扩展名、允许/阻止特定的用户或者目录的访问、禁止目录列表、配置默认文档等功能。
设置当前目录所有文件都使用PHP解析,那么无论上传任何文件,只要文件内容符合PHP语言代码规范,就会被当作PHP执行。不符合则报错。
需要上传两个文件
一个 .htaccess文件:
内容:
<FilesMatch "上传的图片马的文件名">
SetHandler application/x-httpd-php
</FilesMatch>

另一个图片马 1.jpg ,就是直接把前面几题传的马后缀改为.jpg
利用:/upload/2.jpg
——
pass-05
过滤情况:删除文件名末尾的点,去除字符串::$DATA,首尾去空, .htaccess后缀文件也被过滤
上传的文件名会修改为时间戳
没有把文件名全部小写的条件了,大小写过滤:.Php
利用:/upload/202207251044098514.Php
有方法说用第四关的构造后缀,但是我这里尝试似乎行不通,比如上传5.php. .
文件名就变成了 xxx. (无后缀)
——
pass-06
过滤情况:删除文件名末尾的点,转换为小写,去除字符串::$DATA
源码和前面相比,没有首尾去空格这条过滤。
所以可以在后缀 php 后面加个空格 “1.php ”
虽然能够上传成功,但是好像无法被利用,访问并没有被php解析。
——
pass-07
过滤情况:转换为小写,去除字符串::$DATA,首尾去空
对比前面,没有删除文件名末尾的点
上传7.php.
利用:/upload/7.php.
——
pass-08
过滤情况:删除文件名末尾的点,转换为小写,首尾去空
相比前面没有去除字符串::$DATA
上传 8.php::$DATA
这里是 linux ,不得行。
——
pass-09
过滤情况:删除文件名末尾的点,转换为小写,去除字符串::$DATA,首尾去空
按网上方法传 php. .
但是返回的文件名有问题
Apache/2.4.38 (Debian) Server
apache解析漏洞
传 .php.jpg
利用:/upload/2.php.jpg
——
pass-10
str_ireplace($deny_ext,"", $file_name);
函数将匹配到的字符替换为空
双写绕过
上传 .pphphp
利用:/upload/10.php
——
这些全部为黑名单绕过,而且只是验证一次,所以这些关卡全部可以用一个思路解出来,那就是.php. . 都是可以这样的,但是这就违背了创建靶场者的心思,靶场也就失去了意义,发挥不出靶场真正的作用。
边栏推荐
- After Europe, it entered Japan and South Korea again, and the globalization of Pico consumer VR accelerated
- 使用缓冲的方式采集视频
- C foundation 2-encapsulation, inheritance, polymorphism
- Unity foundation 1 - event execution sequence, custom events
- Efficientformer: lightweight vit backbone
- Deit: attention can also be distilled
- dll反编译(反编译加密dll)
- Thinking and summary of R & D Efficiency
- Lazada店铺如何产号高效补单?(测评自养号技术详解篇)
- 融合数据库生态:利用 EventBridge 构建 CDC 应用
猜你喜欢

DeiT:注意力Attention也能蒸馏

The EMC vnx5200 fault light is on, but there is no hardware fault prompt

Deit: attention can also be distilled

有奖征文 | 2022 云原生编程挑战赛征稿活动开启

New development of letinar in Korea: single lens 4.55G, light efficiency up to 10%

广和通&高通物联网技术开放日成功举办

Subcontracting loading of wechat applet

Moco V1: the visual field can also be self supervised

Unity - script lifecycle

《软件设计师考试》易混淆知识点
随机推荐
JS fly into JS special effect pop-up login box
Integrating database Ecology: using eventbridge to build CDC applications
远光软件获得阿里云产品生态集成认证,携手阿里云共建新合作
Unity foundation 3- data persistence
Unity - Fundamentals of 3D mathematics
记一次Runtime.getRuntime().exce(“command“)报错
Unity - script lifecycle
Unity foundation 2 editor expansion
Explain in detail the rays and radiographic testing in unity
Alibaba cloud MSE supports go language traffic protection
Explain the camera in unity and its application
C foundation 2-encapsulation, inheritance, polymorphism
Moco V2: further upgrade of Moco series
A 58 year old native of Anhui Province, he has become the largest IPO investor in Switzerland this year
Establishment of flask static file service
Meaning of disk status of EMC DataDomain
ntp服务器 时间(查看服务器时间)
Subcontracting loading of wechat applet
什么是低代码?哪些平台适合业务人员?用来开发系统靠不靠谱?
Tested interviewed Zuckerberg: reveal more details of four VR prototypes