winlsa

package module
v0.0.0-...-2c123da Latest Latest
Warning

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

Go to latest
Published: May 1, 2022 License: MIT Imports: 7 Imported by: 0

README

winlsa

A Go package for interacting with Windows' Local Security Authority.

Currently supports enumerating and detailing local logon sessions.

Documentation

See pkg.go.dev

A simple usage example can be found in the cmd\demo directory.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LUID

type LUID = lsa.LUID

A LUID is a locally unique identifier guaranteed to be unique on the operating system that generated it until the system is restarted.

In the context of winlsa, it is a session identifier.

func GetLogonSessions

func GetLogonSessions() ([]LUID, error)

type LogonSessionData

type LogonSessionData struct {
	UserName                                   string
	LogonDomain                                string
	AuthenticationPackage                      string
	LogonType                                  LogonType
	Session                                    uint32
	Sid                                        *windows.SID
	LogonTime                                  time.Time
	LogonServer                                string
	DnsDomainName                              string
	Upn                                        string
	UserFlags                                  uint32
	LastSuccessfulLogon                        time.Time
	LastFailedLogon                            time.Time
	FailedAttemptCountSinceLastSuccessfulLogon uint32
	LogonScript                                string
	ProfilePath                                string
	HomeDirectory                              string
	HomeDirectoryDrive                         string
	LogoffTime                                 time.Time
	KickOffTime                                time.Time
	PasswordLastSet                            time.Time
	PasswordCanChange                          time.Time
	PasswordMustChange                         time.Time
}

func GetLogonSessionData

func GetLogonSessionData(luid *LUID) (*LogonSessionData, error)

type LogonType

type LogonType uint32
const (
	// Not explicitly defined in LSA, but according to
	// https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-logonsession,
	// LogonType=0 is "Used only by the System account."
	LogonTypeSystem LogonType = iota

	LogonTypeInteractive
	LogonTypeNetwork
	LogonTypeBatch
	LogonTypeService
	LogonTypeProxy
	LogonTypeUnlock
	LogonTypeNetworkCleartext
	LogonTypeNewCredentials
	LogonTypeRemoteInteractive
	LogonTypeCachedInteractive
	LogonTypeCachedRemoteInteractive
	LogonTypeCachedUnlock
)

func (LogonType) String

func (lt LogonType) String() string

Directories

Path Synopsis
cmd
internal
lsa

Jump to

Keyboard shortcuts

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