Documentation
¶
Overview ¶
Package auth provides authentication methods for NullFang
Package auth provides authentication methods for NullFang
Index ¶
- Variables
- func GenerateNTHash(password string) (string, error)
- func GetSPNForHost(service, host string) string
- func ParseHashString(hashStr string) (string, string, string, error)
- func ValidateNTLMHash(hash string) (string, string, error)
- type AuthMethod
- type AuthType
- type Credentials
- type KerberosAuth
- type NTLMAuth
- type Option
- func WithDebug(debug bool) Option
- func WithKDCHost(kdcHost string) Option
- func WithKerberosPassword(password string) Option
- func WithKeytabFile(keytabFile string) Option
- func WithPort(port int) Option
- func WithRealm(realm string) Option
- func WithSPN(spn string) Option
- func WithServer(server string) Option
- func WithTicketFile(ticketFile string) Option
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidHash = errors.New("invalid hash format") ErrAuthenticationFailed = errors.New("authentication failed") ErrUnsupportedMethod = errors.New("unsupported authentication method") ErrMissingCredentials = errors.New("missing required credentials") )
Common errors
Functions ¶
func GenerateNTHash ¶
GenerateNTHash generates an NT hash from a password
func GetSPNForHost ¶
GetSPNForHost generates a Service Principal Name for a host
func ParseHashString ¶
ParseHashString parses a hash string in various formats
Types ¶
type AuthMethod ¶
type AuthMethod interface {
// GetCredentials retorna as credenciais formatadas para o método específico
GetCredentials() (*Credentials, error)
// GetName retorna o nome do método de autenticação
GetName() string
}
AuthMethod é a interface que todos os métodos de autenticação devem implementar
func NewAuthMethod ¶
func NewAuthMethod(authType AuthType, params map[string]string) (AuthMethod, error)
NewAuthMethod creates a new authentication method
func NewKerberosAuth ¶
func NewKerberosAuth(domain, username string, options ...Option) AuthMethod
NewKerberosAuth creates a new Kerberos authenticator
type Credentials ¶
type Credentials struct {
Username string
Password string
Domain string
Hash string
Ticket []byte
Method string
HashType string
SessionKey []byte
}
Credentials contém as informações de autenticação
type KerberosAuth ¶
type KerberosAuth struct {
Ticket []byte
TicketPath string
// contains filtered or unexported fields
}
KerberosAuth implements Kerberos authentication
func (*KerberosAuth) Authenticate ¶
func (a *KerberosAuth) Authenticate() (*Credentials, error)
Authenticate performs the authentication and returns credentials that can be used with SMB
func (*KerberosAuth) GetCredentials ¶
func (k *KerberosAuth) GetCredentials() (*Credentials, error)
func (*KerberosAuth) GetName ¶
func (k *KerberosAuth) GetName() string
func (*KerberosAuth) Type ¶
func (a *KerberosAuth) Type() string
Type returns the authentication method type
type NTLMAuth ¶
NTLMAuth implements NTLM hash authentication
func NewNTLMAuth ¶
NewNTLMAuth creates a new NTLM hash authenticator
func (*NTLMAuth) GetCredentials ¶
func (n *NTLMAuth) GetCredentials() (*Credentials, error)
GetCredentials returns the credentials formatted for the specific method
type Option ¶
type Option func(interface{})
Option represents an option for authentication methods
func WithKerberosPassword ¶
WithKerberosPassword sets the password for Kerberos authentication
func WithKeytabFile ¶
WithKeytabFile sets the Kerberos keytab file
func WithTicketFile ¶
WithTicketFile sets the Kerberos ticket file (ccache)