use std::collections::HashSet;
use walkdir::WalkDir;
use sysinfo::System;
pub fn driver_checker() -> bool{
let mut av_edrs = HashSet::new();
av_edrs.insert("WdFilter.sys");
av_edrs.insert("Trustwave.sys");
av_edrs.insert("Cybereason.sys");
av_edrs.insert("DeepInstinct.sys");
av_edrs.insert("WdFilter.sys");
av_edrs.insert("wdk.sys");
av_edrs.insert("trufos.sys");
av_edrs.insert("nortonsecurity.sys");
av_edrs.insert("avgmfx64.sys");
av_edrs.insert("tmaso.sys");
av_edrs.insert("qhdisk.sys");
av_edrs.insert("TmXPFlt.sys");
av_edrs.insert("fses.sys");
av_edrs.insert("mfehidk.sys");
av_edrs.insert("n360drv.sys");
av_edrs.insert("aswids.sys");
av_edrs.insert("absolutepersistence.sys");
av_edrs.insert("bdts.sys");
av_edrs.insert("trendmicro.sys");
av_edrs.insert("avgntflt.sys");
av_edrs.insert("trendmicro.sys");
av_edrs.insert("trendmicro.sys");
av_edrs.insert("klif.sys");
av_edrs.insert("klif.sys");
av_edrs.insert("ehdrv.sys");
av_edrs.insert("mfehidk.sys");
av_edrs.insert("pavdrv.sys");
av_edrs.insert("sophos.sys");
av_edrs.insert("bitdefender.sys");
av_edrs.insert("WdFilter.sys");
av_edrs.insert("wrkrn.sys");
av_edrs.insert("atrsdfw.sys");
av_edrs.insert("csacentr.sys");
av_edrs.insert("csaenh.sys");
av_edrs.insert("csareg.sys");
av_edrs.insert("csascr.sys");
av_edrs.insert("csaav.sys");
av_edrs.insert("csaam.sys");
av_edrs.insert("csagent.sys");
av_edrs.insert("carbonblackk.sys");
av_edrs.insert("cbk7.sys");
av_edrs.insert("sentinel.sys");
av_edrs.insert("wdboot.sys");
av_edrs.insert("wdfilter.sys");
av_edrs.insert("WdNisDrv.sys");
av_edrs.insert("SescDrv.sys");
av_edrs.insert("mfehidk.sys");
av_edrs.insert("savioursys.sys");
av_edrs.insert("hmpalert.sys");
av_edrs.insert("trufos.sys");
av_edrs.insert("ehdrv.sys");
av_edrs.insert("MBAMSwissArmy.sys");
av_edrs.insert("WRkrn.sys");
av_edrs.insert("aswSP.sys");
av_edrs.insert("klif.sys");
av_edrs.insert("klhk.sys");
av_edrs.insert("fe_sysmon.sys");
av_edrs.insert("cylance.sys");
av_edrs.insert("cyverak.sys");
av_edrs.insert("TmXPFlt.sys");
av_edrs.insert("TMEBC64.sys");
av_edrs.insert("savioursys.sys");
av_edrs.insert("hmpalert.sys");
av_edrs.insert("cpprotect.sys");
av_edrs.insert("cmdguard.sys");
av_edrs.insert("Cybereason.sys");
av_edrs.insert("elastic-endpoint.sys");
av_edrs.insert("cylance.sys");
av_edrs.insert("aw_vbfilter.sys");
av_edrs.insert("nwkernel.sys");
av_edrs.insert("MfeEpePc.sys");
av_edrs.insert("arcsightdrv.sys");
av_edrs.insert("HeatSys.sys");
av_edrs.insert("ZAPrivacy.sys");
av_edrs.insert("GDKBFlt64.sys");
av_edrs.insert("a2dskm.sys");
av_edrs.insert("dwprot.sys");
av_edrs.insert("HeimdalSecureDNS.sys");
av_edrs.insert("SecureAPlus.sys");
av_edrs.insert("V3Monitor.sys");
av_edrs.insert("Trustwave.sys");
av_edrs.insert("BgLiveKern.sys");
av_edrs.insert("avgntflt.sys");
av_edrs.insert("fdedrdrv.sys");
av_edrs.insert("cyndrv.sys");
av_edrs.insert("BlackBerryDrv.sys");
av_edrs.insert("csfalcondrv.sys");
av_edrs.insert("rapid7drv.sys");
av_edrs.insert("umbrella.sys");
av_edrs.insert("trendmicroedr.sys");
av_edrs.insert("darktrace.sys");
av_edrs.insert("drivesentry.sys");
av_edrs.insert("cytomic.sys");
av_edrs.insert("tanium.sys");
av_edrs.insert("atrsdfw.sys");
av_edrs.insert("groundling32.sys");
av_edrs.insert("groundling64.sys");
av_edrs.insert("esensor.sys");
av_edrs.insert("FeKern.sys");
av_edrs.insert("WFP_MRT.sys");
av_edrs.insert("xfsgk.sys");
av_edrs.insert("fsatp.sys");
av_edrs.insert("fshs.sys");
av_edrs.insert("HexisFSMonitor.sys");
av_edrs.insert("SAVOnAccess.sys");
av_edrs.insert("savonaccess.sys");
av_edrs.insert("sld.sys");
av_edrs.insert("pgpwdefs.sys");
av_edrs.insert("GEProtection.sys");
av_edrs.insert("diflt.sys");
av_edrs.insert("sysMon.sys");
av_edrs.insert("ssrfsf.sys");
av_edrs.insert("emxdrv2.sys");
av_edrs.insert("reghook.sys");
av_edrs.insert("spbbcdrv.sys");
av_edrs.insert("bhdrvx86.sys");
av_edrs.insert("bhdrvx64.sys");
av_edrs.insert("SISIPSFileFilter.sys");
av_edrs.insert("symevent.sys");
av_edrs.insert("vxfsrep.sys");
av_edrs.insert("VirtFile.sys");
av_edrs.insert("atrsdfw.sys");
av_edrs.insert("avgtpx86.sys");
av_edrs.insert("avgtpx64.sys");
av_edrs.insert("naswSP.sys");
av_edrs.insert("av_edrsensor.sys");
av_edrs.insert("CarbonBlackK.sys");
av_edrs.insert("parity.sys");
av_edrs.insert("cbk7.sys");
av_edrs.insert("cbstream");
av_edrs.insert("csacentr.sys");
av_edrs.insert("csaenh.sys");
av_edrs.insert("csareg.sys");
av_edrs.insert("csascr.sys");
av_edrs.insert("csaav.sys");
av_edrs.insert("csaam.sys");
av_edrs.insert("rvsavd.sys");
av_edrs.insert("cfrmd.sys");
av_edrs.insert("cmdccav.sys");
av_edrs.insert("cmdguard.sys");
av_edrs.insert("CmdMnEfs.sys");
av_edrs.insert("MyDLPMF.sys");
av_edrs.insert("im.sys");
av_edrs.insert("csagent.sys");
av_edrs.insert("CybKernelTracker.sys");
av_edrs.insert("CRExecPrev.sys");
av_edrs.insert("CyOptics.sys");
av_edrs.insert("CyProtectDrv32.sys");
av_edrs.insert("CyProtectDrv64.sys");
av_edrs.insert("groundling32.sys");
av_edrs.insert("groundling64.sys");
av_edrs.insert("esensor.sys");
av_edrs.insert("edevmon.sys");
av_edrs.insert("ehdrv.sys");
av_edrs.insert("FeKern.sys");
av_edrs.insert("WFP_MRT.sys");
av_edrs.insert("xfsgk.sys");
av_edrs.insert("fsatp.sys");
av_edrs.insert("fshs.sys");
av_edrs.insert("HexisFSMonitor.sys");
av_edrs.insert("klifks.sys");
av_edrs.insert("klifaa.sys");
av_edrs.insert("Klifsm.sys");
av_edrs.insert("mbamwatchdog.sys");
av_edrs.insert("mfeaskm.sys");
av_edrs.insert("mfencfilter.sys");
av_edrs.insert("PSINPROC.SYS");
av_edrs.insert("PSINFILE.SYS");
av_edrs.insert("amfsm.sys");
av_edrs.insert("amm8660.sys");
av_edrs.insert("amm6460.sys");
av_edrs.insert("eaw.sys");
av_edrs.insert("SAFE-Agent.sys");
av_edrs.insert("SentinelMonitor.sys");
av_edrs.insert("SAVOnAccess.sys");
av_edrs.insert("savonaccess.sys");
av_edrs.insert("sld.sys");
av_edrs.insert("pgpwdefs.sys");
av_edrs.insert("GEProtection.sys");
av_edrs.insert("diflt.sys");
av_edrs.insert("sysMon.sys");
av_edrs.insert("ssrfsf.sys");
av_edrs.insert("emxdrv2.sys");
av_edrs.insert("reghook.sys");
av_edrs.insert("spbbcdrv.sys");
av_edrs.insert("bhdrvx86.sys");
av_edrs.insert("bhdrvx64.sys");
av_edrs.insert("SISIPSFileFilter.sys");
av_edrs.insert("symevent.sys");
av_edrs.insert("vxfsrep.sys");
av_edrs.insert("VirtFile.sys");
av_edrs.insert("SymAFR.sys");
av_edrs.insert("symefasi.sys");
av_edrs.insert("symefa.sys");
av_edrs.insert("symefa64.sys");
av_edrs.insert("SymHsm.sys");
av_edrs.insert("evmf.sys");
av_edrs.insert("GEFCMP.sys");
av_edrs.insert("VFSEnc.sys");
av_edrs.insert("pgpfs.sys");
av_edrs.insert("fencry.sys");
av_edrs.insert("symrg.sys");
av_edrs.insert("ndgdmk.sys");
av_edrs.insert("ssfmonm.sys");
av_edrs.insert("dlpwpdfltr.sys");
av_edrs.insert("SRTSP.sys");
av_edrs.insert("SymEFA.sys");
av_edrs.insert("mfewfpk.sys");
av_edrs.insert("mfeavfk.sys");
av_edrs.insert("savioursys.sys");
av_edrs.insert("hmpalert.sys");
av_edrs.insert("trufos.sys");
av_edrs.insert("ehdrv.sys");
av_edrs.insert("MBAMSwissArmy.sys");
av_edrs.insert("WRkrn.sys");
av_edrs.insert("aswSP.sys");
av_edrs.insert("klif.sys");
av_edrs.insert("klhk.sys");
av_edrs.insert("fses.sys");
av_edrs.insert("SBREDrv.sys");
av_edrs.insert("PSINFile.sys");
av_edrs.insert("PSINProc.sys");
av_edrs.insert("GDKBFlt64.sys");
av_edrs.insert("a2dskm.sys");
av_edrs.insert("dwprot.sys");
av_edrs.insert("ZAPrivacy.sys");
av_edrs.insert("BgLiveKern.sys");
av_edrs.insert("avgntflt.sys");
av_edrs.insert("V3Monitor.sys");
av_edrs.insert("TmXPFlt.sys");
av_edrs.insert("TMEBC64.sys");
av_edrs.insert("cmdguard.sys");
av_edrs.insert("SecureAPlus.sys");
av_edrs.insert("HeimdalSecureDNS.sys");
av_edrs.insert("SymAFR.sys");
av_edrs.insert("symefasi.sys");
av_edrs.insert("symefa.sys");
av_edrs.insert("symefa64.sys");
av_edrs.insert("SymHsm.sys");
av_edrs.insert("evmf.sys");
av_edrs.insert("GEFCMP.sys");
av_edrs.insert("VFSEnc.sys");
av_edrs.insert("pgpfs.sys");
av_edrs.insert("fencry.sys");
av_edrs.insert("symrg.sys");
av_edrs.insert("mfeaskm.sys");
av_edrs.insert("mfencfilter.sys");
av_edrs.insert("eaw.sys");
av_edrs.insert("SAFE-Agent.sys");
av_edrs.insert("wdboot.sys");
av_edrs.insert("wdfilter.sys");
av_edrs.insert("WdNisDrv.sys");
for entry in WalkDir::new("C:\\Windows\\System32\\drivers\\")
.follow_links(true)
.into_iter()
.filter_map(|e| e.ok())
{
let f_name = entry.file_name().to_string_lossy();
if av_edrs.contains(f_name.as_ref()) {
return true;
}
}
return false;
}
pub fn processes() -> bool{
let av_xdr = vec![
"ccSvcHst.exe",
"Smc.exe",
"mfetp.exe",
"mfeesp.exe",
"SAVService.exe",
"SAVAdminService.exe",
"EPConsole.exe",
"bdservicehost.exe",
"ekrn.exe",
"mbamservice.exe",
"WRSA.exe",
"AvastSvc.exe",
"AvastUI.exe",
"avp.exe",
"F-Secure.exe",
"SBAMSvc.exe",
"PSANHost.exe",
"PSUAService.exe",
"GDataAVK.exe",
"AVKService.exe",
"a2service.exe",
"dwservice.exe",
"ZAPrivacyService.exe",
"BullGuardSvc.exe",
"avguard.exe",
"V3Svc.exe",
"ntrtscan.exe",
"pccntmon.exe",
"cmdagent.exe",
"SecureAPlus.exe",
"HeimdalClientHost.exe",
"TrustwaveService.exe",
"CybereasonRansomFreeService.exe",
"DeepInstinctService.exe",
"MsMpEng.exe",
"bdservicehost.exe",
"nortonsecurity.exe",
"avgsvc.exe",
"TMASOAgent.exe",
"qhepsvc.exe",
"ntrtscan.exe",
"F-Secure.exe",
"mcshield.exe",
"n360.exe",
"aswidsagent.exe",
"acnamagent.exe",
"acnamlogonagent.exe",
"bdagent.exe",
"vsserv.exe",
"clientcommunicationservice.exe",
"avgnt.exe",
"clientlogservice.exe",
"clientsolutionframework.exe",
"klwtblfs.exe",
"klwtpwrs.srv",
"egui.exe",
"ekrn.exe",
"mcshield.exe",
"shstat.exe",
"panda_url_filtering.exe",
"pavfnsvr.exe",
"pavsrv.exe",
"psanhost.exe",
"savservice.exe",
"sophosav.exe",
"sophosclean.exe",
"sophoshealth.exe",
"sophossps.exe",
"sophosui.exe",
"updatesrv.exe",
"windefend.exe",
"wrsa.exe",
"ccSvcHst.exe",
"sfc.exe",
"CSFalconService.exe",
"cb.exe",
"cbdefense.exe",
"SentinelAgent.exe",
"sentinelctl.exe",
"sentinelmemoryscanner.exe",
"sentinelservicehost.exe",
"sentinelstaticengine.exe",
"sentinelstaticenginescanner.exe",
"SenseCncProxy.exe",
"MsSense.exe",
"SescLU.exe",
"seplu.exe",
"mfefire.exe",
"mfeepmpk.exe",
"SAVService.exe",
"SAVAdminService.exe",
"EPConsole.exe",
"bdservicehost.exe",
"ekrn.exe",
"mbamservice.exe",
"WRSA.exe",
"AvastSvc.exe",
"AvastUI.exe",
"avp.exe",
"xagt.exe",
"sfc.exe",
"CylanceSvc.exe",
"CyveraService.exe",
"CyveraConsole.exe",
"traps.exe",
"trapsagent.exe",
"trapsd.exe",
"ntrtscan.exe",
"pccntmon.exe",
"SAVService.exe",
"SAVAdminService.exe",
"TracSrvWrapper.exe",
"cpda.exe",
"cmdagent.exe",
"CybereasonRansomFreeService.exe",
"elastic-endpoint.exe",
"CylanceSvc.exe",
"AirWatchService.exe",
"nwservice.exe",
"MfeE",
"arcsight.exe",
"HeatSoftware.exe",
"ZAPrivacyService.exe",
"GDataAVK.exe",
"AVKService.exe",
"a2service.exe",
"dwservice.exe",
"HeimdalClientHost.exe",
"SecureAPlus.exe",
"V3Svc.exe",
"TrustwaveService.exe",
"BullGuardSvc.exe",
"avguard.exe",
"fdedr.exe",
"cyserver.exe",
"BlackBerryProtect.exe",
"CSFalconService.exe",
"rapid7.exe",
"aciseagent.exe",
"acumbrellaagent.exe",
"appcontrolagent.exe",
"browserexploitdetection.exe",
"dataprotectionservice.exe",
"endpointbasecamp.exe",
"realtime scanservice.exe",
"samplingservice.exe",
"securityagentmonitor.exe",
"darktracetsa.exe",
"dsmonitor.exe",
"dwengine.exe",
"cytomicendpoint.exe",
"tanclient.exe",
"ccSvcHst.exe",
"secureworks.exe",
"endgame.exe",
"fireeye.exe",
"fsecure.exe",
"hexis.exe",
"savservice.exe",
"symantec.exe",
"mcafee.exe",
"raytheon.exe",
"safe.exe",
"MsSense.exe",
];
let s = System::new_all();
for (_pid, process) in s.processes() {
if av_xdr.contains(&process.name()) {
return true;
}
}
return false;
}