ntlm

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package ntlm is the client side of NTLMv2 authentication (MS-NLMP), as far as an HTTP proxy asks for it: the two messages a client sends, built from a user name, a password and the proxy's challenge.

It exists because the HTTP proxies of Windows-centred office networks commonly accept nothing else (or Negotiate, which a client without a Kerberos ticket answers with these same messages), and a machine behind such a proxy has no other way out. NTLM is old cryptography (MD4 and HMAC-MD5): the package does what the protocol requires and nothing with it protects a session. The password proves the user to the proxy, as the network's operator set it up; RemoHop's own encryption runs inside the tunnel the proxy then opens.

Only NTLMv2 is produced. No message is signed or sealed (a proxy does not ask for it), and no session key is derived.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authenticate

func Authenticate(challengeMsg []byte, c Credentials) ([]byte, error)

Authenticate answers the server's challenge (CHALLENGE_MESSAGE) with the third message (AUTHENTICATE_MESSAGE) for the given credentials.

func IsMessage

func IsMessage(b []byte) bool

IsMessage reports whether b is an NTLM message, as opposed to, say, a Kerberos token inside Negotiate.

func Negotiate

func Negotiate() []byte

Negotiate returns the first message (NEGOTIATE_MESSAGE): it names no domain or workstation and asks for NTLMv2 over Unicode.

func ParseUser

func ParseUser(s string) (user, domain string)

ParseUser splits a user name as people write it: DOMAIN\user gives the domain and the user; user@domain.example (a user principal name) and a bare name are passed on whole, with no domain, which is how a server expects them.

Types

type Credentials

type Credentials struct {
	User     string
	Domain   string
	Password string
}

Credentials identify a user to the proxy.

Jump to

Keyboard shortcuts

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