ntlmssp

package module
v0.0.0-...-9db15b0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: BSD-3-Clause Imports: 20 Imported by: 0

README

ntlmssp

=======

Fork of https://github.com/bodgit/ntlmssp

Changes

  • Fixed incorrect size calculation just prior to wrap() function.
  • Added PassTheHash capability for authentication.
  • Added RoundTrip to http.Client.

Documentation

Index

Constants

View Source
const (
	DefaultClientCompatibilityLevel lmCompatibilityLevel = 3
)
View Source
const (
	// NTLMSSPRevisionW2K3 is the current revision of NTLM.
	NTLMSSPRevisionW2K3 uint8 = 0x0f
)
View Source
const (
	// TLSServerEndPoint is defined in RFC 5929 and stores the hash of the server certificate.
	TLSServerEndPoint string = "tls-server-end-point"
)

Variables

View Source
var (
	ErrChecksumMismatch = errors.New("checksum does not match")
	ErrSeqNumMismatch   = errors.New("sequence number does not match")
)

Functions

func DefaultDomain

func DefaultDomain() (string, error)

DefaultDomain returns the Windows domain that the host is joined to. This will never be successful on non-Windows as there's no standard API.

func DefaultWorkstation

func DefaultWorkstation() (string, error)

DefaultWorkstation returns the current workstation name.

func SetCompatibilityLevel

func SetCompatibilityLevel(level lmCompatibilityLevel) func(*Client) error

func SetDomain

func SetDomain(domain string) func(*Client) error

func SetUserInfo

func SetUserInfo(username, password string, nthash []byte) func(*Client) error

func SetVersion

func SetVersion(version *Version) func(*Client) error

func SetWorkstation

func SetWorkstation(workstation string) func(*Client) error

Types

type ChannelBindings

type ChannelBindings struct {
	InitiatorAddrtype uint32
	InitiatorAddress  []uint8
	AcceptorAddrtype  uint32
	AcceptorAddress   []uint8
	ApplicationData   []uint8
}

ChannelBindings models the GSS-API channel bindings defined in RFC 2744.

type Client

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

func NewClient

func NewClient(options ...func(*Client) error) (*Client, error)

func (*Client) Authenticate

func (c *Client) Authenticate(input []byte, bindings *ChannelBindings) ([]byte, error)

func (*Client) Complete

func (c *Client) Complete() bool

func (*Client) Reset

func (c *Client) Reset()

add Reset() method that clears only session state, not credentials/config:

  • Zero out: complete, securitySession, negotiateMessage, challengeMessage, negotiatedFlags
  • Leave untouched: username, password, domain, workstation, defaultFlags, version, compatibilityLevel

func (*Client) SecuritySession

func (c *Client) SecuritySession() *SecuritySession

func (*Client) SetOption

func (c *Client) SetOption(options ...func(*Client) error) error

type SecuritySession

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

func (*SecuritySession) Unwrap

func (s *SecuritySession) Unwrap(b, signature []byte) ([]byte, error)

func (*SecuritySession) Wrap

func (s *SecuritySession) Wrap(b []byte) ([]byte, []byte, error)

type Version

type Version struct {
	ProductMajorVersion uint8
	ProductMinorVersion uint8
	ProductBuild        uint16

	NTLMRevisionCurrent uint8
	// contains filtered or unexported fields
}

Version models the NTLM version passed in the various messages.

func DefaultVersion

func DefaultVersion() *Version

DefaultVersion returns a pointer to a NTLM Version struct for the OS which will be populated on Windows or nil otherwise.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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