NTLM(3)
πΈ NAME πΈ
okay bestie, meet Authen::NTLM β an NTLM authentication module. This is the NTLM(3) page from the User Contributed Perl Documentation, and it's here to make NTLM auth make sense, no cap. π
β¨ SYNOPSIS β¨
Like, here's the classic Mail::IMAPClient vibe:
use Mail::IMAPClient;
use Authen::NTLM;
my $imap = Mail::IMAPClient->new(Server=>'imaphost');
ntlm_user($username);
ntlm_password($password);
$imap->authenticate("NTLM", Authen::NTLM::ntlm);
:
$imap->logout;
ntlm_reset;
:
or:
ntlmv2(1);
ntlm_user($username);
ntlm_host($host);
ntlm_password($password);
:
or, main character OO energy:
my $ntlm = Authen::NTLM-> new(
host => $host,
user => $username,
domain => $domain,
password => $password,
version => 1,
);
$ntlm-> challenge;
:
$ntlm-> challenge($challenge);
π DESCRIPTION π
This module gives you methods to use NTLM authentication, periodt. It can be used as an authenticate method with the Mail::IMAPClient module to perform the challenge/response mechanism for NTLM connections, or it can be used on its own for NTLM authentication with other protocols (eg. HTTP). π¦
The implementation is a direct port of the code from fetchmail, which itself based its NTLM implementation on samba. So lowkey this code is not especially efficient, but it will still take a fraction of a second to negotiate a login on a PII, which is likely to be good enough for most situations. π
π FUNCTIONS π
ntlm_domain()β Set the domain to use in the NTLM authentication messages. Returns the new domain. Without an argument, this function returns the current domain entry. β¨ntlm_user()β Set the username to use in the NTLM authentication messages. Returns the new username. Without an argument, this function returns the current username entry. πntlm_password()β Set the password to use in the NTLM authentication messages. Returns the new password. Without an argument, this function returns the current password entry. πntlm_reset()β Resets the NTLM challenge/response state machine so that the next call tontlm()will produce an initial connect message. πntlm()β Generate a reply to a challenge. The NTLM protocol involves an initial empty challenge from the server requiring a message response containing the username and domain (which may be empty). The first call tontlm()generates this first message ignoring any arguments. The second time it is called, it is assumed that the argument is the challenge string sent from the server. This will contain 8 bytes of data which are used in the DES functions to generate the response authentication strings. The result of the call is the final authentication string. Ifntlm_reset()is called, then the next call tontlm()will start the process again allowing multiple authentications within an application. πntlmv2()β Use NTLM v2 authentication. π
π¦ OBJECT API π¦
new %optionsβ Creates an object that accepts the following options:"user","host","domain","password","version". π«Άchallenge [$challenge]β If$challengeis not supplied, first-stage challenge string is generated. Otherwise, the third-stage challenge is generated, where$challengeis assumed to be extracted from the second stage of NTLM exchange. The result of the call is the final authentication string. π
π AUTHOR π
- David (Buzz) Bussenschutt
<davidbuzz@gmail.com>β current maintainer - Dmitry Karasik
<dmitry@karasik.eu.org>β nicentlmv2patch, OO extensions. - Andrew Hobson
<ahobson@infloop.com>β initialntlmv2code - Mark Bush
<Mark.Bush@bushnet.demon.co.uk>β perl port - Eric S. Raymond β author of
fetchmail - Andrew Tridgell and Jeremy Allison for SMB/Netbios code
π₯ SEE ALSO π₯
perl, Mail::IMAPClient, LWP::Authen::Ntlm β go read those too, bestie. π
π HISTORY π
1.09β fix CPAN ticket # 707031.08β fix CPAN ticket # 399251.07β not publicly released1.06β relicense as GPL+ or Artistic1.05β add OO interface by Dmitry Karasik1.04β implementation of NTLMv2 by Andrew Hobson/Dmitry Karasik1.03β fixes long-standing 1 line bugL<http://rt.cpan.org/Public/Bug/Display.html?id=9521>β released by David Bussenschutt 9th Aug 20071.02β released by Mark Bush 29th Oct 2001
okay that's the whole page, bestie. This manual came from perl v5.42.2, dated 2023-07-03, and it's the NTLM(3) page. slay. π
β¨
π¦ where this page comes from
- alpine 3.24: perl-ntlm-doc 1.09-r6 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms