Advertisement
noisyboy25

SID description

Jul 4th, 2022
1,214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.55 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4.     "fmt"
  5.  
  6.     "github.com/hectane/go-acl/api"
  7.     "golang.org/x/sys/windows"
  8. )
  9.  
  10. func main() {
  11.     var (
  12.         owner   *windows.SID
  13.         secDesc windows.Handle
  14.     )
  15.  
  16.     err := api.GetNamedSecurityInfo(
  17.         ".\\go.mod",
  18.         api.SE_FILE_OBJECT,
  19.         api.OWNER_SECURITY_INFORMATION,
  20.         &owner,
  21.         nil,
  22.         nil,
  23.         nil,
  24.         &secDesc,
  25.     )
  26.     if err != nil {
  27.         panic(err)
  28.     }
  29.     a, d, t, err := owner.LookupAccount("")
  30.     if err != nil {
  31.         panic(err)
  32.     }
  33.  
  34.     fmt.Printf("account: %v\ndomain: %v\ntype: %v\n", a, d, t)
  35.  
  36.     defer windows.LocalFree(secDesc)
  37. }
  38.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement