SystemInfo.cs 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456
  1. using System;
  2. using System.Diagnostics;
  3. using System.IO;
  4. using Microsoft.Win32;
  5. using System.Net.NetworkInformation;
  6. using System.Net;
  7. using System.Security.Principal;
  8. using System.Text.RegularExpressions;
  9. using System.Runtime.InteropServices;
  10. using Shell32;
  11. namespace DecryptPwd.Utils
  12. {
  13. /// <summary>
  14. /// 获取系统信息
  15. /// </summary>
  16. class SystemInfo
  17. {
  18. static void test(string[] args)
  19. {
  20. System.Console.WriteLine("");
  21. System.Console.WriteLine("Author: Uknow");
  22. System.Console.WriteLine("Github: https://github.com/uknowsec/SharpCheckInfo");
  23. System.Console.WriteLine("");
  24. if (args.Length != 1)
  25. {
  26. System.Console.WriteLine("Usage: SharpCheckInfo -All");
  27. System.Console.WriteLine(" SharpCheckInfo -EnvironmentalVariables");
  28. System.Console.WriteLine(" SharpCheckInfo -GetRecycle");
  29. System.Console.WriteLine(" SharpCheckInfo -AllUserDirectories");
  30. System.Console.WriteLine(" SharpCheckInfo -PowershellInfo");
  31. System.Console.WriteLine(" SharpCheckInfo -CsharpVersion");
  32. System.Console.WriteLine(" SharpCheckInfo -AvProcessEDRproduct");
  33. System.Console.WriteLine(" SharpCheckInfo -Defender");
  34. System.Console.WriteLine(" SharpCheckInfo -RecentFiles");
  35. System.Console.WriteLine(" SharpCheckInfo -NetworkConnentions");
  36. System.Console.WriteLine(" SharpCheckInfo -ApplockerEnumerating");
  37. System.Console.WriteLine(" SharpCheckInfo -Drives");
  38. System.Console.WriteLine(" SharpCheckInfo -LAPS");
  39. }
  40. if (args.Length == 1 && (args[0] == "-All"))
  41. {
  42. Console.WriteLine("");
  43. Console.WriteLine("========== SharpCheckInfo --> All ==========");
  44. Console.WriteLine("");
  45. EnvironmentalVariables();
  46. GetRecycleBinFilenames();
  47. AllUserDirectories();
  48. PowershellInfo();
  49. Csharp_Version();
  50. AvProcessEDRproduct();
  51. Defender();
  52. Recent_files();
  53. Network_Connentions();
  54. Applocker_Enumerating();
  55. Drives();
  56. LAPS();
  57. }
  58. if (args.Length == 1 && (args[0] == "-EnvironmentalVariables"))
  59. {
  60. Console.WriteLine("");
  61. Console.WriteLine("========== SharpCheckInfo --> EnvironmentalVariables ==========");
  62. Console.WriteLine("");
  63. EnvironmentalVariables();
  64. }
  65. if (args.Length == 1 && (args[0] == "-GetRecycle"))
  66. {
  67. Console.WriteLine("");
  68. Console.WriteLine("========== SharpCheckInfo --> GetRecycle ==========");
  69. Console.WriteLine("");
  70. GetRecycleBinFilenames();
  71. }
  72. if (args.Length == 1 && (args[0] == "-AllUserDirectories"))
  73. {
  74. Console.WriteLine("");
  75. Console.WriteLine("========== SharpCheckInfo --> AllUserDirectories ==========");
  76. Console.WriteLine("");
  77. AllUserDirectories();
  78. }
  79. if (args.Length == 1 && (args[0] == "-PowershellInfo"))
  80. {
  81. Console.WriteLine("");
  82. Console.WriteLine("========== SharpCheckInfo --> PowershellInfo ==========");
  83. Console.WriteLine("");
  84. PowershellInfo();
  85. }
  86. if (args.Length == 1 && (args[0] == "-CsharpVersion"))
  87. {
  88. Console.WriteLine("");
  89. Console.WriteLine("========== SharpCheckInfo --> CsharpVersion ==========");
  90. Console.WriteLine("");
  91. Csharp_Version();
  92. }
  93. if (args.Length == 1 && (args[0] == "-AvProcessEDRproduct"))
  94. {
  95. Console.WriteLine("");
  96. Console.WriteLine("========== SharpCheckInfo --> AvProcessEDRproduct ==========");
  97. Console.WriteLine("");
  98. AvProcessEDRproduct();
  99. }
  100. if (args.Length == 1 && (args[0] == "-Defender"))
  101. {
  102. Console.WriteLine("");
  103. Console.WriteLine("========== SharpCheckInfo --> Defender ==========");
  104. Console.WriteLine("");
  105. Defender();
  106. }
  107. if (args.Length == 1 && (args[0] == "-RecentFiles"))
  108. {
  109. Console.WriteLine("");
  110. Console.WriteLine("========== SharpCheckInfo --> RecentFiles ==========");
  111. Console.WriteLine("");
  112. Recent_files();
  113. }
  114. if (args.Length == 1 && (args[0] == "-NetworkConnentions"))
  115. {
  116. Console.WriteLine("");
  117. Console.WriteLine("========== SharpCheckInfo --> NetworkConnentions ==========");
  118. Console.WriteLine("");
  119. Network_Connentions();
  120. }
  121. if (args.Length == 1 && (args[0] == "-ApplockerEnumerating"))
  122. {
  123. Console.WriteLine("");
  124. Console.WriteLine("========== SharpCheckInfo --> ApplockerEnumerating ==========");
  125. Console.WriteLine("");
  126. Applocker_Enumerating();
  127. }
  128. if (args.Length == 1 && (args[0] == "-Drives"))
  129. {
  130. Console.WriteLine("");
  131. Console.WriteLine("========== SharpCheckInfo --> Drives ==========");
  132. Console.WriteLine("");
  133. Drives();
  134. }
  135. if (args.Length == 1 && (args[0] == "-LAPS"))
  136. {
  137. Console.WriteLine("");
  138. Console.WriteLine("========== SharpCheckInfo --> LAPS ==========");
  139. Console.WriteLine("");
  140. LAPS();
  141. }
  142. }
  143. public static void EnvironmentalVariables()
  144. {
  145. //ENVIRONMENTAL VARIABLES 系统信息
  146. WindowsPrincipal myId = new WindowsPrincipal(WindowsIdentity.GetCurrent());
  147. var operating_system = Environment.OSVersion;
  148. Console.WriteLine("[+] Environmental Variables");
  149. Console.WriteLine("\tComputer Name: " + Environment.MachineName);
  150. Console.WriteLine("\tPlatform: " + operating_system.Platform + " - " + operating_system.VersionString);
  151. Console.WriteLine("\tRunning as User: " + Environment.UserName);
  152. Console.WriteLine("\tLocal Admin Privs: " + myId.IsInRole("BUILTIN\\" + "Administrators"));
  153. Console.WriteLine("\tOSVersion: {0}", Environment.OSVersion.ToString());
  154. Console.WriteLine("\tDomain: " + Environment.UserDomainName);
  155. //获取系统环境变量 用以判断是否安装Java,Python等编程环境
  156. Console.WriteLine("\n[+] System environment variable Path");
  157. string path = "Environment";
  158. RegistryKey masterKey = Registry.CurrentUser.OpenSubKey(path);
  159. string sPath = masterKey.GetValue("Path").ToString();
  160. masterKey.Close();
  161. //string sPath = Environment.GetEnvironmentVariable("Path");
  162. string[] sArray = Regex.Split(sPath, ";", RegexOptions.IgnoreCase);
  163. foreach (string i in sArray)
  164. {
  165. Console.WriteLine("\t" + i);
  166. }
  167. }
  168. public static void AllUserDirectories()
  169. {
  170. //ALL USER FOLDERS ACCESS
  171. Console.WriteLine("\n[+] All user directories");
  172. string[] dirs = Directory.GetDirectories(@"c:\users");
  173. foreach (string dir in dirs)
  174. {
  175. try
  176. {
  177. System.Security.AccessControl.DirectorySecurity ds = Directory.GetAccessControl(dir);
  178. Console.WriteLine("\t[*] " + dir + " Folder is accessible by current user");
  179. }
  180. catch (UnauthorizedAccessException)
  181. {
  182. Console.WriteLine("\t[-] " + dir + " Folder is NOT accessible by current user");
  183. }
  184. }
  185. }
  186. public static void PowershellInfo()
  187. {
  188. //CHECK FOR REGISTRY x64/x32 检查注册表
  189. var registryKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64);
  190. RegistryKey key = registryKey.OpenSubKey("Software");
  191. if (key == null)
  192. {
  193. registryKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32);
  194. }
  195. //POWERSHELL VERSIONS powershell版本
  196. Console.WriteLine("\n[+] PowerShell Versions Installed");
  197. string[] directories = Directory.GetDirectories(@"C:\windows\System32\WindowsPowershell");
  198. for (int i = 0; i < directories.Length; i++)
  199. {
  200. Console.WriteLine("\t" + directories[i]);
  201. }
  202. //POWERSHELL HISTORY FILE powershell 历史记录
  203. Console.WriteLine("\n[+] Checking for PowerShell History File...");
  204. string userPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
  205. string psHistoryPath = @"Microsoft\Windows\PowerShell\PSReadline\ConsoleHost_history.txt";
  206. string psHistory = Path.Combine(userPath, psHistoryPath);
  207. if (File.Exists(psHistory))
  208. {
  209. Console.WriteLine("\tHistory File in: " + psHistory);
  210. }
  211. else Console.WriteLine("\t[-] PowerShell History file does not exist");
  212. //POWERSHELL SCRIPT LOGGING ENUMERATION powershell脚本日志记录枚举
  213. Console.WriteLine("\n[+] Enumerating PowerShell Environment Config...");
  214. RegistryKey scriptLog_config = registryKey.OpenSubKey(@"Software\Policies\Microsoft\Windows\Powershell\ScriptBlockLogging");
  215. if (scriptLog_config != null)
  216. {
  217. var scLog = scriptLog_config.GetValue("EnableScriptBlockLogging");
  218. if (scLog.ToString().Equals("1"))
  219. {
  220. Console.WriteLine("\t[!] ScriptBlock Logging is enabled");
  221. }
  222. else Console.WriteLine("\t[-] ScriptBlock Logging is Not enabled");
  223. }
  224. //POWERSHELL TRANSCRIPTION LOGGING powershell转录日志记录
  225. RegistryKey transcriptLog_config = registryKey.OpenSubKey(@"Software\Policies\Microsoft\Windows\PowerShell\Transcription");
  226. if (transcriptLog_config != null)
  227. {
  228. var tsLog = transcriptLog_config.GetValue("EnableTranscripting");
  229. if (tsLog.ToString().Equals("1"))
  230. {
  231. Console.WriteLine("\t[!] Transcript Logging is enabled");
  232. }
  233. else Console.WriteLine("\t[-] Transcript Logging is Not enabled");
  234. }
  235. //POWERSHELL CONSTRAINED MODES ENUMERATION powershell约束模式枚举
  236. //1. Full Language
  237. //2. Restricted Language
  238. //3. No Language
  239. //4. Constrained Language
  240. Console.WriteLine("\n[+] Enumerating PowerShell Constrained Config...");
  241. RegistryKey constrainLog_config = registryKey.OpenSubKey(@"System\CurrentControlSet\Control\Session Manager\Environment");
  242. if (constrainLog_config != null)
  243. {
  244. if (constrainLog_config.GetValue("_PSLockdownPolicy") != null)
  245. {
  246. var psPolicy = constrainLog_config.GetValue("_PSLockdownPolicy");
  247. if (psPolicy.Equals("1"))
  248. {
  249. Console.WriteLine("\tFull Language Mode");
  250. }
  251. else if (psPolicy.Equals("2"))
  252. {
  253. Console.WriteLine("\tFull Language Mode");
  254. }
  255. else if (psPolicy.Equals("3"))
  256. {
  257. Console.WriteLine("\tNo Language Mode");
  258. }
  259. else if (psPolicy.Equals("4"))
  260. {
  261. Console.WriteLine("[!] Constrained Language Mode");
  262. }
  263. }
  264. else Console.WriteLine("\t[-] PSLockdownPolicy in not enabled");
  265. }
  266. }
  267. public static void Csharp_Version()
  268. {
  269. Console.WriteLine("\n[+] Microsoft.NET Versions Installed");
  270. string[] Netdirectories = Directory.GetDirectories(@"C:\Windows\Microsoft.NET\Framework");
  271. for (int i = 0; i < Netdirectories.Length; i++)
  272. {
  273. Console.WriteLine("\t" + Netdirectories[i]);
  274. }
  275. }
  276. public static void AvProcessEDRproduct()
  277. {
  278. //ANTIVURUS PROCESSES
  279. string[] avproducts = { "Tanium.exe", "360RP.exe", "360SD.exe", "360Safe.exe", "360leakfixer.exe", "360rp.exe", "360safe.exe", "360sd.exe", "360tray.exe", "AAWTray.exe", "ACAAS.exe", "ACAEGMgr.exe", "ACAIS.exe", "AClntUsr.EXE", "ALERT.EXE", "ALERTSVC.EXE", "ALMon.exe", "ALUNotify.exe", "ALUpdate.exe", "ALsvc.exe", "AVENGINE.exe", "AVGCHSVX.EXE", "AVGCSRVX.EXE", "AVGIDSAgent.exe", "AVGIDSMonitor.exe", "AVGIDSUI.exe", "AVGIDSWatcher.exe", "AVGNSX.EXE", "AVKProxy.exe", "AVKService.exe", "AVKTray.exe", "AVKWCtl.exe", "AVP.EXE", "AVP.exe", "AVPDTAgt.exe", "AcctMgr.exe", "Ad-Aware.exe", "Ad-Aware2007.exe", "AddressExport.exe", "AdminServer.exe", "Administrator.exe", "AeXAgentUIHost.exe", "AeXNSAgent.exe", "AeXNSRcvSvc.exe", "AlertSvc.exe", "AlogServ.exe", "AluSchedulerSvc.exe", "AnVir.exe", "AppSvc32.exe", "AtrsHost.exe", "Auth8021x.exe", "AvastSvc.exe", "AvastUI.exe", "Avconsol.exe", "AvpM.exe", "Avsynmgr.exe", "Avtask.exe", "BLACKD.exe", "BWMeterConSvc.exe", "CAAntiSpyware.exe", "CALogDump.exe", "CAPPActiveProtection.exe", "CAPPActiveProtection.exe", "CB.exe", "CCAP.EXE", "CCenter.exe", "CClaw.exe", "CLPS.exe", "CLPSLA.exe", "CLPSLS.exe", "CNTAoSMgr.exe", "CPntSrv.exe", "CTDataLoad.exe", "CertificationManagerServiceNT.exe", "ClShield.exe", "ClamTray.exe", "ClamWin.exe", "Console.exe", "CylanceUI.exe", "DAO_Log.exe", "DLService.exe", "DLTray.EXE", "DLTray.exe", "DRWAGNTD.EXE", "DRWAGNUI.EXE", "DRWEB32W.EXE", "DRWEBSCD.EXE", "DRWEBUPW.EXE", "DRWINST.EXE", "DSMain.exe", "DWHWizrd.exe", "DefWatch.exe", "DolphinCharge.exe", "EHttpSrv.exe", "EMET_Agent.exe", "EMET_Service.exe", "EMLPROUI.exe", "EMLPROXY.exe", "EMLibUpdateAgentNT.exe", "ETConsole3.exe", "ETCorrel.exe", "ETLogAnalyzer.exe", "ETReporter.exe", "ETRssFeeds.exe", "EUQMonitor.exe", "EndPointSecurity.exe", "EngineServer.exe", "EntityMain.exe", "EtScheduler.exe", "EtwControlPanel.exe", "EventParser.exe", "FAMEH32.exe", "FCDBLog.exe", "FCH32.exe", "FPAVServer.exe", "FProtTray.exe", "FSCUIF.exe", "FSHDLL32.exe", "FSM32.exe", "FSMA32.exe", "FSMB32.exe", "FWCfg.exe", "FireSvc.exe", "FireTray.exe", "FirewallGUI.exe", "ForceField.exe", "FortiProxy.exe", "FortiTray.exe", "FortiWF.exe", "FrameworkService.exe", "FreeProxy.exe", "GDFirewallTray.exe", "GDFwSvc.exe", "HWAPI.exe", "ISNTSysMonitor.exe", "ISSVC.exe", "ISWMGR.exe", "ITMRTSVC.exe", "ITMRT_SupportDiagnostics.exe", "ITMRT_TRACE.exe", "IcePack.exe", "IdsInst.exe", "InoNmSrv.exe", "InoRT.exe", "InoRpc.exe", "InoTask.exe", "InoWeb.exe", "IsntSmtp.exe", "KABackReport.exe", "KANMCMain.exe", "KAVFS.EXE", "KAVStart.exe", "KLNAGENT.EXE", "KMailMon.exe", "KNUpdateMain.exe", "KPFWSvc.exe", "KSWebShield.exe", "KVMonXP.exe", "KVMonXP_2.exe", "KVSrvXP.exe", "KWSProd.exe", "KWatch.exe", "KavAdapterExe.exe", "KeyPass.exe", "KvXP.exe", "LUALL.EXE", "LWDMServer.exe", "LockApp.exe", "LockAppHost.exe", "LogGetor.exe", "MCSHIELD.EXE", "MCUI32.exe", "MSASCui.exe", "ManagementAgentNT.exe", "McAfeeDataBackup.exe", "McEPOC.exe", "McEPOCfg.exe", "McNASvc.exe", "McProxy.exe", "McScript_InUse.exe", "McWCE.exe", "McWCECfg.exe", "Mcshield.exe", "Mctray.exe", "MgntSvc.exe", "MpCmdRun.exe", "MpfAgent.exe", "MpfSrv.exe", "MsMpEng.exe", "NAIlgpip.exe", "NAVAPSVC.EXE", "NAVAPW32.EXE", "NCDaemon.exe", "NIP.exe", "NJeeves.exe", "NLClient.exe", "NMAGENT.EXE", "NOD32view.exe", "NPFMSG.exe", "NPROTECT.EXE", "NRMENCTB.exe", "NSMdtr.exe", "NTRtScan.exe", "NVCOAS.exe", "NVCSched.exe", "NavShcom.exe", "Navapsvc.exe", "NaveCtrl.exe", "NaveLog.exe", "NaveSP.exe", "Navw32.exe", "Navwnt.exe", "Nip.exe", "Njeeves.exe", "Npfmsg2.exe", "Npfsvice.exe", "NscTop.exe", "Nvcoas.exe", "Nvcsched.exe", "Nymse.exe", "OLFSNT40.EXE", "OMSLogManager.exe", "ONLINENT.exe", "ONLNSVC.exe", "OfcPfwSvc.exe", "PASystemTray.exe", "PAVFNSVR.exe", "PAVSRV51.exe", "PNmSrv.exe", "POPROXY.EXE", "POProxy.exe", "PPClean.exe", "PPCtlPriv.exe", "PQIBrowser.exe", "PSHost.exe", "PSIMSVC.EXE", "PXEMTFTP.exe", "PadFSvr.exe", "Pagent.exe", "Pagentwd.exe", "PavBckPT.exe", "PavFnSvr.exe", "PavPrSrv.exe", "PavProt.exe", "PavReport.exe", "Pavkre.exe", "PcCtlCom.exe", "PcScnSrv.exe", "PccNTMon.exe", "PccNTUpd.exe", "PpPpWallRun.exe", "PrintDevice.exe", "ProUtil.exe", "PsCtrlS.exe", "PsImSvc.exe", "PwdFiltHelp.exe", "Qoeloader.exe", "RAVMOND.exe", "RAVXP.exe", "RNReport.exe", "RPCServ.exe", "RSSensor.exe", "RTVscan.exe", "RapApp.exe", "Rav.exe", "RavAlert.exe", "RavMon.exe", "RavMonD.exe", "RavService.exe", "RavStub.exe", "RavTask.exe", "RavTray.exe", "RavUpdate.exe", "RavXP.exe", "RealMon.exe", "Realmon.exe", "RedirSvc.exe", "RegMech.exe", "ReporterSvc.exe", "RouterNT.exe", "Rtvscan.exe", "SAFeService.exe", "SAService.exe", "SAVAdminService.exe", "SAVFMSESp.exe", "SAVMain.exe", "SAVScan.exe", "SCANMSG.exe", "SCANWSCS.exe", "SCFManager.exe", "SCFService.exe", "SCFTray.exe", "SDTrayApp.exe", "SEVINST.EXE", "SMEX_ActiveUpdate.exe", "SMEX_Master.exe", "SMEX_RemoteConf.exe", "SMEX_SystemWatch.exe", "SMSECtrl.exe", "SMSELog.exe", "SMSESJM.exe", "SMSESp.exe", "SMSESrv.exe", "SMSETask.exe", "SMSEUI.exe", "SNAC.EXE", "SNAC.exe", "SNDMon.exe", "SNDSrvc.exe", "SPBBCSvc.exe", "SPIDERML.EXE", "SPIDERNT.EXE", "SSM.exe", "SSScheduler.exe", "SVCharge.exe", "SVDealer.exe", "SVFrame.exe", "SVTray.exe", "SWNETSUP.EXE", "SavRoam.exe", "SavService.exe", "SavUI.exe", "ScanMailOutLook.exe", "SeAnalyzerTool.exe", "SemSvc.exe", "SescLU.exe", "SetupGUIMngr.exe", "SiteAdv.exe", "Smc.exe", "SmcGui.exe", "SnHwSrv.exe", "SnICheckAdm.exe", "SnIcon.exe", "SnSrv.exe", "SnicheckSrv.exe", "SpIDerAgent.exe", "SpntSvc.exe", "SpyEmergency.exe", "SpyEmergencySrv.exe", "StOPP.exe", "StWatchDog.exe", "SymCorpUI.exe", "SymSPort.exe", "TBMon.exe", "TFGui.exe", "TFService.exe", "TFTray.exe", "TFun.exe", "TIASPN~1.EXE", "TSAnSrf.exe", "TSAtiSy.exe", "TScutyNT.exe", "TSmpNT.exe", "TmListen.exe", "TmPfw.exe", "Tmntsrv.exe", "Traflnsp.exe", "TrapTrackerMgr.exe", "UPSCHD.exe", "UcService.exe", "UdaterUI.exe", "UmxAgent.exe", "UmxCfg.exe", "UmxFwHlp.exe", "UmxPol.exe", "Up2date.exe", "UpdaterUI.exe", "UrlLstCk.exe", "UserActivity.exe", "UserAnalysis.exe", "UsrPrmpt.exe", "V3Medic.exe", "V3Svc.exe", "VPC32.exe", "VPDN_LU.exe", "VPTray.exe", "VSStat.exe", "VsStat.exe", "VsTskMgr.exe", "WEBPROXY.EXE", "WFXCTL32.EXE", "WFXMOD32.EXE", "WFXSNT40.EXE", "WebProxy.exe", "WebScanX.exe", "WinRoute.exe", "WrSpySetup.exe", "ZLH.exe", "Zanda.exe", "ZhuDongFangYu.exe", "Zlh.exe", "_avp32.exe", "_avpcc.exe", "_avpm.exe", "aAvgApi.exe", "aawservice.exe", "acaif.exe", "acctmgr.exe", "ackwin32.exe", "aclient.exe", "adaware.exe", "advxdwin.exe", "aexnsagent.exe", "aexsvc.exe", "aexswdusr.exe", "aflogvw.exe", "afwServ.exe", "agentsvr.exe", "agentw.exe", "ahnrpt.exe", "ahnsd.exe", "ahnsdsv.exe", "alertsvc.exe", "alevir.exe", "alogserv.exe", "alsvc.exe", "alunotify.exe", "aluschedulersvc.exe", "amon9x.exe", "amswmagt.exe", "anti-trojan.exe", "antiarp.exe", "antivirus.exe", "ants.exe", "aphost.exe", "apimonitor.exe", "aplica32.exe", "aps.exe", "apvxdwin.exe", "arr.exe", "ashAvast.exe", "ashBug.exe", "ashChest.exe", "ashCmd.exe", "ashDisp.exe", "ashEnhcd.exe", "ashLogV.exe", "ashMaiSv.exe", "ashPopWz.exe", "ashQuick.exe", "ashServ.exe", "ashSimp2.exe", "ashSimpl.exe", "ashSkPcc.exe", "ashSkPck.exe", "ashUpd.exe", "ashWebSv.exe", "ashdisp.exe", "ashmaisv.exe", "ashserv.exe", "ashwebsv.exe", "asupport.exe", "aswDisp.exe", "aswRegSvr.exe", "aswServ.exe", "aswUpdSv.exe", "aswUpdsv.exe", "aswWebSv.exe", "aswupdsv.exe", "atcon.exe", "atguard.exe", "atro55en.exe", "atupdater.exe", "atwatch.exe", "atwsctsk.exe", "au.exe", "aupdate.exe", "aupdrun.exe", "aus.exe", "auto-protect.nav80try.exe", "autodown.exe", "autotrace.exe", "autoup.exe", "autoupdate.exe", "avEngine.exe", "avadmin.exe", "avcenter.exe", "avconfig.exe", "avconsol.exe", "ave32.exe", "avengine.exe", "avesvc.exe", "avfwsvc.exe", "avgam.exe", "avgamsvr.exe", "avgas.exe", "avgcc.exe", "avgcc32.exe", "avgcsrvx.exe", "avgctrl.exe", "avgdiag.exe", "avgemc.exe", "avgfws8.exe", "avgfws9.exe", "avgfwsrv.exe", "avginet.exe", "avgmsvr.exe", "avgnsx.exe", "avgnt.exe", "avgregcl.exe", "avgrssvc.exe", "avgrsx.exe", "avgscanx.exe", "avgserv.exe", "avgserv9.exe", "avgsystx.exe", "avgtray.exe", "avguard.exe", "avgui.exe", "avgupd.exe", "avgupdln.exe", "avgupsvc.exe", "avgvv.exe", "avgw.exe", "avgwb.exe", "avgwdsvc.exe", "avgwizfw.exe", "avkpop.exe", "avkserv.exe", "avkservice.exe", "avkwctl9.exe", "avltmain.exe", "avmailc.exe", "avmcdlg.exe", "avnotify.exe", "avnt.exe", "avp.exe", "avp32.exe", "avpcc.exe", "avpdos32.exe", "avpexec.exe", "avpm.exe", "avpncc.exe", "avps.exe", "avptc32.exe", "avpupd.exe", "avscan.exe", "avsched32.exe", "avserver.exe", "avshadow.exe", "avsynmgr.exe", "avwebgrd.exe", "avwin.exe", "avwin95.exe", "avwinnt.exe", "avwupd.exe", "avwupd32.exe", "avwupsrv.exe", "avxmonitor9x.exe", "avxmonitornt.exe", "avxquar.exe", "backweb.exe", "bargains.exe", "basfipm.exe", "bd_professional.exe", "bdagent.exe", "bdc.exe", "bdlite.exe", "bdmcon.exe", "bdss.exe", "bdsubmit.exe", "beagle.exe", "belt.exe", "bidef.exe", "bidserver.exe", "bipcp.exe", "bipcpevalsetup.exe", "bisp.exe", "blackd.exe", "blackice.exe", "blink.exe", "blss.exe", "bmrt.exe", "bootconf.exe", "bootwarn.exe", "borg2.exe", "bpc.exe", "bpk.exe", "brasil.exe", "bs120.exe", "bundle.exe", "bvt.exe", "bwgo0000.exe", "ca.exe", "caav.exe", "caavcmdscan.exe", "caavguiscan.exe", "caf.exe", "cafw.exe", "caissdt.exe", "capfaem.exe", "capfasem.exe", "capfsem.exe", "capmuamagt.exe", "casc.exe", "casecuritycenter.exe", "caunst.exe", "cavrep.exe", "cavrid.exe", "cavscan.exe", "cavtray.exe", "ccApp.exe", "ccEvtMgr.exe", "ccLgView.exe", "ccProxy.exe", "ccSetMgr.exe", "ccSetmgr.exe", "ccSvcHst.exe", "ccap.exe", "ccapp.exe", "ccevtmgr.exe", "cclaw.exe", "ccnfagent.exe", "ccprovsp.exe", "ccproxy.exe", "ccpxysvc.exe", "ccschedulersvc.exe", "ccsetmgr.exe", "ccsmagtd.exe", "ccsvchst.exe", "ccsystemreport.exe", "cctray.exe", "ccupdate.exe", "cdp.exe", "cfd.exe", "cfftplugin.exe", "cfgwiz.exe", "cfiadmin.exe", "cfiaudit.exe", "cfinet.exe", "cfinet32.exe", "cfnotsrvd.exe", "cfp.exe", "cfpconfg.exe", "cfpconfig.exe", "cfplogvw.exe", "cfpsbmit.exe", "cfpupdat.exe", "cfsmsmd.exe", "checkup.exe", "cka.exe", "clamscan.exe", "claw95.exe", "claw95cf.exe", "clean.exe", "cleaner.exe", "cleaner3.exe", "cleanpc.exe", "cleanup.exe", "click.exe", "cmdagent.exe", "cmdinstall.exe", "cmesys.exe", "cmgrdian.exe", "cmon016.exe", "comHost.exe", "connectionmonitor.exe", "control_panel.exe", "cpd.exe", "cpdclnt.exe", "cpf.exe", "cpf9x206.exe", "cpfnt206.exe", "crashrep.exe", "csacontrol.exe", "csinject.exe", "csinsm32.exe", "csinsmnt.exe", "csrss_tc.exe", "ctrl.exe", "cv.exe", "cwnb181.exe", "cwntdwmo.exe", "cz.exe", "datemanager.exe", "dbserv.exe", "dbsrv9.exe", "dcomx.exe", "defalert.exe", "defscangui.exe", "defwatch.exe", "deloeminfs.exe", "deputy.exe", "diskmon.exe", "divx.exe", "djsnetcn.exe", "dllcache.exe", "dllreg.exe", "doors.exe", "doscan.exe", "dpf.exe", "dpfsetup.exe", "dpps2.exe", "drwagntd.exe", "drwatson.exe", "drweb.exe", "drweb32.exe", "drweb32w.exe", "drweb386.exe", "drwebcgp.exe", "drwebcom.exe", "drwebdc.exe", "drwebmng.exe", "drwebscd.exe", "drwebupw.exe", "drwebwcl.exe", "drwebwin.exe", "drwupgrade.exe", "dsmain.exe", "dssagent.exe", "dvp95.exe", "dvp95_0.exe", "dwengine.exe", "dwhwizrd.exe", "dwwin.exe", "ecengine.exe", "edisk.exe", "efpeadm.exe", "egui.exe", "ekrn.exe", "elogsvc.exe", "emet_agent.exe", "emet_service.exe", "emsw.exe", "engineserver.exe", "ent.exe", "era.exe", "esafe.exe", "escanhnt.exe", "escanv95.exe", "esecagntservice.exe", "esecservice.exe", "esmagent.exe", "espwatch.exe", "etagent.exe", "ethereal.exe", "etrustcipe.exe", "evpn.exe", "evtProcessEcFile.exe", "evtarmgr.exe", "evtmgr.exe", "exantivirus-cnet.exe", "exe.avxw.exe", "execstat.exe", "expert.exe", "explore.exe", "f-agnt95.exe", "f-prot.exe", "f-prot95.exe", "f-stopw.exe", "fameh32.exe", "fast.exe", "fch32.exe", "fih32.exe", "findviru.exe", "firesvc.exe", "firetray.exe", "firewall.exe", "fmon.exe", "fnrb32.exe", "fortifw.exe", "fp-win.exe", "fp-win_trial.exe", "fprot.exe", "frameworkservice.exe", "frminst.exe", "frw.exe", "fsaa.exe", "fsaua.exe", "fsav.exe", "fsav32.exe", "fsav530stbyb.exe", "fsav530wtbyb.exe", "fsav95.exe", "fsavgui.exe", "fscuif.exe", "fsdfwd.exe", "fsgk32.exe", "fsgk32st.exe", "fsguidll.exe", "fsguiexe.exe", "fshdll32.exe", "fsm32.exe", "fsma32.exe", "fsmb32.exe", "fsorsp.exe", "fspc.exe", "fspex.exe", "fsqh.exe", "fssm32.exe", "fwinst.exe", "gator.exe", "gbmenu.exe", "gbpoll.exe", "gcascleaner.exe", "gcasdtserv.exe", "gcasinstallhelper.exe", "gcasnotice.exe", "gcasserv.exe", "gcasservalert.exe", "gcasswupdater.exe", "generics.exe", "gfireporterservice.exe", "ghost_2.exe", "ghosttray.exe", "giantantispywaremain.exe", "giantantispywareupdater.exe", "gmt.exe", "guard.exe", "guarddog.exe", "guardgui.exe", "hacktracersetup.exe", "hbinst.exe", "hbsrv.exe", "hipsvc.exe", "hotactio.exe", "hotpatch.exe", "htlog.exe", "htpatch.exe", "hwpe.exe", "hxdl.exe", "hxiul.exe", "iamapp.exe", "iamserv.exe", "iamstats.exe", "ibmasn.exe", "ibmavsp.exe", "icepack.exe", "icload95.exe", "icloadnt.exe", "icmon.exe", "icsupp95.exe", "icsuppnt.exe", "idle.exe", "iedll.exe", "iedriver.exe", "iface.exe", "ifw2000.exe", "igateway.exe", "inetlnfo.exe", "infus.exe", "infwin.exe", "inicio.exe", "init.exe", "inonmsrv.exe", "inorpc.exe", "inort.exe", "inotask.exe", "intdel.exe", "intren.exe", "iomon98.exe", "isPwdSvc.exe", "isUAC.exe", "isafe.exe", "isafinst.exe", "issvc.exe", "istsvc.exe", "jammer.exe", "jdbgmrg.exe", "jedi.exe", "kaccore.exe", "kansgui.exe", "kansvr.exe", "kastray.exe", "kav.exe", "kav32.exe", "kavfs.exe", "kavfsgt.exe", "kavfsrcn.exe", "kavfsscs.exe", "kavfswp.exe", "kavisarv.exe", "kavlite40eng.exe", "kavlotsingleton.exe", "kavmm.exe", "kavpers40eng.exe", "kavpf.exe", "kavshell.exe", "kavss.exe", "kavstart.exe", "kavsvc.exe", "kavtray.exe", "kazza.exe", "keenvalue.exe", "kerio-pf-213-en-win.exe", "kerio-wrl-421-en-win.exe", "kerio-wrp-421-en-win.exe", "kernel32.exe", "killprocesssetup161.exe", "kis.exe", "kislive.exe", "kissvc.exe", "klnacserver.exe", "klnagent.exe", "klserver.exe", "klswd.exe", "klwtblfs.exe", "kmailmon.exe", "knownsvr.exe", "kpf4gui.exe", "kpf4ss.exe", "kpfw32.exe", "kpfwsvc.exe", "krbcc32s.exe", "kvdetech.exe", "kvolself.exe", "kvsrvxp.exe", "kvsrvxp_1.exe", "kwatch.exe", "kwsprod.exe", "kxeserv.exe", "launcher.exe", "ldnetmon.exe", "ldpro.exe", "ldpromenu.exe", "ldscan.exe", "leventmgr.exe", "livesrv.exe", "lmon.exe", "lnetinfo.exe", "loader.exe", "localnet.exe", "lockdown.exe", "lockdown2000.exe", "log_qtine.exe", "lookout.exe", "lordpe.exe", "lsetup.exe", "luall.exe", "luau.exe", "lucallbackproxy.exe", "lucoms.exe", "lucomserver.exe", "lucoms~1.exe", "luinit.exe", "luspt.exe", "makereport.exe", "mantispm.exe", "mapisvc32.exe", "masalert.exe", "massrv.exe", "mcafeefire.exe", "mcagent.exe", "mcappins.exe", "mcconsol.exe", "mcdash.exe", "mcdetect.exe", "mcepoc.exe", "mcepocfg.exe", "mcinfo.exe", "mcmnhdlr.exe", "mcmscsvc.exe", "mcods.exe", "mcpalmcfg.exe", "mcpromgr.exe", "mcregwiz.exe", "mcscript.exe", "mcscript_inuse.exe", "mcshell.exe", "mcshield.exe", "mcshld9x.exe", "mcsysmon.exe", "mctool.exe", "mctray.exe", "mctskshd.exe", "mcuimgr.exe", "mcupdate.exe", "mcupdmgr.exe", "mcvsftsn.exe", "mcvsrte.exe", "mcvsshld.exe", "mcwce.exe", "mcwcecfg.exe", "md.exe", "mfeann.exe", "mfevtps.exe", "mfin32.exe", "mfw2en.exe", "mfweng3.02d30.exe", "mgavrtcl.exe", "mgavrte.exe", "mghtml.exe", "mgui.exe", "minilog.exe", "mmod.exe", "monitor.exe", "monsvcnt.exe", "monsysnt.exe", "moolive.exe", "mostat.exe", "mpcmdrun.exe", "mpf.exe", "mpfagent.exe", "mpfconsole.exe", "mpfservice.exe", "mpftray.exe", "mps.exe", "mpsevh.exe", "mpsvc.exe", "mrf.exe", "mrflux.exe", "msapp.exe", "msascui.exe", "msbb.exe", "msblast.exe", "mscache.exe", "msccn32.exe", "mscifapp.exe", "mscman.exe", "msconfig.exe", "msdm.exe", "msdos.exe", "msiexec16.exe", "mskagent.exe", "mskdetct.exe", "msksrver.exe", "msksrvr.exe", "mslaugh.exe", "msmgt.exe", "msmpeng.exe", "msmsgri32.exe", "msscli.exe", "msseces.exe", "mssmmc32.exe", "msssrv.exe", "mssys.exe", "msvxd.exe", "mu0311ad.exe", "mwatch.exe", "myagttry.exe", "n32scanw.exe", "nSMDemf.exe", "nSMDmon.exe", "nSMDreal.exe", "nSMDsch.exe", "naPrdMgr.exe", "nav.exe", "navap.navapsvc.exe", "navapsvc.exe", "navapw32.exe", "navdx.exe", "navlu32.exe", "navnt.exe", "navstub.exe", "navw32.exe", "navwnt.exe", "nc2000.exe", "ncinst4.exe" };
  280. Process[] procs = Process.GetProcesses(Environment.MachineName);
  281. Console.WriteLine("\n[+] Checking for Antivirus Processes on " + Environment.MachineName + "...");
  282. Console.WriteLine("[*] Loaded " + avproducts.Length + " AV Process Names");
  283. for (int i = 0; i < procs.Length; i++)
  284. {
  285. for (int a = 0; a < avproducts.Length; a++)
  286. {
  287. string processSearch = avproducts[a].Substring(0, avproducts[a].Length - 4);
  288. if (procs[i].ProcessName.Equals(processSearch))
  289. {
  290. Console.WriteLine("\t[!] Found AV Process: " + procs[i].ProcessName);
  291. }
  292. }
  293. }
  294. //EDR PRODUCTS
  295. string[] edrproducts = { "cbstream.sys", "cbk7.sys", "Parity.sys", "libwamf.sys", "LRAgentMF.sys", "BrCow_x_x_x_x.sys", "brfilter.sys", "BDSandBox.sys", "AVC3.SYS", "TRUFOS.SYS", "Atc.sys", "AVCKF.SYS", "bddevflt.sys", "gzflt.sys", "bdsvm.sys", "hbflt.sys", "cve.sys", "psepfilter.sys", "cposfw.sys", "dsfa.sys", "medlpflt.sys", "epregflt.sys", "TmFileEncDmk.sys", "tmevtmgr.sys", "TmEsFlt.sys", "fileflt.sys", "SakMFile.sys", "SakFile.sys", "AcDriver.sys", "TMUMH.sys", "hfileflt.sys", "TMUMS.sys", "MfeEEFF.sys", "mfprom.sys", "hdlpflt.sys", "swin.sys", "mfehidk.sys", "mfencoas.sys", "epdrv.sys", "carbonblackk.sys", "csacentr.sys", "csaenh.sys", "csareg.sys", "csascr.sys", "csaav.sys", "csaam.sys", "esensor.sys", "fsgk.sys", "fsatp.sys", "fshs.sys", "eaw.sys", "im.sys", "csagent.sys", "rvsavd.sys", "dgdmk.sys", "atrsdfw.sys", "mbamwatchdog.sys", "edevmon.sys", "SentinelMonitor.sys", "edrsensor.sys", "ehdrv.sys", "HexisFSMonitor.sys", "CyOptics.sys", "CarbonBlackK.sys", "CyProtectDrv32.sys", "CyProtectDrv64.sys", "CRExecPrev.sys", "ssfmonm.sys", "CybKernelTracker.sys", "SAVOnAccess.sys", "savonaccess.sys", "sld.sys", "aswSP.sys", "FeKern.sys", "klifks.sys", "klifaa.sys", "Klifsm.sys", "mfeaskm.sys", "mfencfilter.sys", "WFP_MRT.sys", "groundling32.sys", "SAFE-Agent.sys", "groundling64.sys", "avgtpx86.sys", "avgtpx64.sys", "pgpwdefs.sys", "GEProtection.sys", "diflt.sys", "sysMon.sys", "ssrfsf.sys", "emxdrv2.sys", "reghook.sys", "spbbcdrv.sys", "bhdrvx86.sys", "bhdrvx64.sys", "SISIPSFileFilter.sys", "symevent.sys", "VirtualAgent.sys", "vxfsrep.sys", "VirtFile.sys", "SymAFR.sys", "symefasi.sys", "symefa.sys", "symefa64.sys", "SymHsm.sys", "evmf.sys", "GEFCMP.sys", "VFSEnc.sys", "pgpfs.sys", "fencry.sys", "symrg.sys", "cfrmd.sys", "cmdccav.sys", "cmdguard.sys", "CmdMnEfs.sys", "MyDLPMF.sys", "PSINPROC.SYS", "PSINFILE.SYS", "amfsm.sys", "amm8660.sys", "amm6460.sys" };
  296. Console.WriteLine("\n[+] Enumerating EDR products on " + Environment.MachineName + "...");
  297. Console.WriteLine("[*] Loaded " + edrproducts.Length + " EDR Product Names");
  298. string edrPath = @"C:\Windows\System32\drivers\";
  299. for (int e = 0; e < edrproducts.Length; e++)
  300. {
  301. if (File.Exists(edrPath + edrproducts[e]))
  302. {
  303. Console.WriteLine("\t[!] EDR driver found " + edrproducts[e]);
  304. }
  305. }
  306. }
  307. public static void Defender()
  308. {
  309. //WINDOWS DEFENDER CONFIGURATION AND EXCEPTIONS 配置
  310. Console.WriteLine("\n[+] Enumerating Windows Defender Config...");
  311. RegistryKey folder_exclusions = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows Defender\Exclusions\Paths");
  312. Console.WriteLine("\tEnumerating Windows Defender Path Exclusions...");
  313. if (folder_exclusions != null)
  314. {
  315. for (int i = 0; i < folder_exclusions.GetValueNames().Length; i++)
  316. {
  317. Console.WriteLine("\t[+] " + folder_exclusions.GetValueNames()[i]);
  318. }
  319. Console.WriteLine();
  320. }
  321. //WINDOWS DEFENDER EXCLUSIONS WINDOWS DEFENDER 排除项
  322. Console.WriteLine("\tEnumerating Windows Defender Extensions Exclusions...");
  323. RegistryKey ext_exclusions = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows Defender\Exclusions\Extensions");
  324. if (ext_exclusions == null)
  325. {
  326. Console.WriteLine("\tNo extensions exclusions specified");
  327. }
  328. else
  329. {
  330. if (ext_exclusions.GetValueNames().Length > 0)
  331. {
  332. for (int i = 0; i < ext_exclusions.GetValueNames().Length; i++)
  333. {
  334. Console.WriteLine("\t[+]" + ext_exclusions.GetValueNames()[i]);
  335. }
  336. }
  337. else
  338. {
  339. Console.WriteLine("\t[-] No extensions exclusions specified.");
  340. }
  341. }
  342. }
  343. public static void Recent_files()
  344. {
  345. //WINDOWS RECENT FILES Windows最近使用的文件
  346. string recents = @"Microsoft\Windows\Recent";
  347. string userPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
  348. string recentsPath = Path.Combine(userPath, recents);
  349. DirectoryInfo di = new DirectoryInfo(recentsPath);
  350. Console.WriteLine("\n[+] Recent Items in " + recentsPath);
  351. foreach (var file in di.GetFiles())
  352. {
  353. Console.WriteLine("\t" + file.Name);
  354. }
  355. }
  356. public static void Network_Connentions()
  357. {
  358. //NETWORK CONNECTIONS 网络连接
  359. Console.WriteLine("\n[+] Enumerating Network Connections...");
  360. IPGlobalProperties ipProperties = IPGlobalProperties.GetIPGlobalProperties();
  361. IPEndPoint[] endPoints = ipProperties.GetActiveTcpListeners();
  362. TcpConnectionInformation[] tcpConnections = ipProperties.GetActiveTcpConnections();
  363. foreach (TcpConnectionInformation info in tcpConnections)
  364. {
  365. Console.WriteLine("\tLocal : " + info.LocalEndPoint.Address.ToString() + ":" + info.LocalEndPoint.Port.ToString() + " - Remote : " + info.RemoteEndPoint.Address.ToString() + ":" + info.RemoteEndPoint.Port.ToString());
  366. }
  367. }
  368. public static void Applocker_Enumerating()
  369. {
  370. //CHECK FOR REGISTRY x64/x32 检查注册表
  371. var registryKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64);
  372. RegistryKey key = registryKey.OpenSubKey("Software");
  373. if (key == null)
  374. {
  375. registryKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32);
  376. }
  377. //APPLOCKER ENUMERATION applocker枚举
  378. Console.WriteLine("\n[+] Enumerating Applocker Config...");
  379. RegistryKey appLocker_config = registryKey.OpenSubKey(@"Software\Policies\Microsoft\Windows\SrpV2\Exe");
  380. if (appLocker_config != null)
  381. {
  382. for (int i = 0; i < appLocker_config.SubKeyCount; i++)
  383. {
  384. Console.WriteLine(appLocker_config.OpenSubKey(appLocker_config.GetSubKeyNames()[i]).GetValue("Value"));
  385. }
  386. }
  387. }
  388. public static void Drives()
  389. {
  390. //ATTACHED DRIVES 磁盘情况
  391. Console.WriteLine("\n[+] Enumerating Drives...");
  392. DriveInfo[] drives = DriveInfo.GetDrives();
  393. foreach (DriveInfo d in drives)
  394. {
  395. if (d.IsReady == true)
  396. {
  397. Console.WriteLine("\tDrive " + d.Name + " " + d.DriveType + " - Size:" + d.TotalSize + " bytes");
  398. }
  399. }
  400. }
  401. public static void LAPS()
  402. {
  403. //LAPS
  404. Console.WriteLine("\n[+] Checking if LAPS is used...");
  405. string laps_path = @"C:\Program Files\LAPS\CSE\Admpwd.dll";
  406. Console.WriteLine(File.Exists(laps_path) ? "\t[!] LAPS is enabled" : "\t[-] LAPS is not enabled");
  407. }
  408. public static Shell32.Folder GetShell32Folder(object folder, Object shell, Type shellAppType)
  409. {
  410. return (Shell32.Folder)shellAppType.InvokeMember("NameSpace",
  411. System.Reflection.BindingFlags.InvokeMethod, null, shell, new object[] { folder });
  412. }
  413. public static void GetRecycleBinFilenames()
  414. {
  415. Console.WriteLine("\n[+] Get RecycleBin Filenames");
  416. Type shellAppType = Type.GetTypeFromProgID("Shell.Application");
  417. Object shell = Activator.CreateInstance(shellAppType);
  418. Folder recycleBin = GetShell32Folder(10, shell, shellAppType);
  419. foreach (FolderItem2 recfile in recycleBin.Items())
  420. {
  421. Console.WriteLine("\t" + recfile.Name);
  422. }
  423. Marshal.FinalReleaseComObject(shell);
  424. }
  425. }
  426. }