enumsecproducts.c 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701
  1. #include <windows.h>
  2. #include <stdbool.h>
  3. #include <stdio.h>
  4. #include <wtsapi32.h>
  5. #include "enumsecproducts.h"
  6. #include "beacon.h"
  7. typedef struct {
  8. const char *filename;
  9. const char *description;
  10. const char *category;
  11. } SoftwareData;
  12. //https://github.com/outflanknl/C2-Tool-Collection/blob/main/BOF/Psx/SOURCE/Psx.c
  13. HRESULT BeaconPrintToStreamW(_In_z_ LPCWSTR lpwFormat, ...) {
  14. HRESULT hr = S_FALSE;
  15. va_list argList;
  16. DWORD dwWritten = 0;
  17. if (g_lpStream <= (LPSTREAM)1) {
  18. hr = OLE32$CreateStreamOnHGlobal(NULL, TRUE, &g_lpStream);
  19. if (FAILED(hr)) {
  20. return hr;
  21. }
  22. }
  23. if (g_lpwPrintBuffer <= (LPWSTR)1) {
  24. g_lpwPrintBuffer = (LPWSTR)MSVCRT$calloc(MAX_STRING, sizeof(WCHAR));
  25. if (g_lpwPrintBuffer == NULL) {
  26. hr = E_FAIL;
  27. goto CleanUp;
  28. }
  29. }
  30. va_start(argList, lpwFormat);
  31. if (!MSVCRT$_vsnwprintf_s(g_lpwPrintBuffer, MAX_STRING, MAX_STRING -1, lpwFormat, argList)) {
  32. hr = E_FAIL;
  33. goto CleanUp;
  34. }
  35. if (g_lpStream != NULL) {
  36. if (FAILED(hr = g_lpStream->lpVtbl->Write(g_lpStream, g_lpwPrintBuffer, (ULONG)MSVCRT$wcslen(g_lpwPrintBuffer) * sizeof(WCHAR), &dwWritten))) {
  37. goto CleanUp;
  38. }
  39. }
  40. hr = S_OK;
  41. CleanUp:
  42. if (g_lpwPrintBuffer != NULL) {
  43. MSVCRT$memset(g_lpwPrintBuffer, 0, MAX_STRING * sizeof(WCHAR));
  44. }
  45. va_end(argList);
  46. return hr;
  47. }
  48. //https://github.com/outflanknl/C2-Tool-Collection/blob/main/BOF/Psx/SOURCE/Psx.c
  49. VOID BeaconOutputStreamW() {
  50. STATSTG ssStreamData = { 0 };
  51. SIZE_T cbSize = 0;
  52. ULONG cbRead = 0;
  53. LARGE_INTEGER pos;
  54. LPWSTR lpwOutput = NULL;
  55. if (FAILED(g_lpStream->lpVtbl->Stat(g_lpStream, &ssStreamData, STATFLAG_NONAME))) {
  56. return;
  57. }
  58. cbSize = ssStreamData.cbSize.LowPart;
  59. lpwOutput = KERNEL32$HeapAlloc(KERNEL32$GetProcessHeap(), HEAP_ZERO_MEMORY, cbSize + 1);
  60. if (lpwOutput != NULL) {
  61. pos.QuadPart = 0;
  62. if (FAILED(g_lpStream->lpVtbl->Seek(g_lpStream, pos, STREAM_SEEK_SET, NULL))) {
  63. goto CleanUp;
  64. }
  65. if (FAILED(g_lpStream->lpVtbl->Read(g_lpStream, lpwOutput, (ULONG)cbSize, &cbRead))) {
  66. goto CleanUp;
  67. }
  68. BeaconPrintf(CALLBACK_OUTPUT, "%ls", lpwOutput);
  69. }
  70. CleanUp:
  71. if (g_lpStream != NULL) {
  72. g_lpStream->lpVtbl->Release(g_lpStream);
  73. g_lpStream = NULL;
  74. }
  75. if (g_lpwPrintBuffer != NULL) {
  76. MSVCRT$free(g_lpwPrintBuffer);
  77. g_lpwPrintBuffer = NULL;
  78. }
  79. if (lpwOutput != NULL) {
  80. KERNEL32$HeapFree(KERNEL32$GetProcessHeap(), 0, lpwOutput);
  81. }
  82. return;
  83. }
  84. void go(char *args, int len) {
  85. CHAR *hostName = "";
  86. HANDLE handleHost = NULL;
  87. datap parser;
  88. DWORD argSize = NULL;
  89. WTS_PROCESS_INFOA * proc_info;
  90. DWORD pi_count = 0;
  91. LPSTR procName;
  92. bool foundSecProduct = false;
  93. BeaconDataParse(&parser, args, len);
  94. hostName = BeaconDataExtract(&parser, &argSize);
  95. //allocate memory for list
  96. size_t numSoftware = 130; //130
  97. SoftwareData *softwareList = (SoftwareData *)KERNEL32$VirtualAlloc(NULL, numSoftware * sizeof(SoftwareData), MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
  98. if (softwareList == NULL) {
  99. BeaconPrintf(CALLBACK_ERROR, "Failed to allocate memory for softwareList.\n");
  100. return -1;
  101. }
  102. //Start security product list
  103. softwareList[0].filename = "avastsvc.exe";
  104. softwareList[0].description = L"Avast";
  105. softwareList[0].category = L"AV";
  106. softwareList[1].filename = "avastui.exe";
  107. softwareList[1].description = L"Avast";
  108. softwareList[1].category = L"AV";
  109. softwareList[2].filename = "avgnt.exe";
  110. softwareList[2].description = L"Avira";
  111. softwareList[2].category = L"AV";
  112. softwareList[3].filename = "avguard.exe";
  113. softwareList[3].description = L"Avira";
  114. softwareList[3].category = L"AV";
  115. softwareList[4].filename = "avp.exe";
  116. softwareList[4].description = L"Kaspersky";
  117. softwareList[4].category = L"AV";
  118. softwareList[5].filename = "axcrypt.exe";
  119. softwareList[5].description = L"AxCrypt";
  120. softwareList[5].category = L"Encryption";
  121. softwareList[6].filename = "bdagent.exe";
  122. softwareList[6].description = L"Bitdefender Total Security";
  123. softwareList[6].category = L"AV";
  124. softwareList[7].filename = "carbonsensor.exe";
  125. softwareList[7].description = L"VMware Carbon Black EDR";
  126. softwareList[7].category = L"EDR";
  127. softwareList[8].filename = "cbcomms.exe";
  128. softwareList[8].description = L"CrowdStrike Falcon Insight XDR";
  129. softwareList[8].category = L"XDR";
  130. softwareList[9].filename = "ccsvchst.exe";
  131. softwareList[9].description = L"Symantec Endpoint Protection";
  132. softwareList[9].category = L"AV";
  133. softwareList[10].filename = "cpd.exe";
  134. softwareList[10].description = L"Check Point Daemon";
  135. softwareList[10].category = L"Security";
  136. softwareList[11].filename = "cpx.exe";
  137. softwareList[11].description = L"SentinelOne Singularity XDR";
  138. softwareList[11].category = L"XDR";
  139. softwareList[12].filename = "csfalconservice.exe";
  140. softwareList[12].description = L"CrowdStrike Falcon Insight XDR";
  141. softwareList[12].category = L"XDR";
  142. softwareList[13].filename = "cybereason.exe";
  143. softwareList[13].description = L"Cybereason EDR";
  144. softwareList[13].category = L"EDR";
  145. softwareList[14].filename = "cytomicendpoint.exe";
  146. softwareList[14].description = L"Cytomic Orion";
  147. softwareList[14].category = L"Security";
  148. softwareList[15].filename = "dlpagent.exe";
  149. softwareList[15].description = L"Symantec DLP Agent";
  150. softwareList[15].category = L"DLP";
  151. softwareList[16].filename = "dlpsensor.exe";
  152. softwareList[16].description = L"McAfee DLP Sensor";
  153. softwareList[16].category = L"DLP";
  154. softwareList[17].filename = "dsmonitor.exe";
  155. softwareList[17].description = L"DriveSentry";
  156. softwareList[17].category = L"Security";
  157. softwareList[18].filename = "dwengine.exe";
  158. softwareList[18].description = L"DriveSentry";
  159. softwareList[18].category = L"Security";
  160. softwareList[19].filename = "edpa.exe";
  161. softwareList[19].description = L"McAfee Endpoint Security";
  162. softwareList[19].category = L"AV";
  163. softwareList[20].filename = "egui.exe";
  164. softwareList[20].description = L"ESET NOD32 AV";
  165. softwareList[20].category = L"AV";
  166. softwareList[21].filename = "ekrn.exe";
  167. softwareList[21].description = L"ESET NOD32 AV";
  168. softwareList[21].category = L"AV";
  169. softwareList[22].filename = "firesvc.exe";
  170. softwareList[22].description = L"FireEye Endpoint Agent";
  171. softwareList[22].category = L"Security";
  172. softwareList[23].filename = "firetray.exe";
  173. softwareList[23].description = L"FireEye Endpoint Agent";
  174. softwareList[23].category = L"Security";
  175. softwareList[24].filename = "fortiedr.exe";
  176. softwareList[24].description = L"FortiEDR";
  177. softwareList[24].category = L"EDR";
  178. softwareList[25].filename = "fw.exe";
  179. softwareList[25].description = L"Check Point Firewall";
  180. softwareList[25].category = L"Firewall";
  181. softwareList[26].filename = "hips.exe";
  182. softwareList[26].description = L"Host Intrusion Prevention System";
  183. softwareList[26].category = L"HIPS";
  184. softwareList[27].filename = "kpf4ss.exe";
  185. softwareList[27].description = L"Kerio Personal Firewall";
  186. softwareList[27].category = L"Firewall";
  187. softwareList[28].filename = "mbamservice.exe";
  188. softwareList[28].description = L"Malwarebytes";
  189. softwareList[28].category = L"AV";
  190. softwareList[29].filename = "mbamtray.exe";
  191. softwareList[29].description = L"Malwarebytes";
  192. softwareList[29].category = L"AV";
  193. softwareList[30].filename = "mcshield.exe";
  194. softwareList[30].description = L"McAfee VirusScan";
  195. softwareList[30].category = L"AV";
  196. softwareList[31].filename = "mfefire.exe";
  197. softwareList[31].description = L"McAfee Host Intrusion Prevention";
  198. softwareList[31].category = L"HIPS";
  199. softwareList[32].filename = "msascuil.exe";
  200. softwareList[32].description = L"Windows Defender";
  201. softwareList[32].category = L"AV";
  202. softwareList[33].filename = "msmpeng.exe";
  203. softwareList[33].description = L"Windows Defender";
  204. softwareList[33].category = L"AV";
  205. softwareList[34].filename = "msseces.exe";
  206. softwareList[34].description = L"Microsoft Security Essentials";
  207. softwareList[34].category = L"AV";
  208. softwareList[35].filename = "nissrv.exe";
  209. softwareList[35].description = L"Microsoft Security Essentials";
  210. softwareList[35].category = L"AV";
  211. softwareList[36].filename = "outpost.exe";
  212. softwareList[36].description = L"Agnitum Outpost Firewall";
  213. softwareList[36].category = L"Firewall";
  214. softwareList[37].filename = "panda_url_filtering.exe";
  215. softwareList[37].description = L"Panda Security";
  216. softwareList[37].category = L"AV";
  217. softwareList[38].filename = "pavfnsvr.exe";
  218. softwareList[38].description = L"Panda Security";
  219. softwareList[38].category = L"AV";
  220. softwareList[39].filename = "pavsrv.exe";
  221. softwareList[39].description = L"Panda Security";
  222. softwareList[39].category = L"AV";
  223. softwareList[40].filename = "psanhost.exe";
  224. softwareList[40].description = L"Panda Security";
  225. softwareList[40].category = L"AV";
  226. softwareList[41].filename = "rtvscan.exe";
  227. softwareList[41].description = L"Symantec Endpoint Protection";
  228. softwareList[41].category = L"AV";
  229. softwareList[42].filename = "savservice.exe";
  230. softwareList[42].description = L"Sophos Endpoint Security";
  231. softwareList[42].category = L"AV";
  232. softwareList[43].filename = "shstat.exe";
  233. softwareList[43].description = L"McAfee VirusScan";
  234. softwareList[43].category = L"AV";
  235. softwareList[44].filename = "sophosav.exe";
  236. softwareList[44].description = L"Sophos Endpoint Security";
  237. softwareList[44].category = L"AV";
  238. softwareList[45].filename = "sophossps.exe";
  239. softwareList[45].description = L"Sophos Endpoint Security";
  240. softwareList[45].category = L"AV";
  241. softwareList[46].filename = "sophosui.exe";
  242. softwareList[46].description = L"Sophos Endpoint Security";
  243. softwareList[46].category = L"AV";
  244. softwareList[47].filename = "sysmon.exe";
  245. softwareList[47].description = L"Microsoft Sysmon";
  246. softwareList[47].category = L"Security";
  247. softwareList[48].filename = "tanclient.exe";
  248. softwareList[48].description = L"Tanium EDR";
  249. softwareList[48].category = L"EDR";
  250. softwareList[49].filename = "tmntsrv.exe";
  251. softwareList[49].description = L"Trend Micro OfficeScan";
  252. softwareList[49].category = L"AV";
  253. softwareList[50].filename = "tmproxy.exe";
  254. softwareList[50].description = L"Trend Micro OfficeScan";
  255. softwareList[50].category = L"AV";
  256. softwareList[51].filename = "trapsagent.exe";
  257. softwareList[51].description = L"Palo Alto Networks Cortex XDR";
  258. softwareList[51].category = L"XDR";
  259. softwareList[52].filename = "trapsd.exe";
  260. softwareList[52].description = L"Palo Alto Networks Cortex XDR";
  261. softwareList[52].category = L"XDR";
  262. softwareList[53].filename = "truecrypt.exe";
  263. softwareList[53].description = L"TrueCrypt";
  264. softwareList[53].category = L"Encryption";
  265. softwareList[54].filename = "vsserv.exe";
  266. softwareList[54].description = L"Bitdefender Total Security";
  267. softwareList[54].category = L"AV";
  268. softwareList[55].filename = "wrsa.exe";
  269. softwareList[55].description = L"Webroot Anywhere";
  270. softwareList[55].category = L"AV";
  271. softwareList[56].filename = "windefend.exe";
  272. softwareList[56].description = L"Windows Defender";
  273. softwareList[56].category = L"AV";
  274. softwareList[57].filename = "xagt.exe";
  275. softwareList[57].description = L"FireEye HX";
  276. softwareList[57].category = L"Security";
  277. softwareList[58].filename = "ahnsd.exe";
  278. softwareList[58].description = L"AhnLab V3 Internet Security";
  279. softwareList[58].category = L"AV";
  280. softwareList[59].filename = "amsiagent.exe";
  281. softwareList[59].description = L"Bromium AMSI Agent";
  282. softwareList[59].category = L"Security";
  283. softwareList[60].filename = "avkwctl.exe";
  284. softwareList[60].description = L"K7 Total Security";
  285. softwareList[60].category = L"AV";
  286. softwareList[61].filename = "avmailc.exe";
  287. softwareList[61].description = L"Avira MailGuard";
  288. softwareList[61].category = L"AV";
  289. softwareList[62].filename = "avgemc.exe";
  290. softwareList[62].description = L"AVG Email Scanner";
  291. softwareList[62].category = L"AV";
  292. softwareList[63].filename = "avgidsagent.exe";
  293. softwareList[63].description = L"AVG Identity Protection";
  294. softwareList[63].category = L"Security";
  295. softwareList[64].filename = "avkmgr.exe";
  296. softwareList[64].description = L"K7 Total Security";
  297. softwareList[64].category = L"AV";
  298. softwareList[65].filename = "avshadow.exe";
  299. softwareList[65].description = L"Avira Shadow Copy Service";
  300. softwareList[65].category = L"AV";
  301. softwareList[66].filename = "avwebgrd.exe";
  302. softwareList[66].description = L"Avira Web Protection";
  303. softwareList[66].category = L"AV";
  304. softwareList[67].filename = "bavtray.exe";
  305. softwareList[67].description = L"Baidu Antivirus";
  306. softwareList[67].category = L"AV";
  307. softwareList[68].filename = "bavupdat.exe";
  308. softwareList[68].description = L"Baidu Antivirus Updater";
  309. softwareList[68].category = L"AV";
  310. softwareList[69].filename = "bdredline.exe";
  311. softwareList[69].description = L"Bitdefender Redline";
  312. softwareList[69].category = L"AV";
  313. softwareList[70].filename = "bdsubwiz.exe";
  314. softwareList[70].description = L"Bitdefender Submission Wizard";
  315. softwareList[70].category = L"AV";
  316. softwareList[71].filename = "cfp.exe";
  317. softwareList[71].description = L"COMODO Firewall";
  318. softwareList[71].category = L"Firewall";
  319. softwareList[72].filename = "cmdagent.exe";
  320. softwareList[72].description = L"COMODO Internet Security";
  321. softwareList[72].category = L"AV";
  322. softwareList[73].filename = "csavtray.exe";
  323. softwareList[73].description = L"Centennial Endpoint Security";
  324. softwareList[73].category = L"AV";
  325. softwareList[74].filename = "csinsm32.exe";
  326. softwareList[74].description = L"Centennial Endpoint Security";
  327. softwareList[74].category = L"AV";
  328. softwareList[75].filename = "fprot.exe";
  329. softwareList[75].description = L"F-Prot Antivirus";
  330. softwareList[75].category = L"AV";
  331. softwareList[76].filename = "fpwin.exe";
  332. softwareList[76].description = L"F-Prot Antivirus";
  333. softwareList[76].category = L"AV";
  334. softwareList[77].filename = "frzstate2k.exe";
  335. softwareList[77].description = L"Faronics Deep Freeze";
  336. softwareList[77].category = L"Security";
  337. softwareList[78].filename = "gdatpagent.exe";
  338. softwareList[78].description = L"Symantec Data Loss Prevention";
  339. softwareList[78].category = L"DLP";
  340. softwareList[79].filename = "gfiarksvc.exe";
  341. softwareList[79].description = L"GFI LanGuard";
  342. softwareList[79].category = L"Security";
  343. softwareList[80].filename = "gfiarktray.exe";
  344. softwareList[80].description = L"GFI LanGuard";
  345. softwareList[80].category = L"Security";
  346. softwareList[81].filename = "hexisagent.exe";
  347. softwareList[81].description = L"Hexis HawkEye G";
  348. softwareList[81].category = L"EDR";
  349. softwareList[82].filename = "hexiscybereye.exe";
  350. softwareList[82].description = L"Hexis CyberEye";
  351. softwareList[82].category = L"Security";
  352. softwareList[83].filename = "k7avtray.exe";
  353. softwareList[83].description = L"K7 Total Security";
  354. softwareList[83].category = L"AV";
  355. softwareList[84].filename = "k7rtscan.exe";
  356. softwareList[84].description = L"K7 Total Security";
  357. softwareList[84].category = L"AV";
  358. softwareList[85].filename = "k7uascan.exe";
  359. softwareList[85].description = L"K7 Total Security";
  360. softwareList[85].category = L"AV";
  361. softwareList[86].filename = "k7upschdl.exe";
  362. softwareList[86].description = L"K7 Total Security";
  363. softwareList[86].category = L"AV";
  364. softwareList[87].filename = "k7wscsvc.exe";
  365. softwareList[87].description = L"K7 Total Security";
  366. softwareList[87].category = L"AV";
  367. softwareList[88].filename = "k7wscwiz.exe";
  368. softwareList[88].description = L"K7 Total Security";
  369. softwareList[88].category = L"AV";
  370. softwareList[89].filename = "languard.exe";
  371. softwareList[89].description = L"GFI LanGuard";
  372. softwareList[89].category = L"Security";
  373. softwareList[90].filename = "mbae.exe";
  374. softwareList[90].description = L"Malwarebytes Anti-Exploit";
  375. softwareList[90].category = L"Security";
  376. softwareList[91].filename = "nxclient.exe";
  377. softwareList[91].description = L"Nexusguard Endpoint Protection";
  378. softwareList[91].category = L"AV";
  379. softwareList[92].filename = "nxtray.exe";
  380. softwareList[92].description = L"Nexusguard Endpoint Protection";
  381. softwareList[92].category = L"AV";
  382. softwareList[93].filename = "panda_tpsrv.exe";
  383. softwareList[93].description = L"Panda Security";
  384. softwareList[93].category = L"AV";
  385. softwareList[94].filename = "pcmaticrt.exe";
  386. softwareList[94].description = L"PC Matic Real-Time";
  387. softwareList[94].category = L"AV";
  388. softwareList[95].filename = "pcmatrtsystray.exe";
  389. softwareList[95].description = L"PC Matic";
  390. softwareList[95].category = L"AV";
  391. softwareList[96].filename = "pclxav.exe";
  392. softwareList[96].description = L"PC-Linq AntiVirus";
  393. softwareList[96].category = L"AV";
  394. softwareList[97].filename = "pcmaticsvc.exe";
  395. softwareList[97].description = L"PC Matic";
  396. softwareList[97].category = L"AV";
  397. softwareList[98].filename = "qhpserver.exe";
  398. softwareList[98].description = L"Qihoo 360 Total Security";
  399. softwareList[98].category = L"AV";
  400. softwareList[99].filename = "qihoo_ts.exe";
  401. softwareList[99].description = L"Qihoo 360 Total Security";
  402. softwareList[99].category = L"AV";
  403. softwareList[100].filename = "sbamsvc.exe";
  404. softwareList[100].description = L"VIPRE Antivirus";
  405. softwareList[100].category = L"AV";
  406. softwareList[101].filename = "sbamtray.exe";
  407. softwareList[101].description = L"VIPRE Antivirus";
  408. softwareList[101].category = L"AV";
  409. softwareList[102].filename = "sbamui.exe";
  410. softwareList[102].description = L"VIPRE Antivirus";
  411. softwareList[102].category = L"AV";
  412. softwareList[103].filename = "sfc.exe";
  413. softwareList[103].description = L"System File Checker";
  414. softwareList[103].category = L"Security";
  415. softwareList[104].filename = "smc.exe";
  416. softwareList[104].description = L"Symantec Endpoint Protection";
  417. softwareList[104].category = L"AV";
  418. softwareList[105].filename = "sophoscleaner.exe";
  419. softwareList[105].description = L"Sophos Virus Removal Tool";
  420. softwareList[105].category = L"AV";
  421. softwareList[106].filename = "sophoshealth.exe";
  422. softwareList[106].description = L"Sophos Endpoint Security";
  423. softwareList[106].category = L"AV";
  424. softwareList[107].filename = "sophosinstaller.exe";
  425. softwareList[107].description = L"Sophos Endpoint Security";
  426. softwareList[107].category = L"AV";
  427. softwareList[108].filename = "sophosmcsagentd.exe";
  428. softwareList[108].description = L"Sophos Endpoint Security";
  429. softwareList[108].category = L"AV";
  430. softwareList[109].filename = "sophosntivirus.exe";
  431. softwareList[109].description = L"Sophos Endpoint Security";
  432. softwareList[109].category = L"AV";
  433. softwareList[110].filename = "swdoctor.exe";
  434. softwareList[110].description = L"Spyware Doctor";
  435. softwareList[110].category = L"AV";
  436. softwareList[111].filename = "swupdate.exe";
  437. softwareList[111].description = L"Spyware Doctor";
  438. softwareList[111].category = L"AV";
  439. softwareList[112].filename = "symcorpui.exe";
  440. softwareList[112].description = L"Symantec Endpoint Protection";
  441. softwareList[112].category = L"AV";
  442. softwareList[113].filename = "symerr.exe";
  443. softwareList[113].description = L"Symantec Endpoint Protection";
  444. softwareList[113].category = L"AV";
  445. softwareList[114].filename = "symlcsvc.exe";
  446. softwareList[114].description = L"Symantec Endpoint Protection";
  447. softwareList[114].category = L"AV";
  448. softwareList[115].filename = "symwsc.exe";
  449. softwareList[115].description = L"Symantec Endpoint Protection";
  450. softwareList[115].category = L"AV";
  451. softwareList[116].filename = "tsmains.exe";
  452. softwareList[116].description = L"Tencent PC Manager";
  453. softwareList[116].category = L"AV";
  454. softwareList[117].filename = "tsvncache.exe";
  455. softwareList[117].description = L"Tencent PC Manager";
  456. softwareList[117].category = L"AV";
  457. softwareList[118].filename = "umbrella.exe";
  458. softwareList[118].description = L"Cisco Umbrella";
  459. softwareList[118].category = L"Security";
  460. softwareList[119].filename = "umbrella_roamingclient.exe";
  461. softwareList[119].description = L"Cisco Umbrella Roaming Client";
  462. softwareList[119].category = L"Security";
  463. softwareList[120].filename = "viprerestart.exe";
  464. softwareList[120].description = L"VIPRE Antivirus";
  465. softwareList[120].category = L"AV";
  466. softwareList[121].filename = "vpc.exe";
  467. softwareList[121].description = L"Virus Protection Center";
  468. softwareList[121].category = L"AV";
  469. softwareList[122].filename = "webinspect.exe";
  470. softwareList[122].description = L"HP WebInspect";
  471. softwareList[122].category = L"Security";
  472. softwareList[123].filename = "webrootsecureanywhere.exe";
  473. softwareList[123].description = L"Webroot SecureAnywhere";
  474. softwareList[123].category = L"AV";
  475. softwareList[124].filename = "wpctrl.exe";
  476. softwareList[124].description = L"Webroot Parental Controls";
  477. softwareList[124].category = L"Security";
  478. softwareList[125].filename = "wpff.exe";
  479. softwareList[125].description = L"Webroot Parental Controls";
  480. softwareList[125].category = L"Security";
  481. softwareList[126].filename = "wscsvc.exe";
  482. softwareList[126].description = L"Windows Security Center";
  483. softwareList[126].category = L"Security";
  484. softwareList[127].filename = "zanda.exe";
  485. softwareList[127].description = L"ZoneAlarm Antivirus";
  486. softwareList[127].category = L"AV";
  487. softwareList[128].filename = "zatutor.exe";
  488. softwareList[128].description = L"ZoneAlarm Antivirus";
  489. softwareList[128].category = L"AV";
  490. softwareList[129].filename = "zlclient.exe";
  491. softwareList[129].description = L"ZoneAlarm Security Suite";
  492. softwareList[129].category = L"AV";
  493. //End security product list
  494. //get handle to specified host
  495. handleHost = WTSAPI32$WTSOpenServerA(hostName);
  496. //get list of running processes
  497. if (!WTSAPI32$WTSEnumerateProcessesA(handleHost, 0, 1, &proc_info, &pi_count)) {
  498. BeaconPrintf(CALLBACK_ERROR, "Failed to get a valid handle to the specified host.\n");
  499. return -1;
  500. }
  501. if(pi_count == 0) {
  502. BeaconPrintf(CALLBACK_ERROR, "Couldn't list remote processes. Do you have enough privileges on the remote host?\n");
  503. return -1;
  504. }
  505. //compare list with running processes
  506. BeaconPrintToStreamW(L"Description\t\t\t\t\tCategory\n--------------------------------------------------------------\n");
  507. for (int i = 0 ; i < pi_count ; i++ ) {
  508. procName = proc_info[i].pProcessName;
  509. for (size_t i = 0; procName[i]; i++) {
  510. procName[i] = MSVCRT$tolower(procName[i]);
  511. }
  512. for (size_t i = 0; i < numSoftware; i++) {
  513. if (MSVCRT$strcmp(procName, softwareList[i].filename) == 0) {
  514. BeaconPrintToStreamW(L"%-50ls\t%ls\n", softwareList[i].description, softwareList[i].category);
  515. foundSecProduct = true;
  516. break;
  517. }
  518. }
  519. procName = NULL;
  520. }
  521. if (foundSecProduct) {
  522. BeaconOutputStreamW();
  523. BeaconPrintf(CALLBACK_OUTPUT, "[+] Finished enumerating.\n");
  524. } else {
  525. BeaconPrintf(CALLBACK_ERROR, "No running security processes were found.\n");
  526. }
  527. WTSAPI32$WTSCloseServer(handleHost);
  528. KERNEL32$VirtualFree(softwareList, 0, MEM_RELEASE);
  529. return 0;
  530. }