Closed g3rzi closed 1 year ago
We were able to find the problem.
I debugged the project and changed the CreateObject
to public so I can debug it.
I called it like that:
NtObjectManager.Cmdlets.Object.GetNtFileCmdlet a = new NtObjectManager.Cmdlets.Object.GetNtFileCmdlet();
using (ObjectAttributes obj_attributes = new ObjectAttributes(@"\Device\NamedPipe\myPipe"))
{
a.CreateObject(obj_attributes);
}
I saw the default values:
After I changed them to:
Access = FileAccessRights.MaximumAllowed;
ShareMode = FileShareMode.None;
Options = FileOpenOptions.None;
It works fine :)
Hi James,
I am creating the following dummy named pipe without Dacl in Powershell:
When I run the PowerShell
GetNtFile
, everything works fine:But when I am trying to use the C# parallel function (
NtFile.Open()
) like that:I am getting an exception:
I also tried to run it with admin permissions with no success.
I used
Get-NtFile
with standard permissions (not admin) and it worked, and I used the same user with the C# function, so I am not sure why it doesn't work.Maybe my
FileAccessRights
is wrong?I tried to follow the source code but didn't see the use of the default permissions:
https://github.com/googleprojectzero/sandbox-attacksurface-analysis-tools/blob/c02ed8ba04324e54a0a188ab9877ee6aa372dfac/NtObjectManager/Cmdlets/Object/NewNtFileCmdlet.cs#L98-L120