I am trying to get the security descriptor (or at least the DACL) of the IPC$ share. For other shares (such as C$, ADMIN$ and user-created shares), GetFileSecurity works (e.g. with "\localhost\C$"). With IPC$ neither that nor GetKernelObjectSecurity work, giving me an error 87 (The parameter is incorrect). I tried with different security information levels (owner, group, dacl and sacl all 4 together and each one alone individually), none worked for me. I also tried NetShareGetInfo with level 502, but it doesn't return any security descriptor (nor does it return one for C$ or ADMIN$, for example). Couldn't find anything on google either.
I'm using python 2.7 with pywin32. I would prefer a solution using API (WINAPI probably), but I would also accept a solution using another exe or command line tool (net.exe, WMI, powershell, etc.), as long as I can get the info programmatically.
Thanks!