public static void FindServices(object state) { FindServiceDescriptor findServiceDescriptor = (FindServiceDescriptor)state; try { if (String.IsNullOrEmpty(findServiceDescriptor.Rapid7Path)) { Console.WriteLine("Loading ZMAP {0}-Banner results...", findServiceDescriptor.Name); ZmapResults mapResults = new ZmapResults(findServiceDescriptor.ZmapResultsPath, HostList); Console.WriteLine("Found Dutch {0} hosts with {1}.", mapResults.Addresses.Length, findServiceDescriptor.Name); Console.WriteLine("Fetching banners for Dutch {0} hosts...", findServiceDescriptor.Name); ZgrabResults grabResults = new ZgrabResults(findServiceDescriptor.Port, findServiceDescriptor.Name, findServiceDescriptor.ZgrabResultsPath, mapResults.Addresses); } else { Console.WriteLine("Loading {0}-Rapid7 results...", findServiceDescriptor.Name); Rapid7Results results = new Rapid7Results(findServiceDescriptor.Name, findServiceDescriptor.Rapid7Path, HostList); } } catch (Exception e) { Console.WriteLine("An exception occurred while finding services: {0}.", e.ToString()); } finally { Console.WriteLine("{0} is done.", findServiceDescriptor.Name); findServiceDescriptor.WaitHandle.Set(); } }