mirror of
https://github.com/peass-ng/PEASS-ng.git
synced 2026-07-30 23:50:27 -07:00
Fix SOAP service enumeration yield in try/catch
This commit is contained in:
@@ -112,6 +112,7 @@ namespace winPEAS.Info.ApplicationInfo
|
|||||||
|
|
||||||
private static IEnumerable<SoapClientProxyCandidate> EnumerateServiceCandidates()
|
private static IEnumerable<SoapClientProxyCandidate> EnumerateServiceCandidates()
|
||||||
{
|
{
|
||||||
|
var results = new List<SoapClientProxyCandidate>();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (var searcher = new ManagementObjectSearcher(@"root\\cimv2", "SELECT Name, DisplayName, PathName, StartName FROM Win32_Service"))
|
using (var searcher = new ManagementObjectSearcher(@"root\\cimv2", "SELECT Name, DisplayName, PathName, StartName FROM Win32_Service"))
|
||||||
@@ -127,14 +128,14 @@ namespace winPEAS.Info.ApplicationInfo
|
|||||||
if (!IsDotNetBinary(binaryPath))
|
if (!IsDotNetBinary(binaryPath))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
yield return new SoapClientProxyCandidate
|
results.Add(new SoapClientProxyCandidate
|
||||||
{
|
{
|
||||||
BinaryPath = binaryPath,
|
BinaryPath = binaryPath,
|
||||||
SourceType = "Service",
|
SourceType = "Service",
|
||||||
Name = service["Name"]?.ToString() ?? string.Empty,
|
Name = service["Name"]?.ToString() ?? string.Empty,
|
||||||
Account = service["StartName"]?.ToString() ?? string.Empty,
|
Account = service["StartName"]?.ToString() ?? string.Empty,
|
||||||
Extra = service["DisplayName"]?.ToString() ?? string.Empty,
|
Extra = service["DisplayName"]?.ToString() ?? string.Empty,
|
||||||
};
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -142,6 +143,8 @@ namespace winPEAS.Info.ApplicationInfo
|
|||||||
{
|
{
|
||||||
Beaprint.GrayPrint("Error while enumerating services for SOAP client analysis: " + ex.Message);
|
Beaprint.GrayPrint("Error while enumerating services for SOAP client analysis: " + ex.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static IEnumerable<SoapClientProxyCandidate> EnumerateProcessCandidates()
|
private static IEnumerable<SoapClientProxyCandidate> EnumerateProcessCandidates()
|
||||||
|
|||||||
Reference in New Issue
Block a user