wintoken

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 28, 2022 License: MIT Imports: 5 Imported by: 3

README

wintoken

Windows Token Manipulation GOlang Library

Documentation

Index

Constants

View Source
const (
	PrivDisable privModType = iota
	PrivEnable
	PrivRemove
)
View Source
const (
	TokenUnknown tokenType = iota
	TokenPrimary
	TokenImpersonation
	TokenLinked
)
View Source
const (
	WTS_CURRENT_SERVER_HANDLE windows.Handle = 0
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Privilege

type Privilege struct {
	Name             string
	Description      string
	Enabled          bool
	EnabledByDefault bool
	Removed          bool
	UsedForAccess    bool
}

func (Privilege) String

func (p Privilege) String() string

type Token

type Token struct {
	Type tokenType
	// contains filtered or unexported fields
}

func GetInteractiveToken

func GetInteractiveToken(tokenType tokenType) (*Token, error)

func NewToken

func NewToken(token windows.Token, typ tokenType) *Token

func OpenProcessToken

func OpenProcessToken(pid int, tokenType tokenType) (*Token, error)

func (*Token) Close

func (t *Token) Close()

func (*Token) DisableAllPrivileges

func (t *Token) DisableAllPrivileges() error

func (*Token) DisableTokenPrivilege

func (t *Token) DisableTokenPrivilege(priv string) error

func (*Token) DisableTokenPrivileges

func (t *Token) DisableTokenPrivileges(privs []string) error

func (*Token) EnableAllPrivileges

func (t *Token) EnableAllPrivileges() error

func (*Token) EnableTokenPrivilege

func (t *Token) EnableTokenPrivilege(priv string) error

func (*Token) EnableTokenPrivileges

func (t *Token) EnableTokenPrivileges(privs []string) error

func (*Token) GetIntegrityLevel

func (t *Token) GetIntegrityLevel() (string, error)

func (*Token) GetLinkedToken

func (t *Token) GetLinkedToken() (*Token, error)

func (*Token) GetPrivileges

func (t *Token) GetPrivileges() ([]Privilege, error)

func (*Token) RemoveAllPrivileges

func (t *Token) RemoveAllPrivileges() error

func (*Token) RemoveTokenPrivilege

func (t *Token) RemoveTokenPrivilege(priv string) error

func (*Token) RemoveTokenPrivileges

func (t *Token) RemoveTokenPrivileges(privs []string) error

func (*Token) Token

func (t *Token) Token() windows.Token

func (*Token) UserDetails

func (t *Token) UserDetails() (TokenUserDetail, error)

type TokenUserDetail

type TokenUserDetail struct {
	Username       string
	Domain         string
	AccountType    uint32
	UserProfileDir string
	Environ        []string
}

func (TokenUserDetail) String

func (t TokenUserDetail) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL