- highlight_file: documentation ( source)
- mkdir: documentation ( source)
- preg_match: documentation ( source)
- chdir: documentation ( source)
- exec: documentation ( source)
- implode: documentation ( source)
- file_exists: documentation ( source)
<?php
highlight_file(__FILE__);
$dir = 'sandbox/' . $_SERVER['REMOTE_ADDR'];
if ( !file_exists($dir) )
mkdir($dir);
chdir($dir);
$args = $_GET['args'];
for ( $i=0; $i<count($args); $i++ ){
if ( !preg_match('/^\w+$/', $args[$i]) )
exit();
}
exec("/bin/orange " . implode(" ", $args));
?>