mirror of
https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite.git
synced 2026-01-02 21:09:03 +00:00
- exception handling for LsaRegisterLogonProcessHelper
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.ExceptionServices;
|
||||
using winPEAS.Helpers;
|
||||
using winPEAS.Native;
|
||||
|
||||
@@ -7,6 +8,7 @@ namespace winPEAS.KnownFileCreds.Kerberos
|
||||
{
|
||||
static class Helpers
|
||||
{
|
||||
[HandleProcessCorruptedStateExceptions]
|
||||
public static IntPtr LsaRegisterLogonProcessHelper()
|
||||
{
|
||||
// helper that establishes a connection to the LSA server and verifies that the caller is a logon application
|
||||
@@ -21,7 +23,13 @@ namespace winPEAS.KnownFileCreds.Kerberos
|
||||
LSAString.MaximumLength = (ushort)(logonProcessName.Length + 1);
|
||||
LSAString.Buffer = logonProcessName;
|
||||
|
||||
int ret = Secur32.LsaRegisterLogonProcess(LSAString, out lsaHandle, out securityMode);
|
||||
try
|
||||
{
|
||||
int ret = Secur32.LsaRegisterLogonProcess(LSAString, out lsaHandle, out securityMode);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
}
|
||||
|
||||
return lsaHandle;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user