engine

package
v0.0.0-...-f1573f2 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: AGPL-3.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UAC_SCRIPT                         = 0x0001
	UAC_ACCOUNTDISABLE                 = 0x0002
	UAC_HOMEDIR_REQUIRED               = 0x0008
	UAC_LOCKOUT                        = 0x0010
	UAC_PASSWD_NOTREQD                 = 0x0020
	UAC_PASSWD_CANT_CHANGE             = 0x0040
	UAC_ENCRYPTED_TEXT_PWD_ALLOWED     = 0x0080
	UAC_TEMP_DUPLICATE_ACCOUNT         = 0x0100
	UAC_NORMAL_ACCOUNT                 = 0x0200
	UAC_INTERDOMAIN_TRUST_ACCOUNT      = 0x0800
	UAC_WORKSTATION_TRUST_ACCOUNT      = 0x1000
	UAC_SERVER_TRUST_ACCOUNT           = 0x2000
	UAC_DONT_EXPIRE_PASSWORD           = 0x10000
	UAC_MNS_LOGON_ACCOUNT              = 0x20000
	UAC_SMARTCARD_REQUIRED             = 0x40000
	UAC_TRUSTED_FOR_DELEGATION         = 0x80000
	UAC_NOT_DELEGATED                  = 0x100000
	UAC_USE_DES_KEY_ONLY               = 0x200000
	UAC_DONT_REQ_PREAUTH               = 0x400000
	UAC_PASSWORD_EXPIRED               = 0x800000
	UAC_TRUSTED_TO_AUTH_FOR_DELEGATION = 0x1000000
	UAC_PARTIAL_SECRETS_ACCOUNT        = 0x04000000

	RIGHT_GENERIC_READ Mask = RIGHT_READ_CONTROL | RIGHT_DS_LIST_CONTENTS | RIGHT_DS_READ_PROPERTY | RIGHT_DS_LIST_OBJECT /*
		** Mask value is not stored in AD but deduced from mask bits combined **
		RIGHT_GENERIC_READ = 0x80000000 /*
			The right to read permissions and all properties of the object, and list the contents of the
			object in the case of containers.

			Equivalent to:RIGHT_READ_CONTROL | RIGHT_DS_LIST_CONTENTS | RIGHT_DS_READ_PROPERTY | RIGHT_DS_LIST_OBJECT */

	RIGHT_GENERIC_WRITE = RIGHT_READ_CONTROL | RIGHT_DS_WRITE_PROPERTY | RIGHT_DS_WRITE_PROPERTY_EXTENDED /*
		** Mask value is not stored in AD but deduced from mask bits combined **
		RIGHT_GENERIC_WRITE = 0x40000000 /*
			Includes the right to read permissions on the object, and the right to write all the properties
			on the object.

			Equivalent to: RIGHT_READ_CONTROL | RIGHT_DS_WRITE_PROPERTY | RIGHT_DS_WRITE_PROPERTY_EXTENDED */

	RIGHT_GENERIC_EXECUTE = RIGHT_READ_CONTROL | RIGHT_DS_LIST_CONTENTS /*
		** Mask value is not stored in AD but deduced from mask bits combined **
		RIGHT_GENERIC_EXECUTE = 0x20000000 /*
			The right to read permissions/list the contents of a container object.

			Equivalent to: RIGHT_READ_CONTROL | RIGHT_DS_LIST_CONTENTS */
	RIGHT_GENERIC_ALL = RIGHT_DELETE | RIGHT_READ_CONTROL | RIGHT_WRITE_DACL | RIGHT_WRITE_OWNER | RIGHT_DS_CREATE_CHILD | RIGHT_DS_DELETE_CHILD | RIGHT_DS_DELETE_TREE | RIGHT_DS_READ_PROPERTY | RIGHT_DS_WRITE_PROPERTY | RIGHT_DS_LIST_CONTENTS | RIGHT_DS_LIST_OBJECT | RIGHT_DS_CONTROL_ACCESS | RIGHT_DS_WRITE_PROPERTY_EXTENDED /*
		** Mask value is not stored in AD but deduced from mask bits combined **
		RIGHT_GENERIC_ALL = 0x10000000 /*
			The right to create/delete child objects, read/write all properties, see any child objects, add and remove the object,
			and read/write with an extended right.

			Equivalent to: RIGHT_DELETE |  RIGHT_READ_CONTROL | RIGHT_WRITE_DACL | RIGHT_WRITE_OWNER | RIGHT_DS_CREATE_CHILD | RIGHT_DS_DELETE_CHILD | RIGHT_DS_DELETE_TREE | RIGHT_DS_READ_PROPERTY | RIGHT_DS_WRITE_PROPERTY | RIGHT_DS_LIST_CONTENTS | RIGHT_DS_LIST_OBJECT | RIGHT_DS_CONTROL_ACCESS | RIGHT_DS_WRITE_PROPERTY_EXTENDED)
	*/

	RIGHT_SYNCRONIZE  = 0x00100000
	RIGHT_WRITE_OWNER = 0x00080000 /*
		The right to modify the owner section of the security descriptor. Of note, a user with this right can only change the owner to themselves
		-ownership cannot be transferred to other userswith only this right.*/
	RIGHT_WRITE_DACL = 0x00040000 /*
		The right to modify the DACL for the object. */
	RIGHT_READ_CONTROL = 0x00020000 /*
		The right to read alldata from the security descriptor except the SACL. */
	RIGHT_DELETE = 0x00010000 /*
		The right to delete the object. */

	RIGHT_DS_VOODOO_BIT = 0x00001000 /* No clue - see https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-crtd/4be42fa6-c421-4763-890b-07a9ab5a319d for second option */

	RIGHT_DS_CONTROL_ACCESS = 0x00000100 /*
		A specific control access right (if the ObjectType GUID refers to an extended right registered in the forest schema)
		or the right to read a confidential property (if the ObjectType GUID refers to a confidential property).
		If the GUID is not present, then all extended rights are granted */
	RIGHT_DS_LIST_OBJECT = 0x00000080 /*
		The right to list an object. If the user does not have this right and also doesn’t have the
		RIGHT_DS_LIST_CONTENTS right on the object's parent container then the object is hidden from the user. */
	RIGHT_DS_DELETE_TREE = 0x00000040 /*
		The right to perform a delete-tree operation. */
	RIGHT_DS_WRITE_PROPERTY = 0x00000020 /*
		The right to write one or more properties of the object specified by the ObjectType GUID.
		If the ObjectType GUID is not present or is all 0s, then the right to write all properties is granted. */
	RIGHT_DS_READ_PROPERTY = 0x00000010 /*
		The right to read one or more properties of the object specified by the ObjectType GUID.
		If the ObjectType GUID is not present or is all 0s, then the right to read all properties is granted.	*/
	RIGHT_DS_WRITE_PROPERTY_EXTENDED = 0x00000008 /*
		The right to execute a validated write access right. AKA DsSelf */
	RIGHT_DS_LIST_CONTENTS = 0x00000004 /*
		The right to list all child objects of the object, if the object is a type of container. */
	RIGHT_DS_DELETE_CHILD = 0x00000002 /*
		The right to delete child objects of the object, if the object is a type of container.
		If the ObjectType contains a GUID, the GUID will reference the type of child object that can be deleted. */
	RIGHT_DS_CREATE_CHILD = 0x00000001 /*
		The right to create child objects under the object, if the object is a type of container.
		If the ObjectType contains a GUID, the GUID will reference the type of child object that can be created. */

)
View Source
const (
	CONTROLFLAG_OWNER_DEFAULTED     SecurityDescriptorControlFlag = 0x0001
	CONTROLFLAG_GROUP_DEFAULTED     SecurityDescriptorControlFlag = 0x0002
	CONTROLFLAG_DACL_PRESENT        SecurityDescriptorControlFlag = 0x0004
	CONTROLFLAG_DACL_DEFAULTED      SecurityDescriptorControlFlag = 0x0008
	CONTROLFLAG_SACL_PRESENT        SecurityDescriptorControlFlag = 0x0010
	CONTROLFLAG_SACL_DEFAULTED      SecurityDescriptorControlFlag = 0x0020
	CONTROLFLAG_DACL_AUTO_INHERITED SecurityDescriptorControlFlag = 0x0400
	CONTROLFLAG_SACL_AUTO_INHERITED SecurityDescriptorControlFlag = 0x0800
	CONTROLFLAG_DACL_PROTECTED      SecurityDescriptorControlFlag = 0x1000
	CONTROLFLAG_SACL_PROTECTED      SecurityDescriptorControlFlag = 0x2000
	CONTROLFLAG_SELF_RELATIVE       SecurityDescriptorControlFlag = 0x8000

	// ACE.Type
	ACETYPE_ACCESS_ALLOWED        ACEType = 0x00
	ACETYPE_ACCESS_DENIED         ACEType = 0x01
	ACETYPE_ACCESS_ALLOWED_OBJECT ACEType = 0x05
	ACETYPE_ACCESS_DENIED_OBJECT  ACEType = 0x06

	// ACE.ACEFlags
	ACEFLAG_OBJECT_INHERIT_ACE       ACEFlags = 0x01 // Noncontainer child objects inherit the ACE as an effective ACE. For child objects that are containers, the ACE is inherited as an inherit-only ACE unless the NO_PROPAGATE_INHERIT_ACE bit flag is also set
	ACEFLAG_INHERIT_ACE              ACEFlags = 0x02 // Child objects that are containers, such as directories, inherit the ACE as an effective ACE. The inherited ACE is inheritable unless the NO_PROPAGATE_INHERIT_ACE bit flag is also set.
	ACEFLAG_NO_PROPAGATE_INHERIT_ACE ACEFlags = 0x04 // If the ACE is inherited by a child object, the system clears the OBJECT_INHERIT_ACE and CONTAINER_INHERIT_ACE flags in the inherited ACE. This prevents the ACE from being inherited by subsequent generations of objects.
	ACEFLAG_INHERIT_ONLY_ACE         ACEFlags = 0x08 // Indicates an inherit-only ACE, which does not control access to the object to which it is attached. If this flag is not set, the ACE is an effective ACE that controls access to the object to which it is attached. Both effective and inherit-only ACEs can be inherited depending on the state of the other inheritance flags.
	ACEFLAG_INHERITED_ACE            ACEFlags = 0x10 // Indicates that the ACE was inherited. The system sets this bit when it propagates an inherited ACE to a child object
	ACEFLAG_UNKNOWN                  ACEFlags = 0x20 // Unknown
	ACEFLAG_AUDIT_SUCCESS_ACCESS     ACEFlags = 0x40 // Audit successfull access
	ACEFLAG_AUDIT_FAILED_ACCESS      ACEFlags = 0x80 // Audit failed access

	// ACE.Flags - present if this is a ACETYPE_ACCESS_*_OBJECT Type
	OBJECT_TYPE_PRESENT           Flags = 0x01
	INHERITED_OBJECT_TYPE_PRESENT Flags = 0x02

	RIGHT_MAXIMUM_ALLOWED = 0x02000000 /* Not stored in AD, just for requests */

	RIGHT_ACCESS_SYSTEM_SECURITY = 0x01000000 /* Not stored in AD, just for requests */

	// REGISTRY PERMISSIONS MASK
	KEY_ALL_ACCESS         = 0xF003F
	KEY_READ               = 0x20019
	KEY_WRITE              = 0x20006
	KEY_EXECUTE            = 0x20019
	KEY_CREATE_SUB_KEYS    = 0x0004
	KEY_ENUMERATE_SUB_KEYS = 0x0008
	KEY_NOTIFY             = 0x0010
	KEY_QUERY_VALUE        = 0x0001
	KEY_SET_VALUE          = 0x0002

	FILE_READ_DATA        = 0x00000001 // Grants the right to read data from the file.
	FILE_LIST_DIRECTORY   = 0x00000001 // Grants the right to read data from the file. For a directory, this value grants the right to list the contents of the directory.
	FILE_WRITE_DATA       = 0x00000002 // Grants the right to write data to the file.
	FILE_ADD_FILE         = 0x00000002 // Grants the right to write data to the file. For a directory, this value grants the right to create a file in the directory.
	FILE_APPEND_DATA      = 0x00000004 // Grants the right to append data to the file. For a directory, this value grants the right to create a subdirectory.
	FILE_ADD_SUBDIRECTORY = 0x00000004 // Grants the right to append data to the file. For a directory, this value grants the right to create a subdirectory.
	FILE_READ_EA          = 0x00000008 // Grants the right to read extended attributes.
	FILE_WRITE_EA         = 0x00000010 // Grants the right to write extended attributes.
	FILE_EXECUTE          = 0x00000020 // Grants the right to execute a file.
	FILE_TRAVERSE         = 0x00000020 // Grants the right to execute a file. For a directory, the directory can be traversed.
	FILE_DELETE_CHILD     = 0x00000040 // Grants the right to delete a directory and all the files it contains (its children), even if the files are read-only.
	FILE_READ_ATTRIBUTES  = 0x00000080 // Grants the right to read file attributes.
	FILE_WRITE_ATTRIBUTES = 0x00000100 // Grants the right to change file attributes.
	DELETE                = 0x00010000 // Grants the right to delete the object.
	READ_CONTROL          = 0x00020000 // Grants the right to read the information in the security descriptor for the object, not including the information in the SACL.
	WRITE_DAC             = 0x00040000 // Grants the right to modify the DACL in the object security descriptor for the object.
	WRITE_OWNER           = 0x00080000 // Grants the right to change the owner in the security descriptor for the object.
	SYNCHRONIZE           = 0x00100000
)
View Source
const MAXEDGEPOSSIBLE = PMBSIZE * 64
View Source
const PMBSIZE = 3

Increas this when we run out of space

Variables

View Source
var (
	NonExistingAttribute = ^Attribute(0)

	DistinguishedName     = NewAttribute("distinguishedName").Single().Unique()
	ObjectClass           = NewAttribute("objectClass")
	ObjectCategory        = NewAttribute("objectCategory").Single()
	Type                  = NewAttribute("type").Single()
	Name                  = NewAttribute("name").Single()
	DisplayName           = NewAttribute("displayName").Single()
	LDAPDisplayName       = NewAttribute("lDAPDisplayName").Single()
	Description           = NewAttribute("description")
	SAMAccountName        = NewAttribute("sAMAccountName").Single()
	ObjectSid             = NewAttribute("objectSid").Single() // Single, but not unique! Strange yes, but in the final results there are multiple objects with the same SID
	ObjectGUID            = NewAttribute("objectGUID").Single().Merge().Unique()
	NTSecurityDescriptor  = NewAttribute("nTSecurityDescriptor").Single()
	SchemaIDGUID          = NewAttribute("schemaIDGUID")
	RightsGUID            = NewAttribute("rightsGUID")
	AttributeSecurityGUID = NewAttribute("attributeSecurityGUID")

	WhenChanged = NewAttribute("whenChanged").Type(AttributeTypeTime) // Not replicated, so we're not marking it as "single"

	WhenCreated = NewAttribute("whenCreated").Single().Type(AttributeTypeTime)

	ObjectClassGUIDs       = NewAttribute("objectClassGUID")    // Used for caching the GUIDs, should belong in AD analyzer, but it's used in the SecurityDescritor mapping, so we're cheating a bit
	ObjectCategoryGUID     = NewAttribute("objectCategoryGUID") // Used for caching the GUIDs
	IsCriticalSystemObject = NewAttribute("isCriticalSystemObject")

	DataLoader = NewAttribute("dataLoader").SetDescription("Where did data in this object come from")
	DataSource = NewAttribute("dataSource").SetDescription("Data from different sources are never merged together")

	IPAddress          = NewAttribute("IPAddress")
	DownLevelLogonName = NewAttribute("downLevelLogonName").Merge()
	UserPrincipalName  = NewAttribute("userPrincipalName").Merge()
	NetbiosDomain      = NewAttribute("netbiosDomain").Single() // Used to merge users with - if we only have a DOMAIN\USER type of info
	DomainContext      = NewAttribute("domainContext").Single()

	Tag = NewAttribute("tag")
)
View Source
var (
	NonExistingEdge = Edge(10000)
	AnyEdgeType     = Edge(9999)
)
View Source
var (
	NonExistingObjectType                = ^ObjectType(0)
	ObjectTypeOther                      = NewObjectType("Other", "")
	ObjectTypeCallableServicePoint       = NewObjectType("CallableService", "Callable-Service-Point")
	ObjectTypeDomainDNS                  = NewObjectType("DomainDNS", "Domain-DNS")
	ObjectTypeDNSNode                    = NewObjectType("DNSNode", "Dns-Node").SetDefault(Last, false)
	ObjectTypeDNSZone                    = NewObjectType("DNSZone", "Dns-Zone").SetDefault(Last, false)
	ObjectTypeUser                       = NewObjectType("User", "Person")
	ObjectTypeGroup                      = NewObjectType("Group", "Group")
	ObjectTypeGroupManagedServiceAccount = NewObjectType("GroupManagedServiceAccount", "ms-DS-Group-Managed-Service-Account")
	ObjectTypeManagedServiceAccount      = NewObjectType("ManagedServiceAccount", "ms-DS-Managed-Service-Account")
	ObjectTypeOrganizationalUnit         = NewObjectType("OrganizationalUnit", "Organizational-Unit").SetDefault(Last, false)
	ObjectTypeBuiltinDomain              = NewObjectType("BuiltinDomain", "Builtin-Domain")
	ObjectTypeContainer                  = NewObjectType("Container", "Container").SetDefault(Last, false)
	ObjectTypeComputer                   = NewObjectType("Computer", "Computer")
	ObjectTypeMachine                    = NewObjectType("Machine", "Machine")
	ObjectTypeGroupPolicyContainer       = NewObjectType("GroupPolicyContainer", "Group-Policy-Container")
	ObjectTypeTrust                      = NewObjectType("Trust", "Trusted-Domain")
	ObjectTypeAttributeSchema            = NewObjectType("AttributeSchema", "Attribute-Schema")
	ObjectTypeClassSchema                = NewObjectType("ClassSchema", "Class-Schema")
	ObjectTypeControlAccessRight         = NewObjectType("ControlAccessRight", "Control-Access-Right")
	ObjectTypeCertificateTemplate        = NewObjectType("CertificateTemplate", "PKI-Certificate-Template")
	ObjectTypePKIEnrollmentService       = NewObjectType("PKIEnrollmentService", "PKI-Enrollment-Service")
	ObjectTypeCertificationAuthority     = NewObjectType("CertificationAuthority", "Certification-Authority")
	ObjectTypeForeignSecurityPrincipal   = NewObjectType("ForeignSecurityPrincipal", "Foreign-Security-Principal")
	ObjectTypeService                    = NewObjectType("Service", "Service").SetDefault(Last, false)
	ObjectTypeExecutable                 = NewObjectType("Executable", "Executable").SetDefault(Last, false)
	ObjectTypeDirectory                  = NewObjectType("Directory", "Directory").SetDefault(Last, false)
	ObjectTypeFile                       = NewObjectType("File", "File").SetDefault(Last, false)
)
View Source
var EdgePopularity [MAXEDGEPOSSIBLE]uint64
View Source
var ErrDontMerge = errors.New("Dont merge objects using any methods")
View Source
var ErrEmptySecurityDescriptorAttribute = errors.New("empty nTSecurityDescriptor attribute!?")
View Source
var ErrMergeOnThis = errors.New("Merge on this attribute")
View Source
var ErrNoSecurityDescriptor = errors.New("no security desciptor")
View Source
var (
	ErrUninterested = errors.New("plugin is not interested in this file, try harder")
)
View Source
var ExtendedRightCertificateAutoEnroll, _ = uuid.FromString("a05b8cc2-17bc-4802-a710-e7c15ab866a2")
View Source
var ExtendedRightCertificateEnroll, _ = uuid.FromString("0e10c968-78fb-11d2-90d4-00c04f79dc55")
View Source
var IgnoreBlanks = "_IGNOREBLANKS_"
View Source
var RememberedObjects, NukedObjects uint64
View Source
var UnknownGUID = uuid.UUID{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}

Functions

func AddMergeApprover

func AddMergeApprover(name string, mf mergefunc)

func AttributeInfos

func AttributeInfos() []attributeinfo

func CompareAttributeValues

func CompareAttributeValues(a, b AttributeValue) bool

func DedupValues

func DedupValues(enable bool)

func EdgeInfos

func EdgeInfos() []edgeInfo

func Load

func Load(loaders []Loader, path string, cb ProgressCallbackFunc) ([]loaderobjects, error)

Load runs all registered loaders

func ObjectTypes

func ObjectTypes() []objecttypeinfo

func Process

func Process(ao *Objects, statustext string, l LoaderID, priority ProcessPriority) error

LoaderID = wildcard

func ProcessPriorityStrings

func ProcessPriorityStrings() []string

ProcessPriorityStrings returns a slice of all String values of the enum

Types

type ACE

type ACE struct {
	SID windowssecurity.SID

	Type     ACEType
	Flags    Flags
	ACEFlags ACEFlags

	Mask Mask

	ObjectType          uuid.UUID
	InheritedObjectType uuid.UUID
}

func ParseACLentry

func ParseACLentry(odata []byte) (ACE, []byte, error)

func (ACE) SortVal

func (a ACE) SortVal() byte

func (ACE) String

func (a ACE) String(ao *Objects) string

func (ACE) StringNoLookup

func (a ACE) StringNoLookup() string

type ACEFlags

type ACEFlags byte

type ACEType

type ACEType byte

type ACL

type ACL struct {
	Entries  []ACE
	Revision byte

	HadSortingProblem bool
	// contains filtered or unexported fields
}

func ParseACL

func ParseACL(data []byte) (ACL, error)

func ParseSDDL

func ParseSDDL(sddl string) (ACL, error)

func (ACL) IsObjectClassAccessAllowed

func (a ACL) IsObjectClassAccessAllowed(index int, testObject *Object, mask Mask, guid uuid.UUID, ao *Objects) bool

func (*ACL) IsSortedCorrectly

func (a *ACL) IsSortedCorrectly() bool

func (*ACL) Sort

func (a *ACL) Sort()

func (ACL) String

func (a ACL) String(ao *Objects) string

func (ACL) StringNoLookup

func (a ACL) StringNoLookup() string

type Attribute

type Attribute uint16

func A

func A(name string) Attribute

func Attributes

func Attributes() []Attribute

func LookupAttribute

func LookupAttribute(name string) Attribute

func NewAttribute

func NewAttribute(name string) Attribute

func (Attribute) Hidden

func (a Attribute) Hidden() Attribute

func (Attribute) IsHidden

func (a Attribute) IsHidden() bool

func (Attribute) IsMeta

func (a Attribute) IsMeta() bool

func (Attribute) IsNonUnique

func (a Attribute) IsNonUnique() bool

func (Attribute) IsSingle

func (a Attribute) IsSingle() bool

func (Attribute) IsUnique

func (a Attribute) IsUnique() bool

func (Attribute) Merge

func (a Attribute) Merge() Attribute

func (Attribute) OnGet

func (a Attribute) OnGet(onget AttributeGetFunc) Attribute

func (Attribute) OnSet

func (a Attribute) OnSet(onset AttributeSetFunc) Attribute

func (Attribute) SetDescription

func (a Attribute) SetDescription(t string) Attribute

func (Attribute) Single

func (a Attribute) Single() Attribute

func (Attribute) String

func (a Attribute) String() string

func (Attribute) Tag

func (a Attribute) Tag(t string) Attribute

func (Attribute) Type

func (a Attribute) Type(t AttributeType) Attribute

func (Attribute) Unique

func (a Attribute) Unique() Attribute

type AttributeAndValues

type AttributeAndValues struct {
	// contains filtered or unexported fields
}

type AttributeGetFunc

type AttributeGetFunc func(o *Object, a Attribute) (v AttributeValues, found bool)

type AttributePair

type AttributePair struct {
	// contains filtered or unexported fields
}

type AttributeSetFunc

type AttributeSetFunc func(o *Object, a Attribute, v AttributeValues) error

type AttributeType

type AttributeType uint8
const (
	AttributeTypeUnknown AttributeType = iota
	AttributeTypeString
	AttributeTypeInt
	AttributeTypeFloat
	AttributeTypeBool
	AttributeTypeTime
	AttributeTypeTime100NS
	AttributeTypeSID
	AttributeTypeGUID
	AttributeTypeBlob
	AttributeTypeSecurityDescriptor
)

type AttributeValue

type AttributeValue interface {
	String() string
	Raw() any
	IsZero() bool
}

func AttributeValueToIndex

func AttributeValueToIndex(value AttributeValue) AttributeValue

type AttributeValueBlob

type AttributeValueBlob string

func (AttributeValueBlob) IsZero

func (ab AttributeValueBlob) IsZero() bool

func (AttributeValueBlob) Raw

func (ab AttributeValueBlob) Raw() any

func (AttributeValueBlob) String

func (ab AttributeValueBlob) String() string

type AttributeValueBool

type AttributeValueBool bool

func (AttributeValueBool) IsZero

func (ab AttributeValueBool) IsZero() bool

func (AttributeValueBool) Raw

func (ab AttributeValueBool) Raw() any

func (AttributeValueBool) String

func (ab AttributeValueBool) String() string

type AttributeValueGUID

type AttributeValueGUID uuid.UUID

func (AttributeValueGUID) IsZero

func (as AttributeValueGUID) IsZero() bool

func (AttributeValueGUID) Raw

func (as AttributeValueGUID) Raw() any

func (AttributeValueGUID) String

func (as AttributeValueGUID) String() string

type AttributeValueInt

type AttributeValueInt int64

func (AttributeValueInt) IsZero

func (as AttributeValueInt) IsZero() bool

func (AttributeValueInt) Raw

func (as AttributeValueInt) Raw() any

func (AttributeValueInt) String

func (as AttributeValueInt) String() string

type AttributeValueMap

type AttributeValueMap struct {
	// contains filtered or unexported fields
}

func (*AttributeValueMap) Clear

func (avm *AttributeValueMap) Clear(a Attribute)

func (*AttributeValueMap) Get

func (avm *AttributeValueMap) Get(a Attribute) (av AttributeValues, found bool)

func (*AttributeValueMap) Iterate

func (avm *AttributeValueMap) Iterate(f func(attr Attribute, values AttributeValues) bool)

func (*AttributeValueMap) Len

func (avm *AttributeValueMap) Len() int

func (*AttributeValueMap) Set

type AttributeValueObject

type AttributeValueObject struct {
	*Object
}

func (AttributeValueObject) IsZero

func (avo AttributeValueObject) IsZero() bool

func (AttributeValueObject) Raw

func (avo AttributeValueObject) Raw() any

func (AttributeValueObject) String

func (avo AttributeValueObject) String() string

type AttributeValueOne

type AttributeValueOne struct {
	Value AttributeValue
}

func (AttributeValueOne) First

func (avo AttributeValueOne) First() AttributeValue

func (AttributeValueOne) Iterate

func (avo AttributeValueOne) Iterate(it func(val AttributeValue) bool)

func (AttributeValueOne) Len

func (avo AttributeValueOne) Len() int

func (AttributeValueOne) StringSlice

func (avo AttributeValueOne) StringSlice() []string

type AttributeValuePair

type AttributeValuePair struct {
	Value1 AttributeValue
	Value2 AttributeValue
}

type AttributeValueSID

type AttributeValueSID windowssecurity.SID

func (AttributeValueSID) IsZero

func (as AttributeValueSID) IsZero() bool

func (AttributeValueSID) Raw

func (as AttributeValueSID) Raw() any

func (AttributeValueSID) String

func (as AttributeValueSID) String() string

type AttributeValueSecurityDescriptor

type AttributeValueSecurityDescriptor struct {
	SD *SecurityDescriptor
}

func (AttributeValueSecurityDescriptor) IsZero

func (AttributeValueSecurityDescriptor) Raw

func (AttributeValueSecurityDescriptor) String

type AttributeValueSlice

type AttributeValueSlice []AttributeValue

func (AttributeValueSlice) First

func (avs AttributeValueSlice) First() AttributeValue

func (AttributeValueSlice) Iterate

func (avs AttributeValueSlice) Iterate(it func(val AttributeValue) bool)

func (AttributeValueSlice) Len

func (avs AttributeValueSlice) Len() int

func (AttributeValueSlice) StringSlice

func (avs AttributeValueSlice) StringSlice() []string

type AttributeValueString

type AttributeValueString string

func (AttributeValueString) IsZero

func (as AttributeValueString) IsZero() bool

func (AttributeValueString) Raw

func (as AttributeValueString) Raw() any

func (AttributeValueString) String

func (as AttributeValueString) String() string

type AttributeValueTime

type AttributeValueTime time.Time

func (AttributeValueTime) IsZero

func (as AttributeValueTime) IsZero() bool

func (AttributeValueTime) Raw

func (as AttributeValueTime) Raw() any

func (AttributeValueTime) String

func (as AttributeValueTime) String() string

type AttributeValues

type AttributeValues interface {
	First() AttributeValue
	Iterate(func(val AttributeValue) bool)
	StringSlice() []string
	Len() int
}

AttributeValues can contain one or more values

func MergeValues

func MergeValues(v1, v2 AttributeValues) AttributeValues

type AttributeValuesEvaluator

type AttributeValuesEvaluator struct {
	// contains filtered or unexported fields
}

func (AttributeValuesEvaluator) Compare

func (AttributeValuesEvaluator) Equal

func (AttributeValuesEvaluator) LessThan

type Connection

type Connection struct {
	// contains filtered or unexported fields
}

func (Connection) Compare

func (c Connection) Compare(c2 Connection) int

func (Connection) LessThan

func (c Connection) LessThan(c2 Connection) bool

type Edge

type Edge int

func Edges

func Edges() []Edge

func LookupEdge

func LookupEdge(name string) Edge

func NewEdge

func NewEdge(name string) Edge

func (Edge) DefaultF

func (p Edge) DefaultF() bool

func (Edge) DefaultL

func (p Edge) DefaultL() bool

func (Edge) DefaultM

func (p Edge) DefaultM() bool

func (Edge) Describe

func (pm Edge) Describe(description string) Edge

func (Edge) HasTag

func (p Edge) HasTag(t string) bool

func (Edge) Hidden

func (p Edge) Hidden() Edge

func (Edge) IsHidden

func (p Edge) IsHidden() bool

func (Edge) Probability

func (pm Edge) Probability(source, target *Object) Probability

func (Edge) RegisterProbabilityCalculator

func (pm Edge) RegisterProbabilityCalculator(doCalc ProbabilityCalculatorFunction) Edge

func (Edge) SetDefault

func (p Edge) SetDefault(f, m, l bool) Edge

func (Edge) String

func (p Edge) String() string

func (Edge) Tag

func (p Edge) Tag(t string) Edge

type EdgeAnalyzer

type EdgeAnalyzer struct {
	ObjectAnalyzer func(o *Object, ao *Objects)
	Description    string
}

EdgeAnalyzer takes an Object, examines it an outputs a list of Objects that can Pwn it

type EdgeBitmap

type EdgeBitmap [PMBSIZE]uint64
var AllEdgesBitmap EdgeBitmap

func (*EdgeBitmap) AtomicAnd

func (eb *EdgeBitmap) AtomicAnd(edges EdgeBitmap)

func (*EdgeBitmap) AtomicClear

func (eb *EdgeBitmap) AtomicClear(edge Edge)

func (*EdgeBitmap) AtomicOr

func (eb *EdgeBitmap) AtomicOr(edges EdgeBitmap)

func (*EdgeBitmap) AtomicSet

func (eb *EdgeBitmap) AtomicSet(edge Edge)

func (EdgeBitmap) Clear

func (eb EdgeBitmap) Clear(edge Edge) EdgeBitmap

func (EdgeBitmap) Count

func (eb EdgeBitmap) Count() int

func (EdgeBitmap) Edges

func (eb EdgeBitmap) Edges() []Edge

func (EdgeBitmap) Intersect

func (eb EdgeBitmap) Intersect(edges EdgeBitmap) EdgeBitmap

func (EdgeBitmap) Invert

func (eb EdgeBitmap) Invert() EdgeBitmap

func (EdgeBitmap) IsBlank

func (eb EdgeBitmap) IsBlank() bool

func (EdgeBitmap) IsSet

func (m EdgeBitmap) IsSet(edge Edge) bool

func (EdgeBitmap) JoinedString

func (m EdgeBitmap) JoinedString() string

func (EdgeBitmap) MaxProbability

func (m EdgeBitmap) MaxProbability(source, target *Object) Probability

func (EdgeBitmap) Merge

func (eb EdgeBitmap) Merge(edges EdgeBitmap) EdgeBitmap

func (EdgeBitmap) Set

func (eb EdgeBitmap) Set(edge Edge) EdgeBitmap

func (EdgeBitmap) StringSlice

func (m EdgeBitmap) StringSlice() []string

type EdgeConnections

type EdgeConnections struct {
	// contains filtered or unexported fields
}

func (*EdgeConnections) Len

func (ec *EdgeConnections) Len() int

func (*EdgeConnections) Objects

func (ec *EdgeConnections) Objects() ObjectSlice

func (*EdgeConnections) Range

func (ec *EdgeConnections) Range(rf func(*Object, EdgeBitmap) bool)

Thread safe range

func (*EdgeConnections) RangeID

func (ec *EdgeConnections) RangeID(rf func(ObjectID, EdgeBitmap) bool)

func (*EdgeConnections) StringMap

func (ec *EdgeConnections) StringMap() map[string]string

type EdgeConnectionsPlus

type EdgeConnectionsPlus struct {
	gonk.Gonk[Connection]
}

func (*EdgeConnectionsPlus) Range

func (ecp *EdgeConnectionsPlus) Range(rf func(o *Object, eb EdgeBitmap) bool)

type EdgeDirection

type EdgeDirection int
const (
	Out EdgeDirection = 0
	In  EdgeDirection = 1
)

type Flags

type Flags uint32

type Index

type Index struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*Index) Add

func (i *Index) Add(key AttributeValue, o *Object, undupe bool)

func (*Index) Iterate

func (i *Index) Iterate(each func(key AttributeValue, objects ObjectSlice) bool)

func (*Index) Lookup

func (i *Index) Lookup(key AttributeValue) (ObjectSlice, bool)

type Loader

type Loader interface {
	Name() string

	// Init is called before any loads are done
	Init() error

	// Load will be offered a file, and can either return UnininterestedError, nil or any error it
	// wishes. UninterestedError will pass the file to the next loader, Nil means it accepted and processed the file,
	// and any other error will stop processing the file and display an error
	Load(path string, cb ProgressCallbackFunc) error

	// Close signals that no more files are coming
	Close() ([]*Objects, error)
}

type LoaderEstimator

type LoaderEstimator interface {
	Estimate(path string, cb ProgressCallbackFunc) error
}

type LoaderGenerator

type LoaderGenerator func() Loader

type LoaderID

type LoaderID int

func AddLoader

func AddLoader(lg LoaderGenerator) LoaderID

func (LoaderID) AddProcessor

func (l LoaderID) AddProcessor(pf ProcessorFunc, description string, priority ProcessPriority)

type Mask

type Mask uint32

type MultiIndex

type MultiIndex struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*MultiIndex) Add

func (i *MultiIndex) Add(key, key2 AttributeValue, o *Object, undupe bool)

func (*MultiIndex) Iterate

func (i *MultiIndex) Iterate(each func(key, key2 AttributeValue, objects ObjectSlice) bool)

func (*MultiIndex) Lookup

func (i *MultiIndex) Lookup(key, key2 AttributeValue) (ObjectSlice, bool)

type NoValues

type NoValues struct{}

func (NoValues) First

func (nv NoValues) First() AttributeValue

func (NoValues) Iterate

func (nv NoValues) Iterate(func(val AttributeValue) bool)

func (NoValues) Len

func (nv NoValues) Len() int

func (NoValues) Slice

func (nv NoValues) Slice() []AttributeValue

func (NoValues) StringSlice

func (nv NoValues) StringSlice() []string

type Object

type Object struct {
	// contains filtered or unexported fields
}

func NewObject

func NewObject(flexinit ...any) *Object

func NewPreload

func NewPreload(preloadAttributes int) *Object

func StandardMerge

func StandardMerge(attr Attribute, a, b *Object) (*Object, error)

func (*Object) Absorb

func (o *Object) Absorb(source *Object)

func (*Object) AbsorbEx

func (target *Object) AbsorbEx(source *Object, fast bool)

Absorbs data and Pwn relationships from another object, sucking the soul out of it The sources empty shell should be discarded afterwards (i.e. not appear in an Objects collection)

func (*Object) Adopt

func (o *Object) Adopt(child *Object)

func (*Object) Attr

func (o *Object) Attr(attr Attribute) AttributeValues

Returns synthetic blank attribute value if it isn't set

func (*Object) AttrBool

func (o *Object) AttrBool(attr Attribute) (bool, bool)

func (*Object) AttrInt

func (o *Object) AttrInt(attr Attribute) (int64, bool)

func (*Object) AttrIterator

func (o *Object) AttrIterator(f func(attr Attribute, avs AttributeValues) bool)

func (*Object) AttrRendered

func (o *Object) AttrRendered(attr Attribute) AttributeValues

func (*Object) AttrString

func (o *Object) AttrString(attr Attribute) []string

func (*Object) AttrTime

func (o *Object) AttrTime(attr Attribute) (time.Time, bool)

func (*Object) ChildOf

func (o *Object) ChildOf(parent *Object)

func (*Object) Children

func (o *Object) Children() ObjectSlice

func (*Object) Clear

func (o *Object) Clear(a Attribute)

func (*Object) DN

func (o *Object) DN() string

func (*Object) EdgeClear

func (o *Object) EdgeClear(target *Object, edge Edge)

Register that this object can pwn another object using the given method

func (*Object) EdgeIteratorRecursive

func (o *Object) EdgeIteratorRecursive(direction EdgeDirection, edgeMatch EdgeBitmap, excludemyself bool, af func(source, target *Object, edge EdgeBitmap, depth int) bool)

func (*Object) EdgeTo

func (o *Object) EdgeTo(target *Object, edge Edge)

Register that this object can pwn another object using the given method

func (*Object) EdgeToEx

func (o *Object) EdgeToEx(target *Object, edge Edge, force bool)

Enhanched Pwns function that allows us to force the pwn (normally self-pwns are filtered out)

func (*Object) Edges

func (o *Object) Edges(direction EdgeDirection) *EdgeConnectionsPlus

func (*Object) Get

func (o *Object) Get(attr Attribute) (AttributeValues, bool)

Auto locking version

func (*Object) HasAttr

func (o *Object) HasAttr(attr Attribute) bool

func (*Object) HasAttrValue

func (o *Object) HasAttrValue(attr Attribute, hasvalue AttributeValue) bool

func (*Object) HasTag

func (o *Object) HasTag(v AttributeValueString) bool

FIXME performance optimization/redesign needed, but needs to work with Objects indexes

func (*Object) ID

func (o *Object) ID() ObjectID

func (*Object) IDString

func (o *Object) IDString() string

func (*Object) IsValid

func (o *Object) IsValid() bool

func (*Object) Label

func (o *Object) Label() string

func (*Object) MarshalJSON

func (o *Object) MarshalJSON() ([]byte, error)

func (*Object) MarshalXML

func (o *Object) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*Object) Meta

func (o *Object) Meta() map[string]string

func (*Object) NameStringMap

func (o *Object) NameStringMap() StringMap

func (*Object) ObjectCategoryGUID

func (o *Object) ObjectCategoryGUID(ao *Objects) uuid.UUID

func (*Object) OneAttr

func (o *Object) OneAttr(attr Attribute) AttributeValue

func (*Object) OneAttrRaw

func (o *Object) OneAttrRaw(attr Attribute) any

func (*Object) OneAttrRendered

func (o *Object) OneAttrRendered(attr Attribute) string

func (*Object) OneAttrString

func (o *Object) OneAttrString(attr Attribute) string

func (*Object) Parent

func (o *Object) Parent() *Object

func (*Object) PrimaryID

func (o *Object) PrimaryID() (Attribute, AttributeValue)

func (*Object) SID

func (o *Object) SID() windowssecurity.SID

Return the object's SID

func (*Object) SecurityDescriptor

func (o *Object) SecurityDescriptor() (*SecurityDescriptor, error)

Return parsed security descriptor

func (*Object) Set

func (o *Object) Set(a Attribute, values AttributeValues)

func (*Object) SetFlex

func (o *Object) SetFlex(flexinit ...any)

func (*Object) SetValues

func (o *Object) SetValues(a Attribute, values ...AttributeValue)

Wrapper for Set - easier to call

func (*Object) String

func (o *Object) String() string

func (*Object) StringACL

func (o *Object) StringACL(ao *Objects) string

func (*Object) Tag

func (o *Object) Tag(v AttributeValueString)

func (*Object) Type

func (o *Object) Type() ObjectType

func (*Object) ValueMap

func (o *Object) ValueMap() map[string][]string

Dump the object to simple map type for debugging

type ObjectEdge

type ObjectEdge struct {
	// contains filtered or unexported fields
}

type ObjectID

type ObjectID uint32

type ObjectSlice

type ObjectSlice struct {
	// contains filtered or unexported fields
}

func NewObjectSlice

func NewObjectSlice(prealloc int) ObjectSlice

func (*ObjectSlice) Add

func (os *ObjectSlice) Add(o *Object)

func (ObjectSlice) First

func (os ObjectSlice) First() *Object

func (ObjectSlice) Iterate

func (os ObjectSlice) Iterate(af func(o *Object) bool)

func (ObjectSlice) Len

func (os ObjectSlice) Len() int

func (*ObjectSlice) Limit

func (os *ObjectSlice) Limit(count int)

func (*ObjectSlice) Remove

func (os *ObjectSlice) Remove(o *Object)

func (*ObjectSlice) Skip

func (os *ObjectSlice) Skip(count int)

func (*ObjectSlice) Sort

func (os *ObjectSlice) Sort(attr Attribute, reverse bool)

func (*ObjectSlice) SortFunc

func (os *ObjectSlice) SortFunc(lessthan func(o, o2 *Object) bool)

type ObjectType

type ObjectType byte

func NewObjectType

func NewObjectType(name, lookup string) ObjectType

func ObjectTypeLookup

func ObjectTypeLookup(lookup string) (ObjectType, bool)

func (ObjectType) Lookup

func (ot ObjectType) Lookup() string

func (ObjectType) SetDefault

func (ot ObjectType) SetDefault(p PriorityFML, enabled bool) ObjectType

func (ObjectType) String

func (ot ObjectType) String() string

func (ObjectType) ValueString

func (ot ObjectType) ValueString() AttributeValueString

type Objects

type Objects struct {
	Datapath string

	DefaultValues []any
	// contains filtered or unexported fields
}

func Merge

func Merge(aos []*Objects) (*Objects, error)

func NewLoaderObjects

func NewLoaderObjects(ld Loader) *Objects

func NewObjects

func NewObjects() *Objects

func Run

func Run(path string) (*Objects, error)

Loads, processes and merges everything. It's magic, just in code

func (*Objects) Add

func (os *Objects) Add(obs ...*Object)

func (*Objects) AddDefaultFlex

func (os *Objects) AddDefaultFlex(data ...any)

func (*Objects) AddMerge

func (os *Objects) AddMerge(attrtomerge []Attribute, obs ...*Object)

func (*Objects) AddNew

func (os *Objects) AddNew(flexinit ...any) *Object

func (*Objects) AddRelaxed

func (os *Objects) AddRelaxed(o *Object)

func (*Objects) AsSlice

func (os *Objects) AsSlice() ObjectSlice

func (*Objects) Contains

func (os *Objects) Contains(o *Object) bool

func (*Objects) DistinguishedParent

func (os *Objects) DistinguishedParent(o *Object) (*Object, bool)

func (*Objects) DropIndex

func (os *Objects) DropIndex(attribute Attribute)

func (*Objects) DropIndexes

func (os *Objects) DropIndexes()

func (*Objects) Filter

func (os *Objects) Filter(evaluate func(o *Object) bool) *Objects

func (*Objects) Find

func (os *Objects) Find(attribute Attribute, value AttributeValue) (o *Object, found bool)

func (*Objects) FindGUID

func (os *Objects) FindGUID(g uuid.UUID) (o *Object, found bool)

func (*Objects) FindID

func (os *Objects) FindID(id ObjectID) (*Object, bool)

func (*Objects) FindMulti

func (os *Objects) FindMulti(attribute Attribute, value AttributeValue) (ObjectSlice, bool)

func (*Objects) FindMultiOrAdd

func (os *Objects) FindMultiOrAdd(attribute Attribute, value AttributeValue, addifnotfound func() *Object) (ObjectSlice, bool)

func (*Objects) FindOrAdd

func (os *Objects) FindOrAdd(attribute Attribute, value AttributeValue, flexinit ...any) (*Object, bool)

func (*Objects) FindOrAddAdjacentSID

func (os *Objects) FindOrAddAdjacentSID(s windowssecurity.SID, r *Object, flexinit ...any) *Object

func (*Objects) FindOrAddAdjacentSIDFound

func (os *Objects) FindOrAddAdjacentSIDFound(s windowssecurity.SID, r *Object, flexinit ...any) (*Object, bool)

func (*Objects) FindOrAddObject

func (os *Objects) FindOrAddObject(o *Object) bool

func (*Objects) FindOrAddSID

func (os *Objects) FindOrAddSID(s windowssecurity.SID) *Object

func (*Objects) FindTwo

func (os *Objects) FindTwo(attribute Attribute, value AttributeValue, attribute2 Attribute, value2 AttributeValue) (o *Object, found bool)

func (*Objects) FindTwoMulti

func (os *Objects) FindTwoMulti(attribute Attribute, value AttributeValue, attribute2 Attribute, value2 AttributeValue) (o ObjectSlice, found bool)

func (*Objects) FindTwoMultiOrAdd

func (os *Objects) FindTwoMultiOrAdd(attribute Attribute, value AttributeValue, attribute2 Attribute, value2 AttributeValue, addifnotfound func() *Object) (ObjectSlice, bool)

func (*Objects) FindTwoOrAdd

func (os *Objects) FindTwoOrAdd(attribute Attribute, value AttributeValue, attribute2 Attribute, value2 AttributeValue, flexinit ...any) (o *Object, found bool)

func (*Objects) GetIndex

func (os *Objects) GetIndex(attribute Attribute) *Index

func (*Objects) GetMultiIndex

func (os *Objects) GetMultiIndex(attribute, attribute2 Attribute) *MultiIndex

func (*Objects) Iterate

func (os *Objects) Iterate(each func(o *Object) bool)

func (*Objects) IterateID

func (os *Objects) IterateID(each func(id ObjectID) bool)

func (*Objects) IterateParallel

func (os *Objects) IterateParallel(each func(o *Object) bool, parallelFuncs int)

func (*Objects) Len

func (os *Objects) Len() int

func (*Objects) Merge

func (os *Objects) Merge(attrtomerge []Attribute, source *Object) bool

Attemps to merge the object into the objects

func (*Objects) MergeOrAdd

func (os *Objects) MergeOrAdd(attribute Attribute, value AttributeValue, flexinit ...any) (*Object, bool)

func (*Objects) ReindexObject

func (os *Objects) ReindexObject(o *Object, isnew bool)

func (*Objects) Root

func (os *Objects) Root() *Object

First object added is the root object

func (*Objects) SetRoot

func (os *Objects) SetRoot(ro *Object)

func (*Objects) Statistics

func (os *Objects) Statistics() typestatistics

func (*Objects) Subordinates

func (os *Objects) Subordinates(o *Object) *Objects

type PriorityFML

type PriorityFML byte
const (
	First PriorityFML = iota
	Middle
	Last
)

type Probability

type Probability int8
const (
	MINPROBABILITY Probability = -1
	MAXPROBABILITY Probability = 100
)

type ProbabilityCalculatorFunction

type ProbabilityCalculatorFunction func(source, target *Object) Probability

type ProcessPriority

type ProcessPriority int
const (
	BeforeMergeLow ProcessPriority = iota
	BeforeMerge
	BeforeMergeHigh
	BeforeMergeFinal
	AfterMergeLow
	AfterMerge
	AfterMergeHigh
	AfterMergeFinal
)

func ProcessPriorityString

func ProcessPriorityString(s string) (ProcessPriority, error)

ProcessPriorityString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func ProcessPriorityValues

func ProcessPriorityValues() []ProcessPriority

ProcessPriorityValues returns all values of the enum

func (ProcessPriority) IsAProcessPriority

func (i ProcessPriority) IsAProcessPriority() bool

IsAProcessPriority returns "true" if the value is listed in the enum definition. "false" otherwise

func (ProcessPriority) String

func (i ProcessPriority) String() string

type ProcessorFunc

type ProcessorFunc func(ao *Objects)

type ProgressCallbackFunc

type ProgressCallbackFunc func(progress int, totalprogress int)

type SecurityDescriptor

type SecurityDescriptor struct {
	Owner   windowssecurity.SID
	Group   windowssecurity.SID
	SACL    ACL
	DACL    ACL
	Control SecurityDescriptorControlFlag
}

func CacheOrParseSecurityDescriptor

func CacheOrParseSecurityDescriptor(rawsd []byte) (*SecurityDescriptor, error)

Parse and cache security descriptor

func ParseSecurityDescriptor

func ParseSecurityDescriptor(data []byte) (SecurityDescriptor, error)

func (*SecurityDescriptor) Equals

func (sd *SecurityDescriptor) Equals(sd2 *SecurityDescriptor) bool

func (SecurityDescriptor) String

func (sd SecurityDescriptor) String(ao *Objects) string

func (SecurityDescriptor) StringNoLookup

func (sd SecurityDescriptor) StringNoLookup() string

type SecurityDescriptorControlFlag

type SecurityDescriptorControlFlag uint16

type StringMap

type StringMap map[string][]string

func (StringMap) MarshalXML

func (s StringMap) MarshalXML(e *xml.Encoder, start xml.StartElement) error

Jump to

Keyboard shortcuts

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