<?php
    
// from https://github.com/orangetw/My-CTF-Web-Challenges#babyfirst-revenge

    
$sandbox '/code/sandbox/'.md5("parcham" $_SERVER['HTTP_X_FORWARDED_FOR']);
    @
mkdir($sandbox);
    @
chdir($sandbox);
    if (isset(
$_GET['cmd']) && strlen($_GET['cmd']) <= 5) {
        @
exec($_GET['cmd']);
    } else if (isset(
$_GET['reset'])) {
        
exec('/bin/rm -rf ' $sandbox);
    }
    
highlight_file(__FILE__);