Documentation
¶
Overview ¶
+build windows,amd64
+build windows,amd64
+build windows,amd64
+build windows,amd64
+build windows,amd64
+build windows,amd64
+build windows,amd64
+build windows,amd64
+build windows,amd64
Index ¶
- Constants
- func AddGroupMembership(username, groupname string) (bool, error)
- func ChangePassword(username string, password string) (bool, error)
- func ConvertWMITime(s string) (time.Time, error)
- func FirewallRuleCreate(name, description, group, appPath, port string, protocol uint) (bool, error)
- func FirewallRuleExistsByName(rules *ole.IDispatch, name string) (bool, error)
- func GetServices() ([]so.Service, error)
- func GetSystemProfile() (so.Hardware, so.OperatingSystem, so.Memory, []so.Disk, []so.Network, error)
- func InstalledSoftwareList() ([]so.Software, error)
- func IsDomainUserAdmin(username string, domain string) (bool, error)
- func IsLocalUserAdmin(username string) (bool, error)
- func ListLocalUsers() ([]so.LocalUser, error)
- func ListLoggedInUsers() ([]so.SessionDetails, error)
- func LsatoString(p LSA_UNICODE_STRING) string
- func ParseIPv4Mask(s string) net.IPMask
- func ProcessKill(pid uint32) (bool, error)
- func ProcessLUIDList() (map[uint32]SessionLUID, error)
- func ProcessList() ([]so.Process, error)
- func RemoveGroupMembership(username, groupname string) (bool, error)
- func RevokeAdmin(username string) (bool, error)
- func SetAdmin(username string) (bool, error)
- func StartService(name string) error
- func StopService(name string) error
- func UTF16toString(p *uint16) string
- func UpdatesPending() (*so.WindowsUpdate, error)
- func UserAdd(username string, fullname string, password string) (bool, error)
- func UserDelete(username string) (bool, error)
- func UserDisablePasswordChange(username string, disabled bool) (bool, error)
- func UserDisabled(username string, disable bool) (bool, error)
- func UserPasswordNoExpires(username string, noexpire bool) (bool, error)
- func UserUpdateFullname(username string, fullname string) (bool, error)
- type ENUM_SERVICE_STATUS_PROCESS
- type LOCALGROUP_MEMBERS_INFO_3
- type LSA_UNICODE_STRING
- type LUID
- type LUID_AND_ATTRIBUTES
- type PROCESSENTRY32
- type PSID
- type SECURITY_LOGON_SESSION_DATA
- type SERVICE_STATUS_PROCESS
- type SID_AND_ATTRIBUTES
- type SID_IDENTIFIER_AUTHORITY
- type SessionLUID
- type TOKEN_PRIVILEGES
- type TOKEN_STATISTICS
- type TOKEN_USER
- type USER_INFO_1
- type USER_INFO_1003
- type USER_INFO_1008
- type USER_INFO_1011
- type USER_INFO_2
Constants ¶
View Source
const ( NET_FW_IP_PROTOCOL_TCP = 6 NET_FW_ACTION_ALLOW = 1 )
View Source
const ( ERROR_NO_MORE_FILES = 0x12 PROCESS_TERMINATE = 0x0001 PROCESS_QUERY_INFORMATION = 0x0400 PROCESS_QUERY_LIMITED_INFORMATION = 0x1000 MAX_PATH = 260 MAX_FULL_PATH = 4096 PROC_TOKEN_DUPLICATE = 0x0002 PROC_TOKEN_QUERY = 0x0008 PROC_TOKEN_ADJUST_PRIVILEGES = 0x0020 PROC_SE_PRIVILEGE_ENABLED = 0x00000002 PROC_SE_DEBUG_NAME = "SeDebugPrivilege" PROC_SE_SYSTEM_ENVIRONMENT_PRIV = "SeSystemEnvironmentPrivilege" PROC_SECURITY_BUILTIN_DOMAIN_RID = 0x00000020 PROC_DOMAIN_ALIAS_RID_ADMINS = 0x00000220 PROC_ERROR_NO_SUCH_LOGON_SESSION = 1312 PROC_ERROR_PRIVILEGE_NOT_HELD = 1314 )
Some constants from the Windows API
View Source
const ( SVC_SC_ENUM_PROCESS_INFO = 0 SVC_SERVICE_WIN32 = 0x00000030 SVC_SERVICE_STATE_ALL = 0x00000003 SVC_SERVICE_ACCEPT_STOP = 0x00000001 )
View Source
const ( SESS_INTERACTIVE_LOGON = 2 SESS_REMOTE_INTERACTIVE_LOGON = 10 SESS_CACHED_INTERACTIVE_LOGON = 11 )
View Source
const ( NET_API_STATUS_NERR_Success = 0 NET_API_STATUS_NERR_InvalidComputer = 2351 NET_API_STATUS_NERR_NotPrimary = 2226 NET_API_STATUS_NERR_SpeGroupOp = 2234 NET_API_STATUS_NERR_LastAdmin = 2452 NET_API_STATUS_NERR_BadPassword = 2203 NET_API_STATUS_NERR_PasswordTooShort = 2245 NET_API_STATUS_NERR_UserNotFound = 2221 NET_API_STATUS_ERROR_ACCESS_DENIED = 5 NET_API_STATUS_ERROR_NOT_ENOUGH_MEMORY = 8 NET_API_STATUS_ERROR_INVALID_PARAMETER = 87 NET_API_STATUS_ERROR_INVALID_NAME = 123 NET_API_STATUS_ERROR_INVALID_LEVEL = 124 NET_API_STATUS_ERROR_MORE_DATA = 234 NET_API_STATUS_ERROR_SESSION_CREDENTIAL_CONFLICT = 1219 NET_API_STATUS_RPC_S_SERVER_UNAVAILABLE = 2147944122 NET_API_STATUS_RPC_E_REMOTE_DISABLED = 2147549468 USER_PRIV_MASK = 0x3 USER_PRIV_GUEST = 0 USER_PRIV_USER = 1 USER_PRIV_ADMIN = 2 USER_FILTER_NORMAL_ACCOUNT = 0x0002 USER_MAX_PREFERRED_LENGTH = 0xFFFFFFFF USER_UF_SCRIPT = 1 USER_UF_ACCOUNTDISABLE = 2 USER_UF_LOCKOUT = 16 USER_UF_PASSWD_CANT_CHANGE = 64 USER_UF_NORMAL_ACCOUNT = 512 USER_UF_DONT_EXPIRE_PASSWD = 65536 )
View Source
const (
ERROR_INVALID_FUNCTION = 1
)
Variables ¶
This section is empty.
Functions ¶
func AddGroupMembership ¶
func FirewallRuleCreate ¶
func GetServices ¶
func GetSystemProfile ¶
func InstalledSoftwareList ¶
func IsLocalUserAdmin ¶
func ListLocalUsers ¶
func ListLoggedInUsers ¶
func ListLoggedInUsers() ([]so.SessionDetails, error)
func LsatoString ¶
func LsatoString(p LSA_UNICODE_STRING) string
func ParseIPv4Mask ¶
func ProcessKill ¶
func ProcessLUIDList ¶
func ProcessLUIDList() (map[uint32]SessionLUID, error)
func ProcessList ¶
func RemoveGroupMembership ¶
func RevokeAdmin ¶
func StartService ¶
func StopService ¶
func UTF16toString ¶
func UpdatesPending ¶
func UpdatesPending() (*so.WindowsUpdate, error)
func UserDelete ¶
func UserPasswordNoExpires ¶
Types ¶
type ENUM_SERVICE_STATUS_PROCESS ¶
type ENUM_SERVICE_STATUS_PROCESS struct {
ServiceStatusProcess SERVICE_STATUS_PROCESS
// contains filtered or unexported fields
}
type LOCALGROUP_MEMBERS_INFO_3 ¶
type LOCALGROUP_MEMBERS_INFO_3 struct {
Lgrmi3_domainandname *uint16
}
type LSA_UNICODE_STRING ¶
type LUID_AND_ATTRIBUTES ¶
type PROCESSENTRY32 ¶
type PROCESSENTRY32 struct {
Size uint32
CntUsage uint32
ProcessID uint32
DefaultHeapID uintptr
ModuleID uint32
CntThreads uint32
ParentProcessID uint32
PriorityClassBase int32
Flags uint32
ExeFile [MAX_PATH]uint16
}
PROCESSENTRY32 is the Windows API structure that contains a process's information.
type SECURITY_LOGON_SESSION_DATA ¶
type SECURITY_LOGON_SESSION_DATA struct {
Size uint32
LogonId LUID
UserName LSA_UNICODE_STRING
LogonDomain LSA_UNICODE_STRING
AuthenticationPackage LSA_UNICODE_STRING
LogonType uint32
Session uint32
Sid uintptr
LogonTime uint64
LogonServer LSA_UNICODE_STRING
DnsDomainName LSA_UNICODE_STRING
Upn LSA_UNICODE_STRING
}
type SERVICE_STATUS_PROCESS ¶
type SERVICE_STATUS_PROCESS struct {
// contains filtered or unexported fields
}
type SID_AND_ATTRIBUTES ¶
type SID_IDENTIFIER_AUTHORITY ¶
type SID_IDENTIFIER_AUTHORITY struct {
Value [6]byte
}
type SessionLUID ¶
type TOKEN_PRIVILEGES ¶
type TOKEN_PRIVILEGES struct {
PrivilegeCount uint32
Privileges [1]LUID_AND_ATTRIBUTES
}
type TOKEN_STATISTICS ¶
type TOKEN_USER ¶
type TOKEN_USER struct {
User SID_AND_ATTRIBUTES
}
type USER_INFO_1 ¶
type USER_INFO_1003 ¶
type USER_INFO_1003 struct {
Usri1003_password *uint16
}
type USER_INFO_1008 ¶
type USER_INFO_1008 struct {
Usri1008_flags uint32
}
type USER_INFO_1011 ¶
type USER_INFO_1011 struct {
Usri1011_full_name *uint16
}
type USER_INFO_2 ¶
type USER_INFO_2 struct {
Usri2_name *uint16
Usri2_password *uint16
Usri2_password_age uint32
Usri2_priv uint32
Usri2_home_dir *uint16
Usri2_comment *uint16
Usri2_flags uint32
Usri2_script_path *uint16
Usri2_auth_flags uint32
Usri2_full_name *uint16
Usri2_usr_comment *uint16
Usri2_parms *uint16
Usri2_workstations *uint16
Usri2_last_logon uint32
Usri2_last_logoff uint32
Usri2_acct_expires uint32
Usri2_max_storage uint32
Usri2_units_per_week uint32
Usri2_logon_hours uintptr
Usri2_bad_pw_count uint32
Usri2_num_logons uint32
Usri2_logon_server *uint16
Usri2_country_code uint32
Usri2_code_page uint32
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.