<?php
// from https://github.com/orangetw/My-CTF-Web-Challenges#babyfirst
highlight_file(__FILE__);
$dir = 'sandbox/' . md5("parcham" . $_SERVER['HTTP_X_FORWARDED_FOR']);
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));
?>
Warning: mkdir(): No space left on device in /code/index.php on line 8
Warning: chdir(): No such file or directory (errno 2) in /code/index.php on line 9
Warning: implode(): Invalid arguments passed in /code/index.php on line 16