Skip to content

Commit

Permalink
Restricted owner of the elevated process in TokenSwitchMode.
Browse files Browse the repository at this point in the history
  • Loading branch information
gerardog committed Feb 17, 2024
1 parent 854e834 commit b96792a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/gsudo/Helpers/ProcessFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ internal static void CreateProcessForTokenReplacement(string lpApplicationName,
tSec.nLength = Marshal.SizeOf(tSec);

// Set more restrictive Security Descriptor
string sddl = "D:(D;;GAFAWD;;;S-1-1-0)"; // Deny Generic-All, File-All, and Write-Dac to everyone.
string sddl = "O:0G:0D:(D;;GAFAWD;;;S-1-1-0)"; // Deny Generic-All, File-All, and Write-Dac to everyone.

IntPtr sd_ptr = new IntPtr();
UIntPtr sd_size_ptr = new UIntPtr();
Expand Down
2 changes: 1 addition & 1 deletion src/gsudo/Native/ProcessApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ protected override bool ReleaseHandle()

[DllImport("kernel32.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool DuplicateHandle(
internal static extern bool DuplicateHandle(
IntPtr hSourceProcessHandle,
IntPtr hSourceHandle,
IntPtr hTargetProcessHandle,
Expand Down

0 comments on commit b96792a

Please sign in to comment.