Documentation ¶
Index ¶
- func Name() (string, error)
- func SID(proc ...windows.Handle) (string, error)
- func Whoami(proc ...windows.Handle) (string, error)
- func WhoamiAll(proc ...windows.Handle) (string, error)
- func WhoamiGroups(proc ...windows.Handle) (string, error)
- func WhoamiPriv(proc ...windows.Handle) (string, error)
- func WhoamiUser(proc ...windows.Handle) (string, error)
- type Group
- type ID
- type Privilege
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SID ¶
SID will return the SID of the user for the process token associated with the provided process handle. If no handle is provided, it defaults to the current process.
func Whoami ¶
Whoami will return output that very nearly (if not exactly) matches the "whoami.exe" output. If no process handle is provided, it defaults to the current process.
func WhoamiAll ¶ added in v0.15.2
WhoamiAll will return output that very nearly (if not exactly) matches the "whoami.exe /all" output. If no process handle is provided, it defaults to the current process.
func WhoamiGroups ¶ added in v0.15.2
WhoamiGroups will return output that very nearly (if not exactly) matches the "whoami.exe /groups" output. If no process handle is provided, it defaults to the current process.
func WhoamiPriv ¶ added in v0.15.2
WhoamiPriv will return output that very nearly (if not exactly) matches the "whoami.exe /priv" output. If no process handle is provided, it defaults to the current process.
Types ¶
type ID ¶
ID contains information about a Windows user.
func Identity ¶
Identity will return a pointer to a new ID instance containing the user information for the process token associated with the provided process handle. If no handle is provided, it defaults to the current process.
func (*ID) HasPrivilege ¶ added in v0.15.1
HasPrivilege will search the associated Privileges for one with the provided name. The returned bool should be checked before using the returned Privilege.
func (*ID) InGroup ¶ added in v0.15.1
InGroup will search the associated Groups for one with the provided name. The returned bool should be checked before using the returned Group.
func (*ID) Whoami ¶ added in v0.15.2
Whoami will return output that very nearly (if not exactly) matches the "whoami.exe" output.
func (*ID) WhoamiAll ¶ added in v0.15.2
WhoamiAll will return output that very nearly (if not exactly) matches the "whoami.exe /all" output.
func (*ID) WhoamiGroups ¶ added in v0.15.2
WhoamiGroups will return output that very nearly (if not exactly) matches the "whoami.exe /groups" output.
func (*ID) WhoamiPriv ¶ added in v0.15.2
WhoamiPriv will return output that very nearly (if not exactly) matches the "whoami.exe /priv" output.
func (*ID) WhoamiUser ¶ added in v0.15.2
WhoamiUser will return output that very nearly (if not exactly) matches the "whoami.exe /user" output.
type Privilege ¶ added in v0.14.0
type Privilege struct { Attributes uint32 Description string LUID windows.LUID Name string // contains filtered or unexported fields }
Privilege contains information about a Windows privilege.
func Privileges ¶ added in v0.14.0
Privileges returns an array of Privileges for the process token associated with the provided process handle. If no handle is provided, it defaults to the current process.
func (*Privilege) Disable ¶ added in v0.15.2
Disable will adjust token privileges to disable the Privilege.
func (*Privilege) Enable ¶ added in v0.15.2
Enable will adjust token privileges to enable the Privilege.
func (*Privilege) Enabled ¶ added in v0.15.0
Enabled will return whether or not the Privilege has been enabled.
func (*Privilege) EnabledByDefault ¶ added in v0.15.0
EnabledByDefault will return whether or not the Privilege is enabled by default.
func (*Privilege) Remove ¶ added in v0.19.0
Remove will adjust token privileges to remove the Privilege.
func (*Privilege) Removed ¶ added in v0.15.0
Removed will return whether or not the Privilege has been removed.
func (*Privilege) UsedForAccess ¶ added in v0.15.0
UsedForAccess will return whether or not the Privilege is used for access.