ldap

package
v3.1.7 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: MIT, Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KerberoastableUser added in v3.1.6

type KerberoastableUser struct {
	SAMAccountName       string
	ServicePrincipalName string
	PWDLastSet           string
	MemberOf             string
	UserAccountControl   string
	LastLogon            string
}

KerberoastableUser contains the important fields of the Active Directory kerberoastable user

type LDAPMetadata

type LDAPMetadata struct {
	BaseDN                        string
	Domain                        string
	DefaultNamingContext          string
	DomainFunctionality           string
	ForestFunctionality           string
	DomainControllerFunctionality string
	DnsHostName                   string
}

LDAPMetadata is the metadata for ldap server.

type LdapClient

type LdapClient struct{}

Client is a client for ldap protocol in golang.

It is a wrapper around the standard library ldap package.

func (*LdapClient) CollectLdapMetadata

func (c *LdapClient) CollectLdapMetadata(domain string, controller string) (LDAPMetadata, error)

CollectLdapMetadata collects metadata from ldap server.

func (*LdapClient) GetKerberoastableUsers added in v3.1.6

func (c *LdapClient) GetKerberoastableUsers(domain, controller string, username, password string) ([]KerberoastableUser, error)

GetKerberoastableUsers collects all "person" users that have an SPN associated with them. The LDAP filter is built with the same logic as "GetUserSPNs.py", the well-known impacket example by Forta. https://github.com/fortra/impacket/blob/master/examples/GetUserSPNs.py#L297

Returns a list of KerberoastableUser, if an error occurs, returns an empty slice and the raised error

func (*LdapClient) IsLdap

func (c *LdapClient) IsLdap(host string, port int) (bool, error)

IsLdap checks if the given host and port are running ldap server.

Jump to

Keyboard shortcuts

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